summaryrefslogtreecommitdiffstats
path: root/network/icbm/icbm.SlackBuild
blob: a5635b0034522136a816aab36cc10f0cd291d5c3 (plain)
#!/bin/bash

# Slackware build script for icbm

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# Note to self: tarballs with versioned filenames do exist, but the
# link on the homepage is always icbm-current.tar.gz (presumably a
# symlink). To check for updated versions, look at the the top of:
# https://co.ordinate.org/icbm/Changelog

# The crypto modules are actually optional: icbm will run without
# them, with encryption disabled. I've made them required here, to
# keep things simpler for me (and easier for users, too). If you
# really object to this, just don't install them (you still need
# perl-Curses, though).

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=icbm
VERSION=${VERSION:-1.6.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch

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}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
# tarball perms suck, leave this as-is:
chmod 644 *

SHAREDIR=$PKG/usr/share/icb
BINDIR=$PKG/usr/bin
MANDIR=$PKG/usr/man/man1

# There's no Makefile or install script, follow the directions
# in INSTALL.
# Note that icbserverdb is different from the one that ships
# with cicb (some of the same servers listed, but the cicb one
# has an extra 'server admin' field).
mkdir -p $SHAREDIR/Net $BINDIR $MANDIR
cp -a primes $SHAREDIR
cp -a icbserverdb $SHAREDIR/icbserverdb.new
cp -a ICB.pm $SHAREDIR/Net
install -m0755 icbm $BINDIR
gzip -9c < icbm.1 > $MANDIR/icbm.1.gz

# BUGS is 0 bytes in 1.6.0. README.ICBM is actually troff, it's the
# man page for an older version.
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a Changelog README.ENCRYPTION TODO gpl.txt sample_* colors $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