summaryrefslogtreecommitdiff
path: root/pcr/castle-combat
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/castle-combat')
-rw-r--r--pcr/castle-combat/PKGBUILD36
1 files changed, 27 insertions, 9 deletions
diff --git a/pcr/castle-combat/PKGBUILD b/pcr/castle-combat/PKGBUILD
index cc15da96b..8ef3d8d14 100644
--- a/pcr/castle-combat/PKGBUILD
+++ b/pcr/castle-combat/PKGBUILD
@@ -4,21 +4,39 @@ pkgname=castle-combat
pkgver=0.8.1
pkgrel=2
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=('x86_64' 'i686')
+arch=('any')
url="http://www.linux-games.com/castle-combat/"
license=('GPL2')
-depends=('sdl' 'sdl_mixer' 'sdl_image')
+depends=('python2-setuptools' 'python2-twisted' 'python2-pygame' 'python2-numpy')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('c6350f95b82638a9da9a45cb0c995dcc7bf1fbd2f6e0d5f58347d73f9f3131697328e7e78cf08bb8c50d4f73eb754cc40c3680e76177f9f46f3a353c8768251a')
-build() {
- cd $pkgname-$pkgver
- ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sbindir=/usr/bin
- make
+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() {
- cd $pkgname-$pkgver
- ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sbindir=/usr/bin
- make DESTDIR="$pkgdir/" install
+ 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
}