summaryrefslogtreecommitdiff
path: root/community/bsd-games/PKGBUILD
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/bsd-games/PKGBUILD
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/bsd-games/PKGBUILD')
-rw-r--r--community/bsd-games/PKGBUILD95
1 files changed, 95 insertions, 0 deletions
diff --git a/community/bsd-games/PKGBUILD b/community/bsd-games/PKGBUILD
new file mode 100644
index 000000000..88b330f80
--- /dev/null
+++ b/community/bsd-games/PKGBUILD
@@ -0,0 +1,95 @@
+# $Id: PKGBUILD 23658 2010-08-14 10:48:12Z cbrannon $
+# Maintainer: Chris Brannon <cmbrannon79@gmail.com>
+# Contributor: Abhishek Dasgupta <abhidg@gmail.com>
+# Contributor: SmackleFunky <smacklefunky@optusnet.com.au>
+
+pkgname=bsd-games
+pkgver=2.17
+pkgrel=10
+pkgdesc="A linux port for a collection of BSD command line games."
+url="ftp://ftp.ibiblio.org/pub/Linux/games/"
+arch=('i686' 'x86_64')
+install=$pkgname.install
+license=('BSD')
+depends=(gcc-libs words sh)
+makedepends=('flex' 'bison' 'm4')
+source=(ftp://ftp.ibiblio.org/pub/Linux/games/$pkgname-$pkgver.tar.gz \
+ config.params stdio.h.diff gamescreen.h.diff getline.diff
+ number.c.diff bsd-games-2.17-64bit.patch)
+
+build() {
+ cd "${srcdir}/$pkgname-$pkgver"
+ [ "$CARCH" = "x86_64" ] && patch -p1 < "$srcdir/bsd-games-2.17-64bit.patch"
+ cp "${srcdir}/config.params" .
+
+# Patches
+ sed -i "s%PKGDIR%$pkgdir%" config.params
+
+ # Several games use their own internal functions named getline. All
+ # are different, and none is the getline from glibc. So we need a patch
+ # in order to compile. Each internal getline function is prefixed
+ # with the name of the game. -- Chris Brannon
+ patch -p1 -i "${srcdir}/getline.diff"
+
+ patch -p1 -i "${srcdir}/stdio.h.diff"
+ patch -p1 -i "${srcdir}/gamescreen.h.diff"
+
+# Incorporated some fixes from Debian
+ patch -p1 -i "${srcdir}/number.c.diff"
+
+ sed -i "s/FISH/GO-FISH/g; s/\.Nm fish/\.Nm go-fish/g" fish/fish.6
+ sed -i "s/tenths/tenth/g" tests/number.-0.1
+ sed -i "s/Elegy{ Written in a Country Church{-| }Yard:/Elegy{ Written in a Country Church{-| }Yard}:/g" \
+ quiz/datfiles/poetry
+ sed -i "s/\.tI friend/\.It friend/g" hunt/hunt/hunt.6.in
+ sed -i "s/it\'s initial/its initial/g" backgammon/teachgammon/ttext1.c
+ sed -i "s/two player\'s/two players/g" backgammon/teachgammon/ttext2.c
+ sed -i "s/\.I range/\.It range/g" arithmetic/arithmetic.6
+ sed -i "s/game were the/game where the/g" gomoku/gomoku.6
+
+ # The wargames script expects binaries in /usr/games, and this
+ # path is hard-coded.
+ # Prior to release 2.17-10 of the ArchLinux package, wargames was
+ # broken, since binaries are in /usr/bin instead.
+ sed -i -e 's|/usr/games|/usr/bin|g' wargames/wargames
+
+# Build.
+ ./configure
+ make
+}
+
+package() {
+ cd "${srcdir}/$pkgname-$pkgver"
+ make install
+ # This make install command does install to $pkgdir, because of the
+ # change to config.params in the build function.
+
+# Fix permissions
+ rmdir "${pkgdir}/tmp"
+ install -dm755 "${pkgdir}/usr/share/bsdgames/data/hack/save"
+ chown -R root:games "${pkgdir}/var/lib/bsdgames"
+ chmod 664 "${pkgdir}"/var/lib/bsdgames/*
+ chmod 664 "${pkgdir}"/var/lib/bsdgames/{hack,phantasia}/*
+ chmod 775 "${pkgdir}"/var/lib/bsdgames/{hack,phantasia}
+
+# Remove conflict with xscreensaver and fish
+ mv "${pkgdir}/usr/bin/fish" "${pkgdir}/usr/bin/go-fish"
+ mv "${pkgdir}/usr/share/man/man6/fish.6.gz" "${pkgdir}/usr/share/man/man6/go-fish.6.gz"
+ mv "${pkgdir}/usr/share/man/man6/worm.6.gz" \
+ "${pkgdir}/usr/share/man/man6/worm-game.6.gz"
+
+# Install documentation and license
+ install -dm755 "$pkgdir/usr/share/doc/bsd-games"
+ install -m644 AUTHORS NEWS BUGS ChangeLog "$pkgdir/usr/share/doc/$pkgname" \
+
+ rm "${pkgdir}/usr/share/doc/trek.me"
+ install -D -m644 COPYING "${pkgdir}/usr/share/licenses/$pkgname/COPYING"
+}
+
+md5sums=('238a38a3a017ca9b216fc42bde405639'
+ 'a7c5ac05eb71f7eb1eedf02b9328f4d8'
+ '784f68c796b9e099ac008aecef1af998'
+ '9c0fa6e2345bd0a7945c9a41d5ba68aa'
+ '5356bd6999ae53dd27cb2a0f837a3e70'
+ '47249a90f38ccb4dd07625b245bbc728'
+ '257813b76a41c8b2c02701571c804227')