#!/bin/bash # Slackware build script for xzgv # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # Original author: Markus Reichelt. # Now maintained by B. Watson . # 20230308 bkw: BUILD=2, add doinunst.sh to clean up GNU info index. # 20230102 bkw: v0.9.2_2 # - take over maintenance. # - relicense as WTFPL. # - include Debian's improved .desktop file and PNG icons. # - include GNU info doc in package. # - fix documentation permissions. # - get rid of useless INSTALL from docs. # - use Debian patch to fix man page nroff formatting. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=xzgv VERSION=${VERSION:-0.9.2_2} 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} 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 SRCVER="$( echo $VERSION | cut -d_ -f1 )" DEBVER="$( echo $VERSION | cut -d_ -f2 )" rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$SRCVER tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz cd $PRGNAM-$SRCVER tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.xz 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 {} \+ # use Debian's .desktop file cp debian/$PRGNAM.desktop src/ # use 48x48 old-style icon sed -i 's,icon-64,icon-48,' src/Makefile # apply Debian's patches (currently, fixes for the man page) for i in $( cat debian/patches/series ); do patch -p1 < debian/patches/$i done cat > config.mk < $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/douninst.sh > $PKG/install/douninst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE