2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2010-05-13 00:58:11 +02:00
|
|
|
|
|
|
|
# Slackware build script for rezerwar
|
|
|
|
|
|
|
|
# Written by Larry Hajali <larryhaja[at]gmail[dot]com>
|
|
|
|
|
2022-02-21 18:17:53 +01:00
|
|
|
# 20220221 bkw: Modified by SlackBuilds.org: fix build on 15.0.
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-13 00:58:11 +02:00
|
|
|
PRGNAM=rezerwar
|
2017-03-20 23:39:59 +01:00
|
|
|
VERSION=${VERSION:-0.4.2}
|
2010-05-13 00:58:11 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
|
|
|
|
2010-06-14 08:40:01 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2010-06-04 07:04:42 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-03-20 23:39:59 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:04:42 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2023-02-14 08:49:01 +01:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-03-20 23:39:59 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:58:11 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2022-02-21 18:17:53 +01:00
|
|
|
-exec chmod 755 {} \+ -o \
|
2010-05-13 00:58:11 +02:00
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
2022-02-21 18:17:53 +01:00
|
|
|
-exec chmod 644 {} \+
|
2010-05-13 00:58:11 +02:00
|
|
|
|
2010-06-14 08:40:01 +02:00
|
|
|
SDLCONFIG="sdl-config" \
|
2010-05-13 00:58:11 +02:00
|
|
|
TARGET_BIN="/usr/games" \
|
|
|
|
TARGET_DOC="/usr/doc/$PRGNAM-$VERSION" \
|
|
|
|
TARGET_DATA="/usr/share/$PRGNAM" \
|
2022-02-21 18:17:53 +01:00
|
|
|
MK_EXTRACFLAGS="$SLKCFLAGS -fcommon" \
|
2010-05-13 00:58:11 +02:00
|
|
|
OS="Linux" ./configure
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-19 08:34:39 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 00:58:11 +02:00
|
|
|
|
2010-06-14 08:40:01 +02:00
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
2010-05-13 00:58:11 +02:00
|
|
|
install -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications
|
2010-06-14 08:40:01 +02:00
|
|
|
install -m 0644 $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
|
2010-05-13 00:58:11 +02:00
|
|
|
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|