Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: LoneVVolf on Nov 25th, 2013  |  syntax: None  |  size: 3.43 KB  |  views: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Contributor: Anton Bazhenov <anton.bazhenov at gmail>
  2. # Contributor: Lone_Wolf <lonewolf@xs4all.nl>
  3. # Contributor: denton <e9203.00 gmail>
  4. # Maintainer: Alex Ferguson <thoughtmonster at gmail>
  5. pkgname=vulture
  6. pkgver=2.3.67
  7. pkgrel=2.1
  8. pkgdesc='An isometric graphical interface for NetHack, SlashEM and UnNethack'
  9. arch=('i686' 'x86_64')
  10. url='http://www.darkarts.co.za/vulture'
  11. license=('custom:NetHack General Public Licence')
  12. depends=('hicolor-icon-theme' 'libpng' 'sdl_mixer' 'sdl_ttf')
  13. makedepends=('bison' 'flex' 'p7zip')
  14. conflicts=('vulture-nethack')
  15. install=$pkgname.install
  16. source=(http://www.darkarts.co.za/vulture/download/vulture-$pkgver.7z
  17.                 vulture.png
  18.                 png-fix.patch)
  19. md5sums=('be1d0f07095d3385728821e8269a5723'
  20.          '214218b48019b81d59120e4e84ce10ab'
  21.          'e9fdadfecf48d68d0ee12fd55ad67c1b')
  22.  
  23. build() {
  24.         cd "$srcdir/$pkgname-$pkgver"
  25.  
  26.         variants=(nethack unnethack)
  27.         for variant in "${variants[@]}"
  28.         do
  29.                 sed -e 's|^/\* \(#define LINUX\) \*/|\1|' \
  30.                         -e 's|^/\* \(#define TIMED_DELAY\) \*/|\1|' \
  31.                         -e 's|^/\* \(#define VAR_PLAYGROUND.*\) \*/|\1|' \
  32.                         -e "/^#define VAR_PLAYGROUND/ s|/var/lib/games/nethack|/var/games/$pkgname/$variant|" -i $variant/include/unixconf.h
  33.  
  34.                 sed -e '/^GAMEDIR/     s|$(PREFIX)/games/lib/$(GAME)dir|$(PREFIX)/share/$(GAME)|' \
  35.                         -e '/^VARDIR/      s|$(GAMEDIR)|$(PREFIX)/var/games/$(GAME)|' \
  36.                         -e '/^SHELLDIR/    s|$(PREFIX)/games|$(PREFIX)/bin|' \
  37.                         -e '/^GAMEUID/     s|games|root|' \
  38.                         -e '/^GAMEGRP/     s|bin|root|' \
  39.                         -e '/^GAMEPERM/    s|04755|0755|' -i $variant/sys/unix/Makefile.top
  40.  
  41.                 sed -e "/^#  define HACKDIR/          s|/usr/games/lib/${variant}dir|/usr/share/$pkgname/$variant|" \
  42.                         -e '/^#define COMPRESS/           s|/usr/bin/compress|/bin/gzip|' \
  43.                         -e '/^#define COMPRESS_EXTENSION/ s|.Z|.gz|' -i $variant/include/config.h
  44.  
  45.                 sed -e "/^#    define HACKDIR/         s|\.|/usr/share/$pkgname/$variant|" \
  46.                         -e '/^# define COMPRESS/           s|/usr/bin/compress|/bin/gzip|' \
  47.                         -e '/^# define COMPRESS_EXTENSION/ s|.Z|.gz|' -i $variant/include/config.h
  48.  
  49.                 sed -e "/^HACK/    s|\$HACKDIR/nethack|/usr/bin/$pkgname-$variant|" \
  50.                         -e "/^HACKDIR/ s|/usr/games/lib/nethackdir|/usr/share/$pkgname/$variant|" -i $variant/sys/unix/nethack.sh
  51.         done
  52.  
  53.         patch -Np0 -i "$srcdir/png-fix.patch"
  54.         CPPFLAGS="$CPPFLAGS -O2"
  55.         make nethack-home INSTPREFIX=$srcdir/$pkgname-$pkgver/build
  56.         make unnethack-home INSTPREFIX=$srcdir/$pkgname-$pkgver/build
  57. }
  58.  
  59. package() {
  60.         cd "$pkgdir"
  61.  
  62.         cp -a $srcdir/$pkgname-$pkgver/build/* .
  63.  
  64.         chgrp -R games var/games
  65.         chmod -R 775   var/games
  66.  
  67.         mkdir -p usr/bin
  68.         mkdir -p usr/share/$pkgname
  69.         mkdir -p var/games/$pkgname
  70.  
  71.         variants=(nethack unnethack)
  72.         for variant in "${variants[@]}"
  73.         do
  74.                 mv var/games/$pkgname-$variant var/games/$pkgname/$variant
  75.                 chmod 664 var/games/$pkgname/$variant/{logfile,perm,record}
  76.  
  77.                 mv $pkgname-$variant usr/bin/$pkgname-$variant-start
  78.                 mv $pkgname-$variant-data/$pkgname-$variant usr/bin/$pkgname-$variant
  79.                 mv $pkgname-$variant-data/recover usr/bin/$pkgname-$variant-recover
  80.                 rm -f $pkgname-$variant-data/{*.{ico,png,nh},license}
  81.  
  82.                 mv $pkgname-$variant-data usr/share/$pkgname/$variant
  83.                 install -Dm644 $startdir/$pkgname.png usr/share/icons/hicolor/48x48/apps/$pkgname-$variant.png
  84.         done
  85.  
  86.         mkdir -p usr/share/applications
  87.         install -Dm644 $srcdir/vulture-$pkgver/dist/linux/*.desktop usr/share/applications
  88.         install -Dm644 $srcdir/$pkgname-$pkgver/LICENSE usr/share/licenses/$pkgname/LICENSE
  89. }