#!/bin/bash # Slackware build script for lppf # Original author: Hunter Sezen. # Modified and now maintained by B. Watson . # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20240901 bkw: BUILD=2 # - new maintainer. # - relicense as WTFPL. # - get INSTALL out of doc dir. # - keep Hunter's DEBUG option, but make it DEBUG=yes rather than # DEBUG=1 (to match my other scripts). # - expand README and slack-desc a bit. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=lppf VERSION=${VERSION:-0.1_rc1} SRCVER=$(echo $VERSION | tr _ -) BUILD=${BUILD:-2} 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} O="-O2" [ "${DEBUG:-no}" = "yes" ] && O="-O0 -g" if [ "$ARCH" = "i586" ]; then SLKCFLAGS="$O -march=i586 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="$O -march=i686 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="$O -fPIC" else SLKCFLAGS="$O" fi set -eu rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$SRCVER tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz cd $PRGNAM-$SRCVER 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 {} + patch -p1 < $CWD/Makefile.diff patch -p1 < $CWD/braces.diff make CFLAGS="$SLKCFLAGS" [ "${DEBUG:-no}" = "yes" ] || strip $PRGNAM make install \ PREFIX=/usr \ DOCDIR=/usr/doc/$PRGNAM-$VERSION \ DESTDIR=$PKG PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE