summaryrefslogtreecommitdiffstats
path: root/development/inform/inform.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/inform/inform.SlackBuild')
-rw-r--r--development/inform/inform.SlackBuild203
1 files changed, 152 insertions, 51 deletions
diff --git a/development/inform/inform.SlackBuild b/development/inform/inform.SlackBuild
index 5cd8c29ace..0e5e1a7083 100644
--- a/development/inform/inform.SlackBuild
+++ b/development/inform/inform.SlackBuild
@@ -1,15 +1,43 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for inform
-# 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.
+# 20230118 bkw: updated for v6.41_r2.
+# - add the Inform 6 Addendum to the package.
+# - destdir.diff had to change, can't build previous version any more.
+# - symlink library demos and tutorial to doc dir.
+
+# 20210831 bkw:
+# - updated for v6.35_r2 (upstream changed their version numbering
+# scheme again). script had to change a lot, so can't build old
+# versions any more.
+
+# 20201104 bkw: updated for 6.34_6.12.4. In case anyone's wondering
+# why I use a self-hosted URL for the source, it's because upstream
+# moves the old source immediately when a new release is made. Also
+# moved the binary to /usr/games and the man page to section 6.
+
+# 20191216 bkw: updated for 6.34_6.12.2. The secondary version number
+# is the inform6 library version. This script can no longer build the
+# old 6.32.1 version, but it should be fine for future releases.
+
+# The old 6.32.1 release shipped with a lot more include
+# files. Upstream removed a lot of them because they were either buggy
+# or license-incompatible. If you're trying to compile something that
+# needs any of these old includes, please let me know. If there's enough
+# demand, I'll dig up the old includes and re-add them to the package.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=inform
-VERSION=${VERSION:-6.32.1}
+VERSION=${VERSION:-6.41_r2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +47,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}
@@ -40,61 +72,130 @@ fi
set -e
+MANVER="${MANVER:-4}"
+MANUAL=designers_manual_${MANVER}.zip
+TARVER="${VERSION//_/-}"
+DOCDIR=/usr/doc/$PRGNAM-$VERSION
+PKGDOC=$PKG/$DOCDIR
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
+rm -rf $PRGNAM-$TARVER
+tar xvf $CWD/$PRGNAM-$TARVER.tar.gz
+cd $PRGNAM-$TARVER
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 {} \;
-
-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-strip DESTDIR=$PKG
-
-# Grr. Make this a relative link. Otherwise it points to /tmp/SBo
-# after installation.
-cd $PKG/usr/bin
- rm -f $PRGNAM
- ln -s $PRGNAM-* $PRGNAM
-cd -
-
-# Move the manual to where Slack users expect it to be.
-DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
-mkdir -p $DOCDIR
-mv $PKG/usr/share/$PRGNAM/manual $DOCDIR/manual
-
-# Install the demo sources + tutorials, too. Very instructive for someone
-# learning to use inform.
-mkdir -p $DOCDIR/demos
-cp demos/*.inf demos/README $DOCDIR/demos
-mkdir -p $DOCDIR/tutorials
-rm tutor/Make*
-cp tutor/* $DOCDIR/tutorials
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# 20201104 bkw: Since inform is for game purposes, install the binary
+# to /usr/games, and its man page to section 6. Also change the
+# "see also" to a man page that actually might exist.
+sed -e '1s/"1"/"6"/' -e "s,zcode-interpreter,frotz," $PRGNAM.1 > $PRGNAM.6
+
+# 20201104 bkw: upstream now supports DESTDIR again.
+# 20210831 bkw: upstream *broke* DESTDIR again. Sigh.
+patch -p1 < $CWD/destdir.diff
+
+# 20210831 bkw: install-strip failed with "text file busy" on -current,
+# use -Wl,-s to build the binary stripped in the first place.
+
+make install \
+ OPTS="$SLKCFLAGS" \
+ LDFLAGS="-Wl,-s" \
+ BINDIR=/usr/games \
+ MANDIR=/usr/man/man6 \
+ MANPAGE=$PRGNAM.6 \
+ PREFIX=/usr \
+ TUTORDIR=$DOCDIR/tutor \
+ DEMODIR=$DOCDIR/demos \
+ DESTDIR=$PKG
+
+gzip $PKG/usr/man/man?/*.?
+
+# 20201104 bkw: the binary got moved, be kind and provide a symlink
+mkdir -p $PKG/usr/bin
+ln -s ../games/$PRGNAM $PKG/usr/bin/$PRGNAM
+
+# Inform started life (and is still used primarily) on OSes
+# with case-insensitive filenames, meaning that a lot of inform
+# source refers to e.g. VerbLib or even VERBLIB (with or without
+# the .h at the end, which could also be capitalized as .H). The
+# Makefile can create a few symlinks to support this, but let's
+# be more all-inclusive. We got 8 .h files, and end up with 70+
+# symlinks. There's no kill like overkill!
+( cd $PKG/usr/share/$PRGNAM/std/lib
+ for file in *.h; do
+ name=${file%%.*}
+ # Name.h NAME.h
+ for link in ${name^}.h ${name^^}.h; do
+ ln -sf $file $link
+ done
+ done
+
+ # MixedCase isn't standardized, these are guesses. Some are pretty
+ # unlikely, but they don't cost much. Better to have and not need,
+ # than to need and not have.
+ for link in VerbLib VerbLIB verbLib verbLIB \
+ InFix InFIX inFix inFIX \
+ InfGlk InfGLK infGlk infGLK \
+ LinkLpa LinkLPA linkLpa linkLPA
+ do
+ ln -sf ${link,,}.h $link.h
+ done
+
+ # Any of the above might appear with .H. Use readlink so all the
+ # variant names link to the real file (no symlinks to symlinks).
+ # This might be overcautious: the example code all just says
+ # e.g. 'Include "Parser"', without the .h.
+ for file in *.h; do
+ dest="${file%%.*}.H"
+ [ -L "$file" ] && file="$( readlink $file )"
+ ln -sf $file $dest
+ done
+)
+
+# Upstream removed the manual for licensing reasons. It belongs in the
+# binary package IMO.
+mkdir -p $PKGDOC/manual
+( cd $PKGDOC/manual
+ unzip $CWD/$MANUAL
+ # manual has no subdirs
+ chmod 644 *
+ chown root.root *
+)
# Inform Beginners' Guide, required reading.
-cat $CWD/IBG.pdf > $DOCDIR/inform_beginners_guide.pdf
-
-cp -a ARTISTIC AUTHORS COPYING NEWS README docs/* $DOCDIR
-cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$PRGNAM.SlackBuild
+cat $CWD/IBG.pdf > $PKGDOC/inform_beginners_guide.pdf
+ln -s inform_beginners_guide.pdf $PKGDOC/IBG.pdf
+
+# Also the addendum to the manual, because the manual's a bit dated.
+cat $CWD/I6-Addendum.html > $PKGDOC/inform_6_addendum.html
+ln -s inform_6_addendum.html $PKGDOC/I6-Addendum.html
+
+# Library documentation should be visibile in /usr/doc.
+mkdir -p $PKGDOC/lib
+for i in ChangeLog README.txt voices_and_tenses.txt; do
+ ln -s ../../../share/$PRGNAM/std/lib/$i $PKGDOC/lib
+done
+
+# 20230118 bkw: Demos and tutorial will be easier to find if they're
+# visible from the doc dir.
+ln -s ../../share/inform/std/{demos,tutor} $PKGDOC
+
+# Same for punyinform docs.
+mkdir -p $PKGDOC/punyinform
+for i in README.md LICENSE documentation; do
+ ln -s ../../../share/$PRGNAM/punyinform/$i $PKGDOC/punyinform
+done
+
+# ARTISTIC and COPYING are redundant: src/licence.txt includes the
+# full text of both.
+cp -a AUTHORS NEWS README* src/*.txt src/*.html docs/* $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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