updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / purity / PKGBUILD
blobf1eb80ed84ffc7c0e63ca9d534cc6e4705c6707b
1 # Contributor: MCMic <come.bernigaud@laposte.net>
3 pkgname=purity
4 pkgver=20071027
5 pkgrel=6
6 pkgdesc="An abstract first-person shooter built on the Quake3 engine."
7 arch=('i686' 'x86_64')
8 url="http://vectorpoem.com/purity/"
9 license=('GPL')
10 depends=()
11 makedepends=('make' 'svn')
12 optdepends=('zenity: allow using purity-zen to choose graphically the map')
13 conflicts=('')
14 source=('http://vectorpoem.com/purity/latest_content/core.pk3'
15                 'http://vectorpoem.com/purity/latest_content/map0.pk3'
16                 'http://vectorpoem.com/purity/latest_content/vm.pk3'
17                 'purity-zen')
18 noextract=( 'core.pk3'
19                         'map0.pk3'
20                         'vm.pk3')
21 md5sums=('4f5b6af36a738a54570f21fb24177edd'
22          'b7f5730e443ea5c066d7ef67bce09892'
23          '8396c0dfe49c31ff866800837bf80d9d'
24          '8361d4586bf2c0dd1a31edddf8b70d89')
26 _svn='https://purityq3.svn.sourceforge.net/svnroot/purityq3'
28 build() {
29         cd $srcdir
30         msg "Getting svn revision…"
31     if [ -d $pkgname/.svn ]; then
32       (cd $pkgname && svn up)
33     else
34       svn co $_svn $pkgname
35     fi
36         
37         msg "Building…"
38         cd $pkgname
39         make
40         
41         msg "Cleaning and adapting scripts"
42         build_folder=`ls ${srcdir}/$pkgname/build`
43         bin_name=`ls ${srcdir}/$pkgname/build/$build_folder | grep "purity\."`
44         bin_serv=`ls ${srcdir}/$pkgname/build/$build_folder | grep "purity-ded"`
45         bin_path=/opt/$pkgname/build/$build_folder/$bin_name
46         serv_path=/opt/$pkgname/build/$build_folder/$bin_serv
47         _bin=`echo $bin_path | sed "s|\/|\\\/|g"`
48         _serv=`echo $serv_path | sed "s|\/|\\\/|g"`
49         rm *.exe
50         for i in `ls *.bat | cut -d'.' -f1`
51                 do sed -i "s|@start purity.x86|$_bin|" $i.bat
52                 sed -i "s|@start purity-ded.x86|$_serv|" $i.bat
53                 mv $i.bat $i.sh
54                 chmod +x $i.sh
55         done
57         sed -i "s|purity_cmd|$_bin|" ${srcdir}/purity-zen
58         
59         msg "Packaging"
60         mkdir -p ${pkgdir}/usr/bin
61         cp ${srcdir}/$pkgname/purity.sh ${pkgdir}/usr/bin/
62         cp ${srcdir}/purity-zen ${pkgdir}/usr/bin/
63         mkdir -p ${pkgdir}/opt/$pkgname/build/$build_folder/base
64         cp -r ${srcdir}/$pkgname ${pkgdir}/opt/
65         cp ${srcdir}/*.pk3 ${pkgdir}/opt/$pkgname/build/$build_folder/base/