summaryrefslogtreecommitdiffstats
path: root/network/syncterm/syncterm.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/syncterm/syncterm.SlackBuild')
-rw-r--r--network/syncterm/syncterm.SlackBuild159
1 files changed, 159 insertions, 0 deletions
diff --git a/network/syncterm/syncterm.SlackBuild b/network/syncterm/syncterm.SlackBuild
new file mode 100644
index 0000000000..4f746b2568
--- /dev/null
+++ b/network/syncterm/syncterm.SlackBuild
@@ -0,0 +1,159 @@
+#!/bin/bash
+
+# Slackware build script for syncterm
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# Issues:
+# 1. Figure out why shell: doesn't work on the command line (though
+# it does, with the ^D "quick connect" option, or by adding it to
+# the dialing list).
+# 2. How do we use /etc/syncterm.lst? strace shows that syncterm reads it,
+# but entries there don't show up in the dialing list (not even if there's
+# no user list). If I could get the system list to work, I'd include an
+# entry there for a local shell (to work around issue #1). But probably
+# nobody much cares about using this as an xterm or konsole replacement...
+# Neither of these issues are going to prevent me from submitting this.
+
+# Note: phigan on #atari tells me they're "almost ready" to release 1.2,
+# so this may get updated soon.
+
+# 20240218 bkw: BUILD=2
+# - add compile fix for -current.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=syncterm
+VERSION=${VERSION:-1.1}
+BUILD=${BUILD:-2}
+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-src.tgz
+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 {} +
+
+# Man page: Fix path to dialing list and a couple typos. The path
+# baked into the binary really is /etc/syncterm.lst (not /usr/etc)...
+# although I don't see a way to make syncterm actually use the
+# system-wide dialing list.
+patch -p1 < $CWD/manpage.diff
+
+# 20240218 bkw: fix compilation on -current (or so I am assured). Doesn't
+# hurt anything on 15.0. Patch originally from:
+# https://raw.github.com/nullman/config/master/common/.nixos/pkgs/syncterm/0002-use-sched-yield-53264f2b.diff
+# ...brought to my attention by Joshua E. Roybal via email.
+patch -p1 < $CWD/0002-use-sched-yield-53264f2b.diff
+
+# This is a big hassle: -O3 is hardcoded in a makefile... which is
+# inside a zip file. To force our flags, we have to extract the zip
+# file, mod the makefile, then re-zip it. Using -0 with zip means
+# "store" (for speed).
+cd 3rdp/dist
+unzip -oa cryptlib.zip
+rm -f cryptlib.zip
+sed -i "s,-O3,$SLKCFLAGS," makefile
+zip -0r cryptlib.zip *
+cd -
+
+# Rest of the flags:
+sed -i "s,-O2,$SLKCFLAGS," src/build/Common.gmake
+sed -i "s,-O3,\"$SLKCFLAGS\"," 3rdp/build/GNUmakefile
+
+# Top-level source directory:
+cd src/$PRGNAM
+
+# Lots of make options here:
+# - RELEASE=1 means binary already stripped, man page already gzipped.
+# - WITHOUT_PORTAUDIO=1 to avoid a hidden dependency on portaudio. I
+# see no advantage to using portaudio anyway (SDL audio works fine).
+# - INSTALL_DATA: install man page with usual Slackware permissions.
+# - SRC_ROOT has to be set because the makefile is dumb...
+# - Use -j1 as the compile always fails if -jN where N>1.
+make -j1 \
+ PREFIX=/usr \
+ MANPREFIX=/usr \
+ SYSTEM_LIST_DIR=/etc \
+ SRC_ROOT="$( realpath .. )" \
+ USE_SDL=1 \
+ USE_SDL_AUDIO=1 \
+ WITHOUT_PORTAUDIO=1 \
+ VERBOSE=1 \
+ RELEASE=1 \
+ DESTDIR=$PKG \
+ INSTALL_DATA="install -m 0644" \
+ all install
+
+# Compile the terminfo entries. Have to run the binary we just built,
+# let's not do it as root.
+su nobody -s /bin/sh -c "$PKG/usr/bin/$PRGNAM -T" | \
+ tic -o $PKG/usr/share/terminfo -
+
+# The 64x64 icon was installed by 'make install', above.
+# Other icons extracted from the Mac .icns file:
+# sh extract-icns.sh /tmp/SBo/syncterm-1.1/src/syncterm/SyncTERM.icns
+# If you're copying this code for use in your own SlackBuild, please
+# don't change the "cat" to "cp -a", below: files copied from $CWD
+# might be owned by anybody (not necessarily root), and have wrong
+# permissions; using "cat >" takes care of both.
+# Also, please don't rewrite this to call icns2png in your script.
+# Otherwise you'd have to add libicns to REQUIRES.
+for png in $CWD/icons/*.png; do
+ px="$( basename $png | cut -d. -f1 )"
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ cat $png > $dir/$PRGNAM.png
+done
+
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a Install-Mozilla.txt CHANGES LICENCE gpl.txt $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $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