#!/bin/bash # Slackware build script for hfsprescue # # Upstream: https://www.plop.at/en/hfsprescue.html (Elmar Hanlhofer) # # Source note: plop.at's own downloads are dead -- its download host returns # 403 ("Server unable to read htaccess file"). The source used here is the # master snapshot from the kaisenlinux mirror, which is genuinely 3.6: # configure.ac reads AC_INIT(hfsprescue, [3.6 07/04/2023]) and the ChangeLog # matches upstream's 3.6 entry. Treat the mirror as the source; do not waste # time trying plop.at. # # The zip ships a generated ./configure, so autoreconf is not needed. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=hfsprescue VERSION=${VERSION:-3.6} SRCZIP=${SRCZIP:-hfsprescue-master.zip} SRCDIR=${SRCDIR:-hfsprescue-master} BUILD=${BUILD:-1} TAG=${TAG:-_pmagic} PKGTYPE=${PKGTYPE:-txz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$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 $SRCDIR unzip -q $CWD/$SRCZIP cd $SRCDIR 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 {} \+ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --build=$ARCH-slackware-linux make make install DESTDIR=$PKG 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/usr/man -type f -exec gzip -9 {} \; 2>/dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS COPYING LICENSE ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION 2>/dev/null || true cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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