diff options
Diffstat (limited to 'system/mount-zip')
-rw-r--r-- | system/mount-zip/README | 8 | ||||
-rw-r--r-- | system/mount-zip/mount-zip.SlackBuild | 103 | ||||
-rw-r--r-- | system/mount-zip/mount-zip.info | 10 | ||||
-rw-r--r-- | system/mount-zip/slack-desc | 19 | ||||
-rw-r--r-- | system/mount-zip/slackware-15.0-libzip.diff | 21 |
5 files changed, 161 insertions, 0 deletions
diff --git a/system/mount-zip/README b/system/mount-zip/README new file mode 100644 index 0000000000..0977216aca --- /dev/null +++ b/system/mount-zip/README @@ -0,0 +1,8 @@ +mount-zip (FUSE file system for zip archives) + +mount-zip mounts a ZIP archive as a read-only FUSE file system, which +can then be explored and read by any application. + +mount-zip aspires to be an excellent ZIP mounter. It starts quickly, +uses little memory, decodes encrypted files, and provides on-the-go +decompression and caching for maximum efficiency. 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 diff --git a/system/mount-zip/mount-zip.info b/system/mount-zip/mount-zip.info new file mode 100644 index 0000000000..37404aa301 --- /dev/null +++ b/system/mount-zip/mount-zip.info @@ -0,0 +1,10 @@ +PRGNAM="mount-zip" +VERSION="1.0.12" +HOMEPAGE="https://github.com/google/mount-zip" +DOWNLOAD="https://github.com/google/mount-zip/archive/v1.0.12/mount-zip-1.0.12.tar.gz" +MD5SUM="f7e2ace30c17737b166c413cee25d49b" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/mount-zip/slack-desc b/system/mount-zip/slack-desc new file mode 100644 index 0000000000..99285a79e6 --- /dev/null +++ b/system/mount-zip/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +mount-zip: mount-zip (FUSE file system for zip archives) +mount-zip: +mount-zip: mount-zip mounts a ZIP archive as a read-only FUSE file system, which +mount-zip: can then be explored and read by any application. +mount-zip: +mount-zip: mount-zip aspires to be an excellent ZIP mounter. It starts quickly, +mount-zip: uses little memory, decodes encrypted files, and provides on-the-go +mount-zip: decompression and caching for maximum efficiency. +mount-zip: +mount-zip: +mount-zip: diff --git a/system/mount-zip/slackware-15.0-libzip.diff b/system/mount-zip/slackware-15.0-libzip.diff new file mode 100644 index 0000000000..f3cc7c34b7 --- /dev/null +++ b/system/mount-zip/slackware-15.0-libzip.diff @@ -0,0 +1,21 @@ +diff -Naur mount-zip-1.0.9/lib/data_node.cc mount-zip-1.0.9.patched/lib/data_node.cc +--- mount-zip-1.0.9/lib/data_node.cc 2023-08-17 01:41:40.000000000 -0400 ++++ mount-zip-1.0.9.patched/lib/data_node.cc 2023-08-29 02:59:18.342998941 -0400 +@@ -269,7 +269,7 @@ + ZipFile file = Reader::Open(zip, id); + assert(file); + +- const bool seekable = zip_file_is_seekable(file.get()) > 0; ++ const bool seekable = false; + if (seekable) { + Log(LOG_DEBUG, "No need to cache ", file_node, ": File is seekable"); + return false; +@@ -293,7 +293,7 @@ + ZipFile file = Reader::Open(zip, id); + assert(file); + +- const bool seekable = zip_file_is_seekable(file.get()) > 0; ++ const bool seekable = false; + Reader::Ptr reader(seekable ? new UnbufferedReader(std::move(file), id, size) + : new BufferedReader(zip, std::move(file), id, + size, &cached_reader)); |