games/UrbanTerror: Fix ARCH section and symlinks.

Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
D Woodfall 2023-05-16 20:18:32 +01:00 committed by Willy Sudiarto Raharjo
parent 01d7a53483
commit cf4ad915ea
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -31,12 +31,20 @@ BUILD=${BUILD:-1}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz} PKGTYPE=${PKGTYPE:-tgz}
# ARCH/EXEC simplified and moved together
# DW 2023-05-16 02:03:15 +0100
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
case "$( uname -m )" in ARCH=$( uname -m )
i?86) ARCH=i586 ;; fi
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;; if [ "$ARCH" = "x86_64" ]; then
esac EXEC="x86_64"
elif [[ $ARCH =~ i?86 ]]; then
EXEC="i386"
ARCH="i586"
else
echo "$ARCH architecture is unsupported" >/dev/stderr
exit 1
fi fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
@ -51,13 +59,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp} OUTPUT=${OUTPUT:-/tmp}
LIBDIRSUFFIX=
if [ "$ARCH" = "i386" ]; then
EXEC="i386"
elif [ "$ARCH" = "x86_64" ]; then
EXEC="x86_64"
fi
CLIENT_EXEC=${CLIENT_EXEC:-Quake3-UrT.$EXEC} CLIENT_EXEC=${CLIENT_EXEC:-Quake3-UrT.$EXEC}
SERVER_EXEC=${SERVER_EXEC:-Quake3-UrT-Ded.$EXEC} SERVER_EXEC=${SERVER_EXEC:-Quake3-UrT-Ded.$EXEC}
@ -80,8 +81,10 @@ find -L . \
# Create symlinks in /usr/games # Create symlinks in /usr/games
mkdir -p $PKG/usr/games mkdir -p $PKG/usr/games
cd $PKG/usr/games cd $PKG/usr/games
ln -sf /usr/share/games/UrbanTerror43/$CLIENT_EXEC urbanterror # changed to relative paths
ln -sf /usr/share/games/UrbanTerror43/$SERVER_EXEC urbanterror_server # DW 2023-05-16 02:04:30 +0100
ln -sf ../share/games/UrbanTerror43/$CLIENT_EXEC urbanterror
ln -sf ../share/games/UrbanTerror43/$SERVER_EXEC urbanterror_server
cd - cd -
# Add a menu entry and icon # Add a menu entry and icon
@ -90,16 +93,18 @@ cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/q3urt.png > $PKG/usr/share/pixmaps/q3urt.png cat $CWD/q3urt.png > $PKG/usr/share/pixmaps/q3urt.png
# Remove unused files from the package # Remove unused files from the package
cd $PKG/usr/share/games/UrbanTerror43 cd $PKG/usr/share/games/UrbanTerror43
rm -f *.exe rm -f *.exe
rm -rf Quake3-UrT.app rm -rf Quake3-UrT.app
[ "$EXEC" != "i386" ] && rm -f *.i386 # a bit easier to parse than a negative test?
[ "$EXEC" != "x86_64" ] && rm -f *.x86_64 # DW 2023-05-16 02:03:15 +0100
cd q3ut4 [ "$EXEC" = "x86_64" ] && rm -vf *.i386
rm *.cfg [ "$EXEC" = "i386" ] && rm -vf *.x86_64
rm *.txt cd q3ut4
rm *.doc rm *.cfg
chmod -x *.pk3 rm *.txt
rm *.doc
chmod -x *.pk3
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
install -m 644 $CWD/docs/* $PKG/usr/doc/$PRGNAM-$VERSION/ install -m 644 $CWD/docs/* $PKG/usr/doc/$PRGNAM-$VERSION/