summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fc15f429db4a92c19c623e5cdc062fe9edbdff68 (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
55
56
57
58
59
60
61
62
pkgname=terrafire
pkgver=2.0
pkgrel=7
pkgdesc="Award-winning arcade game featuring rendered 3D graphics, realistic gravitational physics and 360 degree parallax scrolling from ORT Software."
arch=('i686' 'x86_64')
url="http://www.ortsoftware.com/tf.html"
license=('freeware')
provides=('terrafire')
source=('terrafire.desktop' 'http://www.ortsoftware.com/tf_full.exe')
depends=('dosbox')
makedepends=('innoextract' 'imagemagick')
md5sums=('c144a31089faabfe183fff15a0c3b373' 'cf078359a989aca11f85ddd3aca9276b')


build() {
	cd "$srcdir"
	msg "Extracting installer contents..."

	# Extract all files from the setup program
	innoextract "tf_full.exe" || return 1

	# Create a png icon out of the .ico
	convert "app/tf.ico" "terrafire.png" || return 1

}

package() {
	# Install the shortcut and icon into /usr/share
	install -Dm644 ${srcdir}/terrafire.desktop ${pkgdir}/usr/share/applications/terrafire.desktop
	install -Dm644 ${srcdir}/terrafire.png ${pkgdir}/usr/share/pixmaps/terrafire.png

	cd "$srcdir"
	cd "app"
	mkdir -p "$pkgdir/opt/terrafire"
	mkdir -p "$pkgdir/usr/bin/"

	# Copy all extracted files to the destination folder
	cp -ar * "$pkgdir/opt/terrafire"


	# Create a command-line script for launching the game
	cat << EOF > "$pkgdir/usr/bin/terrafire"
#!/bin/bash
# Let us create a hidden folder in the home
mkdir -p "\$HOME/.terrafire"
if [ ! -f "\$HOME/.terrafire/settings.cfg" ]; then
	cp "/opt/terrafire/settings.cfg" "\$HOME/.terrafire/"
fi
FILES=\$(ls /opt/terrafire)

# Checking/preparing environment
for f in \$FILES; do
	if [ ! -e "\$HOME/.terrafire/\$f" ]; then
		ln -s "/opt/terrafire/\$f" "\$HOME/.terrafire/"
	fi
done

dosbox -exit "\$HOME/.terrafire/tf.exe"
EOF
	chmod +x "$pkgdir/usr/bin/terrafire"

}