#!/bin/bash # Slackware build script for l-smash # Copyright 2015, Andrew Strong, Blue Mountains Australia. # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Now maintained by B. Watson # 20240822 bkw: update for v2.18.0 (vimeo fork). This is what FreeBSD ships. # 20230708 bkw: BUILD=4, install shared lib +x. # 20220411 bkw: BUILD=3, put README in right place (not /install!) # 20210910 bkw: include our own README since there are no docs # 20180215 bkw: update for 2.14.5 # 20170302 bkw: use long-format github URL # 20160817 bkw: # - take over maintenance # - update for 2.9.1 # - actually use SLKCFLAGS # - i486 => i586 cd $(dirname $0) ; CWD=$(pwd) PRGNAM=l-smash VERSION=${VERSION:-2.18.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} # 20240822 bkw: parser has been split out into its own project. OBUVER=478adcc872d5a8a19443e87910508e261a0a60ba 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 -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 # 20240822 bkw: instead of building obuparse as a separate library, # we're going to build its single source file in-tree. tar xvf $CWD/obuparse-$OBUVER.tar.gz mv obuparse-$OBUVER/*.[ch] . rm -rf obuparse-$OBUVER 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 {} \+ # 20240822 bkw: build and link obuparse.o in-tree, instead of requiring # it to be linked as a library. -I. is already in CFLAGS, so we don't have # to worry about the include file. sed -i -e '/^LIBS/s, *-lobuparse,,' \ -e '/^SRCS/s,"","obuparse.c",' \ configure # -Wl,-s = strip binaries at link time. ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --enable-shared \ --extra-cflags="$SLKCFLAGS" \ --extra-ldflags="-Wl,-s" make make install DESTDIR=$PKG chmod 755 $PKG/usr/lib*/*.so.* mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # 20210910 bkw: upstream didn't bother with any docs other than --help # messages. Include our own README, which at least tells the user the # names of the binaries (hint: none of them are called l-smash!), and # tells him to use the --help option. cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README 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