slackbuilds_ponce/games/fortune-slackware/fortune-slackware.SlackBuild

67 lines
1.7 KiB
Text
Raw Normal View History

#!/bin/bash
# Slackware build script for fortune-slackware
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=fortune-slackware
VERSION=${VERSION:-1.15}
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}
# Package is named like all the other fortune-* ones for consistency.
SRCNAM=slack-fortunes-all
# Where the fortune end up installing to.
FDIR=$PKG/usr/share/games/fortunes
set -e
rm -rf $PKG
mkdir -p $TMP $FDIR $OUTPUT
cd $TMP
# no top-level dir in the tarball!
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tgz
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 {} \+
# There's 15 fortune files in the source, combine them all into one.
# Patch fixes the mess caused by some files starting with a % line,
# some having blank line(s) after the last % line, some having two %
# lines in a row, and the last file should NOT have a % line at the end.
patch -p1 < $CWD/formatting.diff
cat slack-fortunes-vol-? slack-fortunes-vol-?? > $FDIR/slackware
strfile $FDIR/slackware
DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $DOCDIR
cat $CWD/README > $DOCDIR/README
cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$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