diff options
Diffstat (limited to 'system/bin2iso/bin2iso.SlackBuild')
-rw-r--r-- | system/bin2iso/bin2iso.SlackBuild | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/system/bin2iso/bin2iso.SlackBuild b/system/bin2iso/bin2iso.SlackBuild index 51c13bbd10..3bb700fe98 100644 --- a/system/bin2iso/bin2iso.SlackBuild +++ b/system/bin2iso/bin2iso.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for bin2iso -# Copyright 2016 Hunter Sezen California, USA +# Copyright 2016, 2019 Hunter Sezen California, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=bin2iso VERSION=${VERSION:-19b} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,7 +38,14 @@ 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} @@ -54,7 +64,7 @@ else LIBDIRSUFFIX="" fi -set -e +set -eu rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT @@ -63,12 +73,16 @@ rm -rf $PRGNAM-$VERSION mkdir $PRGNAM-$VERSION cd $PRGNAM-$VERSION -[ -z "$CC" ] && CC=cc -$CC $SLKCFLAGS -Wall -o $PRGNAM $CWD/$PRGNAM${VERSION}_linux.c -install -Dm0755 $PRGNAM $PKG/usr/bin/$PRGNAM +${CC:-cc} \ + $(printf %s "$SLKCFLAGS") -Wall -o $PRGNAM \ + $CWD/$PRGNAM${VERSION}_linux.c + +mkdir -p -- "$PKG/usr/bin" +cp -- $PRGNAM "$PKG/usr/bin/" +chmod 0755 -- "$PKG/usr/bin/$PRGNAM" -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 +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 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp $CWD/readme.txt $PKG/usr/doc/$PRGNAM-$VERSION @@ -78,4 +92,4 @@ 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:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |