blob: 294688b48ba2308b662a1b3ced8b2627ee89452e (
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
|
# Maintainer: Luke R. <g4jc@openmailbox.org> GPG: rsa4096/3EAE8697
pkgname=castle-combat
pkgver=0.8.1
pkgrel=3
pkgdesc="Clone of the old arcade game Rampart. Build castle walls, place cannons inside these walls, and shoot at the walls the enemy(s)."
arch=('any')
url="http://www.linux-games.com/castle-combat/"
license=('GPL2')
depends=('python2-setuptools' 'python2-twisted' 'python2-pygame' 'python2-numpy')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('c6350f95b82638a9da9a45cb0c995dcc7bf1fbd2f6e0d5f58347d73f9f3131697328e7e78cf08bb8c50d4f73eb754cc40c3680e76177f9f46f3a353c8768251a')
prepare() {
# replace /usr/bin/env python with python2
find $pkgname-$pkgver -name '*.py' -type f -exec sed -ri 's:^#!/usr/bin/(env )?python$:&2:' '{}' \;
## depreciated python code fixes
find $pkgname-$pkgver -name '*.py' -type f -exec sed -ri 's|Numeric|numpy|' '{}' \;
find $pkgname-$pkgver -name '*.py' -type f -exec sed -ri 's|UInt8|int|' '{}' \;
##find $pkgname-$pkgver -name '*.py' -type f -exec sed -ri 's|nonzero|numpy.nonzero|' '{}' \;
## fix data path
sed -i 's|data_path = "data"|data_path = "/usr/bin/castle-combat-0.8.1/data"|' $srcdir/$pkgname-$pkgver/src/common.py
## remove non-free font and macosx items
sed -i '/font = pygame.font/d' $srcdir/$pkgname-$pkgver/src/common.py
sed -i '/small_font = pygame.font.Font/d' $srcdir/$pkgname-$pkgver/src/common.py
sed -i '/global font/a font = pygame.font.SysFont("sans", 34)' $srcdir/$pkgname-$pkgver/src/common.py
sed -i 's|font = pygame.font.SysFont|\tfont = pygame.font.SysFont|' $srcdir/$pkgname-$pkgver/src/common.py
sed -i '/global small_font/a small_font = pygame.font.SysFont("sans", 24)' $srcdir/$pkgname-$pkgver/src/common.py
sed -i 's|small_font = pygame.font.SysFont|\t\small_font = pygame.font.SysFont|' $srcdir/$pkgname-$pkgver/src/common.py
rm -rf $srcdir/$pkgname-$pkgver/dist $srcdir/$pkgname-$pkgver/src/colourba.ttf $srcdir/$pkgname-$pkgver/src/font_read_me.html
}
package() {
mkdir -p $pkgdir/usr/bin/
cp -r $srcdir/$pkgname-$pkgver/ $pkgdir/usr/bin/
cat <<EOF > $pkgdir/usr/bin/castle-combat
#!/bin/bash
cd /usr/bin/castle-combat-0.8.1
python2 castle-combat.py
EOF
chmod 755 $pkgdir/usr/bin/castle-combat
}
|