summaryrefslogtreecommitdiffstats
path: root/release/maketarball.in
blob: 81d40e4642f4402a7dc16f396df1c39224f8a9c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash

set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT

TMPDIR=

onexit()
{
	if [ ! "$TMPDIR" = "" ]; then
		rm -rf $TMPDIR
	fi
}

PACKAGE_NAME=@CMAKE_PROJECT_NAME@
VERSION=@VERSION@
BUILD=@BUILD@
SRCDIR=@CMAKE_SOURCE_DIR@
OS=@CMAKE_SYSTEM_NAME@
CPU=@CMAKE_SYSTEM_PROCESSOR@
PREFIX=@CMAKE_INSTALL_PREFIX@
CFLAGS="@CMAKE_C_FLAGS@"
if [[ $CFLAGS = *-m32* ]]; then
	CPU=i686
fi
PACKAGE_FILE=$PACKAGE_NAME-$OS-$CPU-$VERSION.tar.gz
SERVER=0

if [ $# -gt 0 ]; then
	if [ "$1" = "server" ]; then
		SERVER=1
	fi
fi

umask 022
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
rm -f $PACKAGE_FILE
OUTDIR=$TMPDIR/inst/$PREFIX

mkdir -p $OUTDIR/bin
mkdir -p $OUTDIR/man/man1

make DESTDIR=$TMPDIR/inst install
if [ $SERVER = 1 ]; then
	install -m 755 ./xorg.build/bin/Xvnc $OUTDIR/bin/
	install -m 644 ./xorg.build/man/man1/Xvnc.1 $OUTDIR/man/man1/Xvnc.1
	install -m 644 ./xorg.build/man/man1/Xserver.1 $OUTDIR/man/man1/Xserver.1
	mkdir -p $OUTDIR/lib/dri/
	install -m 755 ./xorg.build/lib/dri/swrast_dri.so $OUTDIR/lib/dri/
fi

pushd $TMPDIR/inst
tar cfz ../$PACKAGE_FILE .
popd
cp $TMPDIR/$PACKAGE_FILE .

exit