updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / parpg-hg / PKGBUILD
blobdc5ec351ae20299d0a0fdeca87e22a2216906149
1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
2 pkgname=parpg-hg
3 pkgver=26
4 _pkgver=0.2.0
5 pkgrel=1
6 pkgdesc="Post-Apocalyptic Roleplaying Game"
7 arch=('any')
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'
15         'parpg.png')
16 md5sums=('65552e2b373bdf44d00564b5555b0fd0'
17          '169fdfc1351e4338937fb5b70327a68b')
19 _hgroot=http://hg.assembla.com
20 _hgrepo="parpg-core"
22 build() {
23   # Build core
24   cd "$srcdir"
25   msg "Connecting to Mercurial server...."
27   if [[ -d "$_hgrepo" ]]; then
28     cd "$_hgrepo"
29     hg pull -u
30     msg "The local files are updated."
31   else
32     hg clone "$_hgroot" "$_hgrepo"
33   fi
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