diff options
Diffstat (limited to 'misc/discount/discount.SlackBuild')
-rw-r--r-- | misc/discount/discount.SlackBuild | 77 |
1 files changed, 26 insertions, 51 deletions
diff --git a/misc/discount/discount.SlackBuild b/misc/discount/discount.SlackBuild index 1ae15a59e0..53903f2ec0 100644 --- a/misc/discount/discount.SlackBuild +++ b/misc/discount/discount.SlackBuild @@ -2,30 +2,22 @@ # Slackware build script for discount -# Copyright 2018-2020 Donald Cooley, South Haven, Indiana USA -# Copyright (c) 2011-2015, Antonio Hernández Blas <hba.nihilismus@gmail.com> -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1.- Redistributions of source code 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. +# Original author: Antonio Hernández Blas. +# Formerly maintained by Donald Cooley and later Brandon Pribula. +# Now maintained by B. Watson (urchlay@slackware.uk). + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20230914 bkw: +# - take over maintenance. +# - update for v2.2.7d. +# - don't install VERSION in doc dir. +# - add MAKETEST option, disabled by default, to run 'make test'. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=discount -VERSION=${VERSION:-2.2.7} +VERSION=${VERSION:-2.2.7d} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -38,9 +30,6 @@ if [ -z "$ARCH" ]; then esac fi -# 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 @@ -70,20 +59,17 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + # Disable ldconfig use during 'make install' sed -i 's/LDCONFIG=.*$/LDCONFIG=true/g' configure.inc # Fix file permission -sed -i 's/PROG_INSTALL -m 444/PROG_INSTALL -m 644/g' configure.inc +sed -i '/PROG_INSTALL/s,-m 444,-m 644,g' configure.inc CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -103,28 +89,17 @@ CXXFLAGS="$SLKCFLAGS" \ make -j1 -mkdir -p $PKG/usr/{bin,lib${LIBDIRSUFFIX},include} -make install.everything DESTDIR=$PKG +[ "${MAKETEST:-no}" = "yes" ] && make -j1 test -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 - -if [ -d $PKG/usr/share/man ]; then - mv $PKG/usr/share/man $PKG/usr -fi - -if [ -d $PKG/usr/man ]; then - ( cd $PKG/usr/man - find . -type f -exec gzip -9 {} \; - for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done - ) -fi - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - COPYRIGHT CREDITS README VERSION \ - $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +mkdir -p $PKG/usr/{bin,lib${LIBDIRSUFFIX},include} +make -j1 install.everything DESTDIR=$PKG +strip $PKG/usr/bin/* $PKG/usr/lib*/*.so.*.*.* +gzip -9 $PKG/usr/man/man*/* + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a COPYRIGHT CREDITS README $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc |