1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
6 pkgdesc="Post-Apocalyptic Roleplaying Game"
8 url="http://www.parpg.net/"
9 license=('GPL3' 'CCPL')
10 depends=('python2>=2.6' 'fife-svn' 'python2-yaml')
11 makedepends=('mercurial')
12 conflicts=('parpg-svn')
13 replaces=('parpg-svn')
14 source=('parpg.desktop'
16 md5sums=('65552e2b373bdf44d00564b5555b0fd0'
17 '169fdfc1351e4338937fb5b70327a68b')
19 _hgroot=http://hg.assembla.com
25 msg "Connecting to Mercurial server...."
27 if [[ -d "$_hgrepo" ]]; then
30 msg "The local files are updated."
32 hg clone "$_hgroot" "$_hgrepo"
35 msg "Mercurial checkout done or server timeout"
36 msg "Starting build..."
38 rm -rf "$srcdir/$_hgrepo-build"
39 cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
40 cd "$srcdir/$_hgrepo-build"
42 sed -i "s/\#\!\/usr\/bin\/env python/\#\!\/usr\/bin\/env python2/" waf.py
43 sed -i "s/\#\! \/usr\/bin\/env python/\#\!\/usr\/bin\/env python2/" waf_paths.py
44 sed -i "s/\#\!\/usr\/bin\/env python/\#\!\/usr\/bin\/env python2/" wscript
46 sed -i "s/\#\!\/usr\/bin\/env python/\#\!\/usr\/bin\/env python2/" $(find "$srcdir/$_hgrepo-build" | grep "\.py")
47 sed -i "s/\#\! \/usr\/bin\/env python/\#\!\/usr\/bin\/env python2/" $(find "$srcdir/$_hgrepo-build" | grep "\.py")
49 PYTHON="python2" python2 waf.py configure --prefix=/usr --sysconfdir=/usr/share/parpg --fifepath=/usr/lib/python2.7/site-packages
50 PYTHON="python2" python2 waf.py build
51 PYTHON="python2" python2 waf.py install --destdir="${pkgdir}"
53 echo \#\!/bin/bash > ${pkgdir}/usr/bin/parpg
54 echo export PYTHONPATH=\$\{PYTHONPATH\}:\"/usr/lib/python2.7/site-packages\" >> ${pkgdir}/usr/bin/parpg
55 echo cd \$\(dirname \$0\) >> ${pkgdir}/usr/bin/parpg
56 echo PYTHON=\"python2\" \"python2\" -m parpg.main \"/usr/share/parpg\" \$\@ >> ${pkgdir}/usr/bin/parpg
58 sed "s/DataPath.*$/DataPath = \"\/usr\/share\/parpg\"/g" -i ${pkgdir}/usr/share/parpg/parpg.cfg
60 install -D -m644 $srcdir/parpg.png $pkgdir/usr/share/pixmaps/parpg.png
61 install -D -m644 $srcdir/parpg.desktop $pkgdir/usr/share/applications/parpg.desktop