diff options
Diffstat (limited to 'games/warzone2100/warzone2100.SlackBuild')
-rw-r--r-- | games/warzone2100/warzone2100.SlackBuild | 80 |
1 files changed, 47 insertions, 33 deletions
diff --git a/games/warzone2100/warzone2100.SlackBuild b/games/warzone2100/warzone2100.SlackBuild index c9f033a488..5cf5a0cef6 100644 --- a/games/warzone2100/warzone2100.SlackBuild +++ b/games/warzone2100/warzone2100.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # SlackBuild script for Warzone 2100 # Yth | Pont-en-Royans, France | yth@ythogtha.org @@ -23,10 +23,21 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20200811 bkw: fix various issues on behalf of the SBo team: +# - man pages were in /usr/share/man +# - old source wasn't being deleted before extraction +# - removed "-GNinja" from cmake command line: unnecessary, and adds a +# dependency on ninja (which wasn't listed in the .info file) +# - got rid of unneeded template code (no perllocal.pod gets installed) +# - move binary to /usr/games (since it has a section 6 man page) + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=warzone2100 -VERSION=${VERSION:-3.3.0} +VERSION=${VERSION:-4.4.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,22 +47,32 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" + SLKCFLAGS="-O2 -march=i586 -mtune=i686 -Wno-error=maybe-uninitialized" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" + SLKCFLAGS="-O2 -march=i686 -mtune=i686 -Wno-error=maybe-uninitialized" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" + SLKCFLAGS="-O2 -fPIC -Wno-error=maybe-uninitialized" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC -Wno-error=maybe-uninitialized" LIBDIRSUFFIX="64" else - SLKCFLAGS="-O2" + SLKCFLAGS="-O2 -Wno-error=maybe-uninitialized" LIBDIRSUFFIX="" fi @@ -60,7 +81,8 @@ set -e rm -rf $PKG $TMP/$PRGNAM-$VERSION mkdir -p $TMP $PKG $OUTPUT cd $TMP -tar xvf $CWD/$PRGNAM-${VERSION}_src.tar.?z +rm -rf $PRGNAM +tar xvf $CWD/${PRGNAM}_src.tar.?z cd $PRGNAM chown -R root:root . find -L . \ @@ -69,34 +91,26 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -./autogen.sh -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS -fpermissive" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --mandir=/usr/man \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --with-distributor=Slackware \ - --build=$ARCH-slackware-linux - -make -make install-strip DESTDIR=$PKG - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done - -find $PKG -name perllocal.pod \ - -o -name ".packlist" \ - -o -name "*.bs" \ - | xargs rm -f +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_MANDIR=/usr/man \ + -DCMAKE_INSTALL_DOCDIR=/usr/doc/$PRGNAM-$VERSION \ + -DCMAKE_INSTALL_BINDIR=games \ + .. + DESTDIR=$PKG cmake --build . --target install +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Let's not pollute the themed icon directory mv $PKG/usr/share/icons $PKG/usr/share/pixmaps -# --docdir= above works :) cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -104,4 +118,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |