aboutsummaryrefslogtreecommitdiffstats
path: root/code/unix/setup/doit
blob: 0cc49939b158ef2a9bb341c1759d4eac6793a358 (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
#!/bin/bash

: ${MAKESELF:=/usr/share/loki-setup/makeself}
: ${SETUPIMAGE:=/usr/share/loki-setup/image}

: ${VERSION:=0.0_`date +%Y%m%d%H%M`}
: ${RELEASE:=0}

set -e
set -x

arch=`uname -m`
case "$arch" in
	i?86) arch=i386 ;;
esac

rm -rf image
mkdir image

### loki-setup files
cp -a $SETUPIMAGE/{setup.data,setup.sh} image/

### splash
rm -f image/setup.data/splash.xpm
[ -e splash.xpm ] && cp splash.xpm image/setup.data/splash.xpm

### binaries
mkdir image/tmp
pushd image/tmp
mkdir baseq3 demoq3 missionpack
src="../../../release$arch-glibc/"
install -m 755 $src/linuxquake3 ioquake3.$arch
install -m 755 $src/linuxq3ded ioq3ded.$arch
install -m 644 $src/baseq3/*.so baseq3
install -m 644 $src/missionpack/*.so missionpack
pushd demoq3
ln -s ../baseq3/*.so .
popd
popd

tar --owner=root --group=root -C image/tmp -cf image/ioquake3.tar .
rm -rf image/tmp

### setup.xml
sed 's/@VERSION@/'$VERSION'/g' < setup.xml > image/setup.data/setup.xml

### start script
mkdir -p image/bin/Linux/$arch
ln -s x86_64 image/bin/Linux/amd64 # $§&%!!
install -m 755 ioquake3.sh image/bin/Linux/$arch/ioquake3
install -m 755 ioq3demo.sh image/bin/Linux/$arch/ioq3demo

### README and COPYING
install -m 644 ../../../README image/README
install -m 644 ../../../COPYING.txt image/COPYING

### makeself installer
$MAKESELF/makeself.sh image ioquake3-$VERSION-$RELEASE.$arch.run "icculus.org/quake3 $VERSION" ./setup.sh