#!/bin/bash # Slackware build script for pinball # Original author: Hunter Sezen. # Modified and now maintained by B. Watson . # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20251112 bkw: # - update for latest git (0.3.4+20250512_2827e75). this fixes the display # of the names of the controls in the config->keyboard menu. # - fix man page (correct doc path under SEE ALSO). # 20240902 bkw: BUILD=3 # - new maintainer. # - relicense as WTFPL. # - add .desktop and icon to package. # - add doinst.sh. # - clean up README and slack-desc. # - add Debian's man page for pinball-config. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=pinball VERSION=${VERSION:-0.3.4+20250512_2827e75} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi 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" 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 -eu rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.[xg]z cd $PRGNAM-$VERSION chown -R root:root . find . ! -type l -a \ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) # 20251112 bkw: automake fails without this: touch README sh configure.sh CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --bindir=/usr/games \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --datadir=/usr/share/games \ --disable-sdltest \ --enable-static=no \ --build=$ARCH-slackware-linux make make install-strip DESTDIR=$PKG mkdir -p $PKG/usr/share/{applications,pixmaps,icons/hicolor/48x48/apps} cp -a pinball.desktop $PKG/usr/share/applications cp -a pinball.png $PKG/usr/share/icons/hicolor/48x48/apps ln -s ../icons/hicolor/48x48/apps/pinball.png $PKG/usr/share/pixmaps/pinball.png mkdir -p $PKG/usr/man/man6 sed "s,@VERSION@,$VERSION,g" < $CWD/pinball-config.6 | \ gzip > $PKG/usr/man/man6/pinball-config.6.gz # 20251112 bkw: the docs/ dir is the source for the website, don't package. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC rm -f BUILD.md # don't need in package (this script built it already) cp -a AUTHORS COPYING ChangeLog License.txt *.md $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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