summaryrefslogtreecommitdiffstats
path: root/games/fortune_doctor_who/fortune_doctor_who.SlackBuild
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2013-12-12 18:49:42 +0700
committer Erik Hanson <erik@slackbuilds.org>2013-12-14 10:53:04 -0600
commit6f65c50dc6a53de196e2ec6cd2149f2c4f946e72 (patch)
treeed00ccf48b3abb2c4acec099655254f0f72e0b67 /games/fortune_doctor_who/fortune_doctor_who.SlackBuild
parentb7eab76d3172fa4d9ea09df69fd412cc67ab0cb5 (diff)
downloadslackbuilds-6f65c50dc6a53de196e2ec6cd2149f2c4f946e72.tar.gz
slackbuilds-6f65c50dc6a53de196e2ec6cd2149f2c4f946e72.tar.xz
games/fortune_doctor_who: Added (quotes from Doctor Who).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/fortune_doctor_who/fortune_doctor_who.SlackBuild')
-rw-r--r--games/fortune_doctor_who/fortune_doctor_who.SlackBuild55
1 files changed, 55 insertions, 0 deletions
diff --git a/games/fortune_doctor_who/fortune_doctor_who.SlackBuild b/games/fortune_doctor_who/fortune_doctor_who.SlackBuild
new file mode 100644
index 0000000000..0bbdddb676
--- /dev/null
+++ b/games/fortune_doctor_who/fortune_doctor_who.SlackBuild
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Slackware build script for fortune_doctor_who
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=fortune_doctor_who
+VERSION=${VERSION:-20130410}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+ARCH=noarch
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+
+mkdir -p $PKG/usr/share/games/fortunes
+
+# Upstream's files are zipped fortune files, except they have a trailing %
+# as the last line, and some (but not all) have DOS-style CRLF endings.
+# The "fmt -s" splits long lines (which is at least a start at de-uglifying
+# the formatting). Someone really needs to manually clean it up, maybe I will
+# someday.
+for i in 01-08 09 10 11; do
+ unzip $CWD/Doctor_Who$i-quotes.zip
+ sed 's/\r//' Doctor_Who$i.txt | fmt -s >> $PKG/usr/share/games/fortunes/doctor_who
+done
+
+# Get rid of trailing % from last file (to avoid an empty fortune).
+sed -i '$d' $PKG/usr/share/games/fortunes/doctor_who
+
+( cd $PKG/usr/share/games/fortunes && strfile doctor_who )
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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}