aboutsummaryrefslogtreecommitdiffstats
path: root/misc/setup/ioquake3.SlackBuild
blob: af261b722c3ea43c8c7b0760388eaf99d1e21c79 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh

CWD=`pwd`
BASE=$CWD/../..
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi

# clean, update
make -C $BASE clean || exit 1
svn up $BASE || exit 1

# extract version info
VERSION=`grep "\#define *PRODUCT_VERSION" $BASE/code/qcommon/q_shared.h | \
  sed -e 's/[^"]*"\(.*\)"/\1/'`

SVN_REV=`LANG=C svnversion $BASE`
if [ ! "$SVN_REV" = "" ]; then
  VERSION=${VERSION}_SVN${SVN_REV}
fi

PKG_VERSION=$VERSION

ARCH=${ARCH:-i586}

BUILD=${BUILD:-1_io}

APP=ioquake3

PKG=$TMP/package-$APP

rm -rf $PKG
mkdir -p $PKG

# build
make -C $BASE release copyfiles COPYDIR="$PKG"/usr/games/$APP|| exit 1

# copy additional files
cp $BASE/BUGS $BASE/COPYING.txt $BASE/ChangeLog $BASE/README $PKG/usr/games/$APP/
cat $CWD/$APP.SlackBuild > $PKG/usr/games/$APP/$APP.SlackBuild

mkdir -p $PKG/usr/share/$APP/icons
cp $BASE/misc/quake3.png $PKG/usr/share/$APP/icons/ioquake3.png

mkdir -p $PKG/usr/bin
cat >> $PKG/usr/bin/ioquake3 << EOF
#!/bin/sh
cd /usr/games/$APP/
./ioquake3.i386 \$*
exit \$? 
EOF
chmod 754 $PKG/usr/bin/ioquake3

mkdir -p $PKG/usr/bin
cat >> $PKG/usr/bin/ioq3ded << EOF
#!/bin/sh
cd /usr/games/$APP/
./ioq3ded.i386 \$*
exit \$? 
EOF
chmod 754 $PKG/usr/bin/ioq3ded

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cat >> $PKG/install/doinst.sh << EOF
chmod 754 /usr/games/$APP/*.i386
chmod 754 /usr/bin/ioquake3 /usr/bin/ioq3ded
EOF
chmod +x $PKG/install/doinst.sh

pushd $PKG
chown -R root:root install/ || exit 1
chown -R root:games usr/ || exit 1
/sbin/makepkg -l y -c n $TMP/$APP-$VERSION-$ARCH-$BUILD.tgz
popd