aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-09-09 22:30:31 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-09-14 23:36:53 +0700
commita3e6561d65c758bda9f1e4df52d0f3fb3e53df8d (patch)
tree8961a070b200bd541e33c13fb1f93897940d9208 /libraries
parent0893fd7499bbe3c1ae48660f98bec92d2aff8424 (diff)
libraries/zziplib: Generate doinst.sh for mandb.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/zziplib/zziplib.SlackBuild41
1 files changed, 40 insertions, 1 deletions
diff --git a/libraries/zziplib/zziplib.SlackBuild b/libraries/zziplib/zziplib.SlackBuild
index 9ac7840a8e2b3..bcdd10b0783a4 100644
--- a/libraries/zziplib/zziplib.SlackBuild
+++ b/libraries/zziplib/zziplib.SlackBuild
@@ -3,6 +3,7 @@
# Slackware build script for zziplib
# Copyright 2012-2020 Larry Hajali <email removed>
+# Copyright 2024 B. Watson <urchlay@slackware.uk>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,6 +23,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20240909 bkw: BUILD=2, generate doinst.sh for mandb.
# 20240823 bkw: update for v0.13.78.
# 20240808 bkw: update for v0.13.77.
# 20240314 bkw: update for v0.13.74.
@@ -42,7 +44,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=zziplib
VERSION=${VERSION:-0.13.78}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -121,4 +123,41 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
+
+# 20240909 bkw: This bit may get added to the SBo templates, so I'll
+# comment it in excruciating detail.
+#
+# The idea is that, immediately after installing the package, the
+# "man -k", "whatis", "apropos" commands should be able to find the
+# newly-installed man pages. This means that, at package install time,
+# they have to be added to the man database with the mandb command.
+#
+# We *could* run "mandb -c" in the doinst.sh, which would rebuild the
+# whole cache, but it takes a long time to do in Slackware 15.0 (several
+# minutes). Running "mandb" without the -c is much quicker, but
+# doesn't always pick up the new man pages (see next paragraph). So
+# instead, we have to add them one-by-one with "mandb -f" commands.
+#
+# In theory, we could run mandb with arguments in doinst.sh, or just
+# rely /etc/cron.daily/man-db to pick up the new man pages every
+# day... but in practice, it fails to pick up new ones, if the
+# timestamp on /usr/man/man1 (man3, etc) is older than the mandb
+# database file. This happens if we install or reinstall a package
+# that was built yesterday or earlier, if it contains any man pages.
+#
+# Note that I'm *not* proposing removing the man pages from the
+# database on package removal. It could be done with a simple "mandb"
+# command in doinst.sh (takes ~10 seconds to run with an SSD, longer
+# with a platter drive), but the daily cron job already handles this
+# correctly, regardless of the timestamps on the man page dirs. So
+# when you remove a package, you'll have to live with its man pages
+# being in the database for up to 24 more hours. This is no worse
+# than its files still being listed in the locate database, and nobody
+# complains about that.
+
+find usr/man -type f -a -name '*.gz' | \
+ sed -e 's,^,chroot . /usr/bin/mandb -f "/,' \
+ -e 's,$," \&>/dev/null,' \
+ >> install/doinst.sh
+
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE