summaryrefslogtreecommitdiffstats
path: root/games/zennode/zennode.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/zennode/zennode.SlackBuild')
-rw-r--r--games/zennode/zennode.SlackBuild50
1 files changed, 34 insertions, 16 deletions
diff --git a/games/zennode/zennode.SlackBuild b/games/zennode/zennode.SlackBuild
index 7935d957e4..64b75d0e16 100644
--- a/games/zennode/zennode.SlackBuild
+++ b/games/zennode/zennode.SlackBuild
@@ -1,17 +1,24 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for zennode
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211011 bkw: BUILD=3
+# - flesh out slack-desc with some real information.
+# - add man pages for the other tools.
+
# 20180215 bkw: BUILD=2, move binary to /usr/games
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=zennode
VERSION=${VERSION:-1.2.1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -21,7 +28,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -49,15 +60,16 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $ZIPNAME-$VERSION
-unzip $CWD/$PRGNAM-$VERSION.zip
+
+# 20211011 bkw: the -x stuff skips extracting the prebuilt binaries
+# and saves ~700KB in /tmp.
+unzip $CWD/$PRGNAM-$VERSION.zip -x '*/linux*/*' '*/win32/*'
cd $ZIPNAME-$VERSION
unzip $PRGNAM-src.zip
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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+
+# 20211011 bkw: permissions suck, do not revert to template.
+find . -type d -exec chmod 755 {} + -o -type f -exec chmod 644 {} +
# Don't install "compare" as /usr/bin/compare, it conflicts with imagemagick.
# This patch just adds a note to compare.html explaining the situation.
@@ -74,21 +86,27 @@ cd src/$ZIPNAME
ln -s $PRGNAM $PKG/usr/games/$ZIPNAME
cd -
-# man page written for this SlackBuild
+# Man pages written for this SlackBuild. The main zennode.6 was written
+# in raw troff, because I knew no better way to do it back then. The
+# tools man page is generated from zennode-tools.rst, q.v.
+PKGMAN6=$PKG/usr/man/man6
mkdir -p $PKG/usr/man/man6
sed "s,@DOCDIR@,/usr/doc/$PRGNAM-$VERSION/," < $CWD/$PRGNAM.6 \
- | gzip -c > $PKG/usr/man/man6/$PRGNAM.6.gz
+ | gzip -c > $PKGMAN6/$PRGNAM.6.gz
+ln -s $PRGNAM.6.gz $PKGMAN6/$ZIPNAME.6.gz
-# install docs with "install -m0644" rather than "cp -a" because upstream's
-# permissions aren't what we want.
+gzip -9c < $CWD/zennode-tools.6 > $PKGMAN6/zennode-tools.6.gz
+for i in bspdiff bspinfo zn-compare; do
+ ln -s zennode-tools.6.gz $PKGMAN6/$i.6.gz
+done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/samples
-install -m0644 doc/* src/COPYING $PKG/usr/doc/$PRGNAM-$VERSION
-install -m0644 Samples/* $PKG/usr/doc/$PRGNAM-$VERSION/samples
+cp -a doc/* src/COPYING $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a Samples/* $PKG/usr/doc/$PRGNAM-$VERSION/samples
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:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE