blob: c68573cbb9fdf708e0e0b4b1ab4392b5224a5ffe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# Maintainer: Brian Astrup Mikkelsen <brian@mikkelsen.com>
# Maintainer: HER0 01 <aconrad 103 at gmail.com>
pkgname=robocode
pkgver=1.9.5.4
pkgrel=1
pkgdesc="Programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen."
arch=(any)
url='http://robocode.sourceforge.net'
depends=(java-environment)
license=('EPL')
source=(http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver-setup.jar robocode.desktop)
md5sums=('c2a350d85cbe215e7fadca5ec07fdc14'
'8a556209b3ffb39839f28f30479a8c8d')
package(){
# remove windows and jar specific files
find $srcdir -type l -exec rm {} \;
find $srcdir -iname "*.bat" -exec rm {} \;
find $srcdir -iname "*.command" -exec rm {} \;
rm -r $srcdir/META-INF
mkdir -p $pkgdir/opt/robocode
cp -r $srcdir/* $pkgdir/opt/robocode
# link volatile dirs to /var/lib
mkdir -p $pkgdir/var/lib/robocode/config
chmod 777 $pkgdir/var/lib/robocode/config
ln -s /var/lib/robocode/config $pkgdir/opt/robocode/config
mv $pkgdir/opt/robocode/robots $pkgdir/var/lib/robocode/robots
find $pkgdir/var/lib/robocode/robots -type d -exec chmod 777 {} \;
ln -s /var/lib/robocode/robots $pkgdir/opt/robocode/robots
mv $pkgdir/opt/robocode/roborumble $pkgdir/var/lib/robocode/roborumble
find $pkgdir/var/lib/robocode/roborumble -type d -exec chmod 777 {} \;
ln -s /var/lib/robocode/roborumble $pkgdir/opt/robocode/roborumble
# Menu item
mkdir -p $pkgdir/usr/share/applications
install -m 664 $startdir/robocode.desktop $pkgdir/usr/share/applications
# fix startup scripts
mkdir -p $pkgdir/usr/bin
for script in $pkgdir/opt/robocode/*.sh ; do
sed '/^java/!d' -i $script
sed '1i#!/bin/bash\n\ncd /opt/robocode' -i $script
mv $script $pkgdir/usr/bin/`basename $script .sh`
done
# make scripts in /usr/bin executable
chmod +x $pkgdir/usr/bin/*
}
|