#!/bin/sh # Slackware build script for doomseeker # Written by B. Watson (yalhcru@gmail.com) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20191211 bkw: updated for v1.3. qt4 support was dropped, qt5 now required. # 20181218 bkw: updated for v1.2. Upstream has changed things around, # so this script won't build 1.1 any longer. PRGNAM=doomseeker VERSION=${VERSION:-1.3} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ mkdir -p build cd build # Buggy cmake install target looks in wrong place for icon ln -s ../media . cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ -DCMAKE_BUILD_TYPE=Release .. make make install/strip DESTDIR=$PKG cd .. # Shared lib gets installed to wrong place, easier to fix it here than patch. [ "$LIBDIRSUFFIX" != "" ] && \ [ -e "$PKG/usr/lib" ] && \ mv $PKG/usr/lib $PKG/usr/lib$LIBDIRSUFFIX # This is a game (or anyway a game utility, the binary # belongs in /usr/games. cmake accepts and totally ignores # "-DCMAKE_INSTALL_BINDIR=games" so just move the damn thing after # install. mv $PKG/usr/bin $PKG/usr/games # cmake is also ignoring -DCMAKE_INSTALL_DOCDIR. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION rm -rf $PKG/usr/share/doc chmod 755 $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/engines/*.so strip $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/engines/*.so # only got the one PNG icon here mv $PKG/usr/share/icons $PKG/usr/share/pixmaps cp -a LICENSE *.md $PKG/usr/doc/$PRGNAM-$VERSION 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 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}