updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / sporkhack-svn / PKGBUILD
blob7cbcf5c073b04686a59643ea9294bb5fe4977504
1 # Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com>
2 # Contributor: Moritz Wilhelmy <echo dGhlLnd1bGYuZ2FuZ0Bnb29nbGVtYWlsLmNvbQ== | base64 -d>
3 # Contributor: kevin <kevin@archlinux.org>
4 # Contributor: Christian Schmidt <mucknert@gmx.net>
5 # Contributor: Markus Meissner <markus@meissna.de>
7 pkgname=sporkhack-svn
8 pkgver=817
9 pkgrel=1
10 pkgdesc='A single player dungeon exploration game, variant'
11 arch=(i686 x86_64)
12 url="http://sporkhack.com/"
13 license=(custom)
14 depends=(ncurses gzip)
15 makedepends=(subversion)
16 #options=(!strip)
18 _svntrunk='svn://sporkhack.com/nh'
19 _svnmod='nh'
21 build(){
22   cd "$srcdir"
24   if [ -d $_svnmod/.svn ]; then
25     (cd $_svnmod && svn up -r $pkgver) || warning "SVN update failed!"
26   else
27     svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
28   fi
30   msg2 "SVN checkout done or server timeout"
32   rm -rf $_svnmod-build
33   svn export $_svnmod $_svnmod-build
34   cd $_svnmod-build
36   msg2 "Building..."
38   # Configure
39   sed -e '/define HACKDIR/ s|/usr/games/lib/nethackdir|/usr/share/sporkhack/|' \
40       -e '/define COMPRESS/ s|/usr/bin/gzip|/bin/gzip|' \
41       -e 's|#define SECURE|/* & */|' \
42       -e 's|#define DUMP_LOG|/* & */|' \
43       -i include/config.h
45   # Fix dirs and perms
46   sed -e '/^GAMEDIR\s*=/ s|/games/.*$|/share/sporkhack|' \
47       -e '/^GAMEUID\s*=/ s|games|root|' \
48       -e '/^GAMEGRP\s*=/ s|bin|root|' \
49       -e '/^SHELLDIR\s*=/ s|/games|/bin|' \
50       -i Makefile
52   # Horribly mutilate manpage
53   sed -e '1s/NETHACK/SPORKHACK/' \
54       -e '4s/nethack/sporkhack/' \
55       -e '62,113s/NetHack/SporkHack/' \
56       -e 's/\.B nethack/.B sporkhack/' \
57       -e '111s/nethackrc/sporkrc/' \
58       -e '232s/nethack/sporkhack/' \
59       -e '234s/nethack/sporkhack/' \
60       -e '290s/NetHack/SporkHack/' \
61       -i doc/nethack.6
63   # Debug
64   [[ $(check_option strip) == n ]] &&  CFLAGS="-O0 -g3"
66   # Allow optimization
67   CFLAGS+=" -I../include"
68   make CFLAGS="$CFLAGS"
71 package() {
72   cd "$srcdir/$_svnmod-build"
74   make PREFIX="$pkgdir/usr" install
76   # Move binaries to lib
77   install -d "$pkgdir/usr/lib/sporkhack"
78   mv "$pkgdir"/usr/share/sporkhack/{nethack,recover} "$pkgdir/usr/lib/sporkhack/"
80   # Rename launcher so sporkhack doesn't conflict with nethack
81   mv "$pkgdir/usr/bin/nethack" "$pkgdir/usr/bin/sporkhack"
83   sed -e "s|HACKDIR=$pkgdir/usr/|HACKDIR=/usr/|" \
84       -e 's|HACK=$HACKDIR|HACK=/usr/lib/sporkhack|' \
85       -i "$pkgdir/usr/bin/sporkhack"
87   # Documentation
88   install -Dm644 doc/nethack.6 "$pkgdir/usr/share/man/man6/sporkhack.6"
89   install -Dm644 doc/Guidebook.txt "$pkgdir/usr/share/doc/sporkhack/Guidebook.txt"
91   # License
92   install -Dm644 dat/license "$pkgdir/usr/share/licenses/$pkgname/license"