1 # Maintainer: Max Roder <maxroder@web.de>
6 pkgdesc="A custom Ragnarok online client. Uses its own updater."
8 url="http://openkore.com"
10 depends=('perl-time-hires' 'perl-io-compress')
11 makedepends=('subversion' 'python2')
12 optdepends=('perl-wx: To use the mapviewer')
14 install='openkore-svn.install'
17 _svntrunk="https://openkore.svn.sourceforge.net/svnroot/openkore/openkore/trunk/"
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/"
27 msg "Getting main program..."
29 if [ -d ${_svnmod}/.svn ]; then
30 (cd ${_svnmod} && svn up -r $pkgver)
32 svn co ${_svntrunk} --config-dir ./ -r $pkgver ${_svnmod}
35 mkdir -p ${srcdir}/fields ${srcdir}/tables ${srcdir}/control
37 msg "Getting fields..."
42 svn co ${_svnfields} --config-dir ./ .
45 msg "Getting tables..."
50 svn co ${_svntables} --config-dir ./ .
53 msg "Getting config files..."
58 svn co ${_svncontrol} --config-dir ./ .
61 msg "SVN checkout done or server timeout"
65 msg "Starting build..."
67 svn export ${_svnmod} ${_svnmod}-build
70 # Patch Makefile (python2 instead of python)
71 sed -i 's/python/python2/g' Makefile
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/
96 cp -a * ${pkgdir}/opt/openkore/
98 # Set correct permissions
99 chmod -R g+rws ${pkgdir}/opt/openkore
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
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
114 cd .. && rm -rf ${srcdir}/${_svnmod}-build