diff options
Diffstat (limited to 'system/mount-zip/mount-zip.SlackBuild')
-rw-r--r-- | system/mount-zip/mount-zip.SlackBuild | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/system/mount-zip/mount-zip.SlackBuild b/system/mount-zip/mount-zip.SlackBuild new file mode 100644 index 0000000000..2c4bd5daf3 --- /dev/null +++ b/system/mount-zip/mount-zip.SlackBuild @@ -0,0 +1,103 @@ +#!/bin/bash + +# Slackware build script for mount-zip + +# Original author: Charadon +# Modified and now maintained by B. Watson (urchlay@slackware.uk). + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20240209 bkw: +# - update for v1.0.12. +# - relicense as WTFPL with permission from Charadon. +# - add man page, now that there is one. + +# 20230828 bkw: take over maintenance, update for v1.0.9. +# - actually use SLKCFLAGS. +# - add CONTRIBUTING.md to the doc dir. +# - add patch to allow v1.0.9 to build on Slackware 15.0. +# - trim down README and slack-desc a bit. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=mount-zip +VERSION=${VERSION:-1.0.12} +BUILD=${BUILD:-1} +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" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" +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 +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 {} + + +# 20230829 bkw: Stop mount-zip from requiring a version of libzip +# greater than 1.8.0. Long explanation: + +# mount-zip calls zip_file_is_seekable() to decide whether it should +# bother to cache the zip file it's working with. This call was added +# to libzip in its version 1.9.0, and Slackware 15.0 only has 1.8.0. + +# It turns out, zip_file_is_seekable() only returns true for zip +# files that are not compressed (and not encrypted). This means that +# "stored" zip files are the only ones that don't get cached. This +# patch causes all zip files to get cached. It won't have much impact +# because non-compressed zip files are pretty rare anyway. + +# This patch should go away when Slackware 15.1 get released. + +patch -p1 < $CWD/slackware-15.0-libzip.diff + +# 20230829 bkw: actually use SLKCFLAGS. +sed -i "/^CXXFLAGS/s,-O2,$SLKCFLAGS," Makefile lib/Makefile +make +install -s -Dm755 mount-zip $PKG/usr/bin/mount-zip + +# 20240209 bkw: upstream now ships a man page. +mkdir -p $PKG/usr/man/man1 +gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +rm -f INSTALL.md +cp -a LICENSE changelog *.md $PKG/usr/doc/$PRGNAM-$VERSION +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 |