updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / openkore-svn / PKGBUILD
blob64b2b18dfc87c5af70dc5f746a81be33a6181609
1 # Maintainer: Max Roder <maxroder@web.de>
3 pkgname=openkore-svn
4 pkgver=7864
5 pkgrel=1
6 pkgdesc="A custom Ragnarok online client. Uses its own updater."
7 arch=('i686' 'x86_64')
8 url="http://openkore.com"
9 license=('GPL')
10 depends=('perl-time-hires' 'perl-io-compress')
11 makedepends=('subversion' 'python2')
12 optdepends=('perl-wx: To use the mapviewer')
13 provides=('openkore')
14 install='openkore-svn.install'
15 options=('emptydirs')
17 _svntrunk="https://openkore.svn.sourceforge.net/svnroot/openkore/openkore/trunk/"
18 _svnmod="openkore"
20 _svnfields="https://openkore.svn.sourceforge.net/svnroot/openkore/fieldpack/trunk/fields/"
21 _svntables="https://openkore.svn.sourceforge.net/svnroot/openkore/tablepack/trunk/tables/"
22 _svncontrol="https://openkore.svn.sourceforge.net/svnroot/openkore/confpack/trunk/control/"
24 build() {
25         cd ${srcdir}
27         msg "Getting main program..."
29         if [ -d ${_svnmod}/.svn ]; then
30                 (cd ${_svnmod} && svn up -r $pkgver)
31         else
32                 svn co ${_svntrunk} --config-dir ./ -r $pkgver ${_svnmod}
33         fi
35         mkdir -p ${srcdir}/fields ${srcdir}/tables ${srcdir}/control
37         msg "Getting fields..."
38         cd ${srcdir}/fields/
39         if [ -d .svn ]; then
40                 (svn up)
41         else
42                 svn co ${_svnfields} --config-dir ./ .
43         fi
45         msg "Getting tables..."
46         cd ${srcdir}/tables/
47         if [ -d .svn ]; then
48                 (svn up)
49         else
50                 svn co ${_svntables} --config-dir ./ .
51         fi
53         msg "Getting config files..."
54         cd ${srcdir}/control/
55         if [ -d .svn ]; then
56                 (svn up)
57         else
58                 svn co ${_svncontrol} --config-dir ./ .
59         fi
61         msg "SVN checkout done or server timeout"
63         cd ${srcdir}
65         msg "Starting build..."
67         svn export ${_svnmod} ${_svnmod}-build
68         cd ${_svnmod}-build
70         # Patch Makefile (python2 instead of python)
71         sed -i 's/python/python2/g' Makefile
73         # Build
74         make
77 package() {
78         cd ${srcdir}/${_svnmod}-build
80         # Put everything together
81         cp -a ${srcdir}/fields ${srcdir}/${_svnmod}-build/
82         cp -a ${srcdir}/tables ${srcdir}/${_svnmod}-build/
83         cp -a ${srcdir}/control ${srcdir}/${_svnmod}-build/
85         # Remove all .exe files
86         rm -rf $(find "." -name "*.exe")
88         install -d ${pkgdir}/opt/openkore/ ${pkgdir}/usr/bin/
90         # Include .svn directories as autoupdate.pl uses them to determine revision.
91         cp -a ${srcdir}/${_svnmod}/.svn ${pkgdir}/opt/openkore/
92         cp -a ${srcdir}/fields/.svn ${pkgdir}/opt/openkore/
93         cp -a ${srcdir}/tables/.svn ${pkgdir}/opt/openkore/
94         cp -a ${srcdir}/control/.svn ${pkgdir}/opt/openkore/
95         
96         cp -a * ${pkgdir}/opt/openkore/
98         # Set correct permissions
99         chmod -R g+rws ${pkgdir}/opt/openkore
100         
101         # Install wrapper script
102         echo "#!/bin/sh" >> ${pkgdir}/usr/bin/openkore
103         echo "umask u=rwx,g=rwx,o=rx" >> ${pkgdir}/usr/bin/openkore
104         echo "cd /opt/openkore/; perl openkore.pl" >> ${pkgdir}/usr/bin/openkore
105         chmod +x ${pkgdir}/usr/bin/openkore
106         
107         # Install autoupdate wrapper script
108         echo "#!/bin/sh" >> ${pkgdir}/usr/bin/openkore-update
109         echo "umask u=rwx,g=rwx,o=rx" >> ${pkgdir}/usr/bin/openkore-update
110         echo "cd /opt/openkore/; perl autoupdate.pl" >> ${pkgdir}/usr/bin/openkore-update
111         chmod +x ${pkgdir}/usr/bin/openkore-update
113         # Clean up
114         cd .. && rm -rf ${srcdir}/${_svnmod}-build