summaryrefslogtreecommitdiffstats
path: root/games/frotz
diff options
context:
space:
mode:
Diffstat (limited to 'games/frotz')
-rw-r--r--games/frotz/README17
-rw-r--r--games/frotz/doinst.sh19
-rw-r--r--games/frotz/frotz-infocom.pngbin0 -> 553 bytes
-rw-r--r--games/frotz/frotz.SlackBuild160
-rw-r--r--games/frotz/frotz.desktop16
-rw-r--r--games/frotz/frotz.info10
-rw-r--r--games/frotz/frotz.pngbin0 -> 387 bytes
-rw-r--r--games/frotz/frotz.xml18
-rw-r--r--games/frotz/sfrotz.desktop16
-rw-r--r--games/frotz/slack-desc8
-rw-r--r--games/frotz/xfrotz.desktop16
11 files changed, 240 insertions, 40 deletions
diff --git a/games/frotz/README b/games/frotz/README
index 303e7f63bc..c4b16bc17f 100644
--- a/games/frotz/README
+++ b/games/frotz/README
@@ -2,4 +2,19 @@ frotz (Z-machine interpreter)
Frotz is an interpreter for Infocom games and other Z-machine games. It
complies with standard 1.0 of Graham Nelson's specification. Games can
-be found at http://www.ifarchive.org/ .
+be found at: http://www.ifarchive.org/
+
+3 executables are always built:
+
+* frotz - uses curses, no images, needs libmodplug for sound.
+* sfrotz - SDL2 UI, supports images and sound, works great in X11,
+ probably also Wayland (not tested by SlackBuild author).
+* dfrotz - dumb terminal frotz, doesn't support images nor sound.
+
+Optionally, you can set XFROTZ=yes to build:
+
+* xfrotz - native X11 UI, supports images, no sound. Most users won't
+ want this; sfrotz is a better choice on modern X11.
+
+Optional dependency: libmodplug. If this is installed, the curses
+build (frotz) will support sound.
diff --git a/games/frotz/doinst.sh b/games/frotz/doinst.sh
new file mode 100644
index 0000000000..3d57ee9017
--- /dev/null
+++ b/games/frotz/doinst.sh
@@ -0,0 +1,19 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
+
+if [ -e usr/share/fonts/misc/Zork_r400-10.pcf ]; then
+ if [ -x /usr/bin/mkfontdir ]; then
+ /usr/bin/mkfontdir usr/share/fonts/misc >/dev/null 2>&1
+ fi
+fi
diff --git a/games/frotz/frotz-infocom.png b/games/frotz/frotz-infocom.png
new file mode 100644
index 0000000000..9085ab83aa
--- /dev/null
+++ b/games/frotz/frotz-infocom.png
Binary files differ
diff --git a/games/frotz/frotz.SlackBuild b/games/frotz/frotz.SlackBuild
index 22e3911fac..aad8cf468e 100644
--- a/games/frotz/frotz.SlackBuild
+++ b/games/frotz/frotz.SlackBuild
@@ -1,19 +1,50 @@
-#!/bin/sh
+#!/bin/bash
#
# Slackware build script for frotz
-# Written by Beej Jorgensen <beej@beej.us>
+# Originally written for Slackware 12.2 by Beej Jorgensen <email
+# removed>, heavily modified by B. Watson <urchlay@slackware.uk> since
+# then.
-# Modified by B. Watson <yalhcru@gmail.com>
-# - updated for Slackware 14 and frotz 2.43d
-# - include dumb terminal frotz in build
+# Original had no license. This modified version is released under the
+# WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
-# 20150904 bkw: updated for frotz 2.44
+# 20230330 bkw: upstream download file changed. In case you're
+# wondering, it's a one-line change in the Makefile (an extra
+# digit in the git has), which doesn't actually affect the
+# compiled binaries. updated md5sum in .info, did not bump BUILD.
+
+# 20220613 bkw: updated for v2.54.
+
+# 20211007 bkw:
+# - updated for v2.53.
+# - add optional xfrotz.
+# - expand README.
+# - make slack-desc reflect build options (libmodplug and xfrotz).
+
+# 20210215 bkw: fix building without libmodplug. BUILD=2.
+
+# 20201212 bkw: too many changes, can't build older versions.
+# - updated for v2.52.
+# - new homepage.
+# - include sfrotz if sdl2 and SDL2_mixer are installed.
+# - fix man page typos.
+# - patch to prevent sfrotz crashes with long pathnames.
+# - add desktop stuff.
+
+# 20150904 bkw: updated for frotz 2.44.
+
+# 20121216 bkw:
+# - updated for Slackware 14 and frotz 2.43d.
+# - include dumb terminal frotz in build.
+
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=frotz
-VERSION=${VERSION:-2.44}
+VERSION=${VERSION:-2.54}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -23,7 +54,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}
@@ -45,37 +80,102 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
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 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# Fix typos:
+sed -i "s/\\(Unlike it\\)'s/\1s/" doc/dfrotz.6
+sed -i 's,forground,foreground,' doc/frotz.6
+sed -i -e 's,invocatio$,&n.,' \
+ -e 's,intead,instead,' \
+ -e 's,chunck,chunk,' \
+ doc/sfrotz.6
+
+# Document location of config file:
+sed -i 's,frotz\.conf,/etc/&,' doc/$PRGNAM.6
+
+run_make() {
+ make \
+ PREFIX=/usr \
+ SYSCONFDIR=/etc \
+ MANDIR=/usr/man \
+ MAN_PREFIX=/usr \
+ BINDIR=/usr/games \
+ MKFONTDIR=/bin/true \
+ X11_FONTDIR=$PKG/usr/share/fonts/misc \
+ DESTDIR=$PKG \
+ $1
+}
+
+# No autodetection for libmodplug or SDL2_mixer, help it out.
+maintarg="nosound"; MP=no
+if pkg-config --exists libmodplug; then
+ maintarg="$PRGNAM"
+ MP=yes
+fi
+# on post-14.2 -current and 15.0, sdl2 is part of a full install:
+pkg-config --exists sdl2 SDL2_mixer && extra="clean sdl install_sdl"
+
+sed -i "s,-O3.*,$SLKCFLAGS," Makefile
+for target in $maintarg install clean dumb install_dumb $extra; do
+ run_make $target
+done
+
+# I have no idea why anyone would want this, but in case they do:
+XF=no
+if [ "${XFROTZ:-no}" = "yes" ]; then
+ XF=yes
+ run_make clean
+ run_make x11
+ run_make install_x11
+ mv $PKG/usr/bin/xfrotz $PKG/usr/games
+ rmdir $PKG/usr/bin
+fi
+
+strip $PKG/usr/games/*
+gzip -9 $PKG/usr/man/man?/*.*
+
+# desktop files by SlackBuild author. The icons came from WinFrotz. They're
+# only available in 32x32 size, sorry.
+mkdir -p $PKG/usr/share/applications \
+ $PKG/usr/share/pixmaps \
+ $PKG/usr/share/icons/hicolor/32x32/apps
-make OPTS="$SLKCFLAGS" PREFIX=/usr CONFIG_DIR=/etc
-strip $PRGNAM
-make PREFIX=$PKG/usr CONFIG_DIR=/etc install
+for i in $PKG/usr/games/*; do
+ bin="$( basename $i )"
+ if [ -e $CWD/$bin.desktop ]; then
+ install -m0644 -oroot -groot $CWD/$bin.desktop $PKG/usr/share/applications
+ fi
+done
-# include dumb terminal version (it's small and maybe useful).
-sed -i 's/getline/dumb_getline/g' src/dumb/dumb_input.c
-make OPTS="$SLKCFLAGS" PREFIX=/usr CONFIG_DIR=/etc dfrotz
-install -s -m0755 dfrotz $PKG/usr/bin
-cat doc/dfrotz.6 > $PKG/usr/man/man6/dfrotz.6
+cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+ln -s ../../../../pixmaps/$PRGNAM.png \
+ $PKG/usr/share/icons/hicolor/32x32/apps/$PRGNAM.png
+mkdir -p $PKG/usr/share/icons/hicolor/32x32/mimetypes
+cat $CWD/frotz-infocom.png > \
+ $PKG/usr/share/icons/hicolor/32x32/mimetypes/frotz-infocom.png
-gzip $PKG/usr/man/man?/*.?
+# MIME stuff for desktops. Causes KDE and XFCE to display story
+# files with an Infocom icon, and they double-click open with either
+# terminal or SDL frotz.
+mkdir -p $PKG/usr/share/mime/packages
+cat $CWD/$PRGNAM.xml > $PKG/usr/share/mime/packages/$PRGNAM.xml
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- AUTHORS BUGS COPYING ChangeLog DUMB HOW_TO_PLAY INSTALL \
- PACKAGING PORTING README README.1st SPEECH TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a doc/frotz.conf-{big,small} $PKG/usr/doc/$PRGNAM-$VERSION
+rm -f README.1st # don't need this in the package.
+cp -a AUTHORS CO* ChangeLog DUMB HOW_TO_PLAY README* TODO *.lsm \
+ doc/$PRGNAM.conf* doc/$PRGNAM.txt \
+ $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
+sed -e "s,@MP@,$MP," \
+ -e "s,@XF@,$XF," \
+ $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
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
diff --git a/games/frotz/frotz.desktop b/games/frotz/frotz.desktop
new file mode 100644
index 0000000000..ab2f8e3d4e
--- /dev/null
+++ b/games/frotz/frotz.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=Frotz
+GenericName=Z-Code Interpreter
+Comment=Terminal Player for Interactive Fiction Games
+Exec=frotz %f
+Icon=frotz
+Terminal=true
+Type=Application
+Categories=Game;AdventureGame;
+MimeType=application/x-zmachine;
+NoDisplay=true
+Actions=Play;
+
+[Desktop Action Play]
+Name=Play
+Exec=frotz %f
diff --git a/games/frotz/frotz.info b/games/frotz/frotz.info
index a14a402164..cd0755974e 100644
--- a/games/frotz/frotz.info
+++ b/games/frotz/frotz.info
@@ -1,10 +1,10 @@
PRGNAM="frotz"
-VERSION="2.44"
-HOMEPAGE="http://frotz.sourceforge.net/"
-DOWNLOAD="http://downloads.sourceforge.net/project/frotz/frotz/frotz-2.44.tar.gz"
-MD5SUM="705457af0e2cf745ce7f6bc243f05968"
+VERSION="2.54"
+HOMEPAGE="https://davidgriffith.gitlab.io/frotz/"
+DOWNLOAD="https://gitlab.com/DavidGriffith/frotz/-/archive/2.54/frotz-2.54.tar.bz2"
+MD5SUM="0f92942220f7b27a218e94676045cbc1"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"
diff --git a/games/frotz/frotz.png b/games/frotz/frotz.png
new file mode 100644
index 0000000000..45babf88c0
--- /dev/null
+++ b/games/frotz/frotz.png
Binary files differ
diff --git a/games/frotz/frotz.xml b/games/frotz/frotz.xml
new file mode 100644
index 0000000000..ec743855db
--- /dev/null
+++ b/games/frotz/frotz.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-zmachine">
+ <comment>Z-Machine Story File</comment>
+ <glob pattern="*.z1"/>
+ <glob pattern="*.z2"/>
+ <glob pattern="*.z3"/>
+ <glob pattern="*.z4"/>
+ <glob pattern="*.z5"/>
+ <glob pattern="*.z6"/>
+ <glob pattern="*.z7"/>
+ <glob pattern="*.z8"/>
+ <glob pattern="*.blorb"/>
+ <glob pattern="*.zblorb"/>
+ <glob pattern="*.blb"/>
+ <generic-icon name="frotz-infocom" />
+ </mime-type>
+</mime-info>
diff --git a/games/frotz/sfrotz.desktop b/games/frotz/sfrotz.desktop
new file mode 100644
index 0000000000..f82697571f
--- /dev/null
+++ b/games/frotz/sfrotz.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=SFrotz
+GenericName=Z-Code Interpreter
+Comment=SDL Player for Interactive Fiction Games
+Exec=sfrotz %f
+Icon=frotz
+Terminal=false
+Type=Application
+Categories=Game;AdventureGame;
+MimeType=application/x-zmachine;
+NoDisplay=true
+Actions=Play;
+
+[Desktop Action Play]
+Name=Play
+Exec=sfrotz %f
diff --git a/games/frotz/slack-desc b/games/frotz/slack-desc
index 8a98788cb5..5c8781679c 100644
--- a/games/frotz/slack-desc
+++ b/games/frotz/slack-desc
@@ -10,10 +10,10 @@ frotz: frotz (Z-machine interpreter)
frotz:
frotz: Frotz is an interpreter for Infocom games and other Z-machine games.
frotz: It complies with standard 1.0 of Graham Nelson's specification.
-frotz: Games can be found at http://www.ifarchive.org/ .
-frotz:
-frotz: http://frotz.sourceforge.net/
-frotz:
+frotz: Games can be found at: http://www.ifarchive.org/
frotz:
+frotz: Build options:
+frotz: * curses frotz sound support: @MP@
+frotz: * xfrotz: @XF@
frotz:
frotz:
diff --git a/games/frotz/xfrotz.desktop b/games/frotz/xfrotz.desktop
new file mode 100644
index 0000000000..9058d9b0ad
--- /dev/null
+++ b/games/frotz/xfrotz.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=XFrotz
+GenericName=Z-Code Interpreter
+Comment=X11 Player for Interactive Fiction Games
+Exec=xfrotz %f
+Icon=frotz
+Terminal=false
+Type=Application
+Categories=Game;AdventureGame;
+MimeType=application/x-zmachine;
+NoDisplay=true
+Actions=Play;
+
+[Desktop Action Play]
+Name=Play
+Exec=xfrotz %f