#!/bin/sh [ -z $PREPKG ] && exit 1 PACKAGE=tribes2 VERSION=25034 FILES=$(cd $(dirname $0) ; pwd) # cdrom contents MUST have been previously copied to the following directory # loop mounting the iso is outside the scope of this build script if [ ! -d $PACKAGE-21570-cdrom ] ; then echo "cannot find cdrom contents. aborting" exit 1 fi mkdir -p \ $PREPKG/{install,usr/{doc/$PACKAGE-$VERSION,games,share/games/$PACKAGE}}/ # first up, copy original game data to the proper locations pushd $PACKAGE-21570-cdrom/ cp -a \ base/ menu/ bin/x86/glibc-2.1/* README* \ Tribes2_Manual.pdf console_start.cs icon.* \ $PREPKG/usr/share/games/$PACKAGE/ tar xf \ profiles.tar.gz \ -C $PREPKG/usr/share/games/$PACKAGE/ popd # we only want the incremental patches. not tribes2-25034-cdrom-x86.run for PATCH in $FILES/patches/$PACKAGE-?????-x86.run ; do # extract DIR=$(basename $PATCH .run) mkdir $DIR sed '1,/^END_OF_STUB$/d' $PATCH | tar zxf - -C $DIR # keep the first version of loki_patch that we find (from 22002) # loki_patch from 22228 onwards throws the following error: # loki_patch: dynamic-link.h:57: elf_get_dynamic_info: Assertion `! "bad dynamic tag"' failed. if [ ! -e loki_patch ] ; then cp -p $DIR/bin/Linux/x86/loki_patch . fi # patch pushd $DIR ../loki_patch patch.dat $PREPKG/usr/share/games/$PACKAGE/ popd # timestamp touchups pushd $DIR/data/ for SRC in $(find * ! -type d) ; do DST=$PREPKG/usr/share/games/$PACKAGE/${SRC/.0} if [ -e $SRC -a -e $DST ] ; then touch -r $SRC $DST fi done popd done ## breaking with tradition. hardlink rather than copy documentation pushd $PREPKG/usr/share/games/$PACKAGE/ cp -al \ base/EULA.txt classic/classic_*.txt Inside_Team_Rabbit_2.txt \ README* Tribes2_Manual.pdf \ $PREPKG/usr/doc/$PACKAGE-$VERSION/ popd # necessary for online play (client & server): cp -p \ $FILES/patches/AlternateMasterSupport.vl2 \ $PREPKG/usr/share/games/$PACKAGE/base/ # necessary for online play (server): tar xf \ $FILES/patches/$PACKAGE-lan-fix-linux.tar.gz ./xdelta3 decode -s \ $PREPKG/usr/share/games/$PACKAGE/${PACKAGE}d.dynamic \ $PACKAGE-lan-fix-linux.xdelta \ $PREPKG/usr/share/games/$PACKAGE/${PACKAGE}d-lan.dynamic touch -r \ $PACKAGE-lan-fix-linux.xdelta \ $PREPKG/usr/share/games/$PACKAGE/${PACKAGE}d-lan.dynamic cp \ $FILES/scripts/$PACKAGE \ $PREPKG/usr/games/ chmod +x \ $PREPKG/usr/games/$PACKAGE cp \ $FILES/slack-desc \ $PREPKG/install/ # clean up permissions & ownerships find $PREPKG \ \( -type d -o -type f -a \( -name "$PACKAGE*" -o -name 't2launch' \) \) \ -exec chmod 0755 {} \; \ -o -type f -a \( ! -name "$PACKAGE*" -o ! -name 't2launch' \) \ -exec chmod 0644 {} \; chown -R \ root:root $PREPKG