updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / kings-quest-2-agd-remake / PKGBUILD
blob28b5718db06da961468a17c02fac5788532c499e
1 # Contributor: Jens Staal <staal1978@gmail.com>
3 pkgname="kings-quest-2-agd-remake"
4 pkgver="3.1c"
5 pkgrel=3
6 pkgdesc="A free windows port of the classic adventure game from Abandonia, played in Wine."
7 url=('http://www.abandonia.com/en/games/169/Kings+Quest+II+-+Romancing+the+Stones+VGA.html')
8 arch=('i686' 'x86_64')
9 license=('custom-freeware' 'Abandonware')
10 install='kq2.install'
11 depends=('wine' 'unionfs-fuse')
12 optdepends=('abandonia-menu')
13 source=('http://agdinteractive.com/countdl.php?action=download&game=12')
14 md5sums=('9b877a78b96c7bb34c1d2a95088e0ca7')
15 _exe="Launcher.exe"
16 _pkgabbrev="kq2"
18 if [ ${CARCH}=x86_64 ]
19   then
20     _winedir="drive_c/Program\ (\x86\)/AGD\ Interactive/King\'s\ Quest\ II"
21   else
22     _winedir="drive_c/Program\ Files/AGD\ Interactive/King\'s\ Quest\ II"
25 _icon="$_winedir/kq2menu.ico"
27 build() {
28         mkdir -p -m755 "$pkgdir/opt/" 
29         mkdir -p -m755 "$pkgdir/opt/abandonia" 
30         mkdir -p -m755 "$pkgdir/opt/abandonia/$_pkgabbrev" 
31         mv $srcdir/"countdl.php?action=download&game=12" $srcdir/Kq2vga31c.exe
32         mkdir -p -m755 $srcdir/.tmp
33         WINEPREFIX=$srcdir/.tmp/ wine $srcdir/Kq2vga31c.exe
36 package() {
37         cp -ar $srcdir/.tmp/* "$pkgdir/opt/abandonia/$_pkgabbrev"
39         #ok, let's use a script to start the game
40         #script also include union mount in order to enable multi-user playing of this game from a single install.
42         mkdir -p -m755 /$pkgdir/usr/bin/ 
44         printf "#!${SHELL}
45                 mkdir -p ~/.abandonia/$_pkgabbrev/persistent
46                 mkdir -p ~/.abandonia/$_pkgabbrev/temp
47                 unionfs -o cow -o umask=000 ~/.abandonia/$_pkgabbrev/persistent=RW:/opt/abandonia/$_pkgabbrev=RO ~/.abandonia/$_pkgabbrev/temp
48                 cd ~/.abandonia/$_pkgabbrev/temp/$_winedir
49                 WINEPREFIX=~/.abandonia/$_pkgabbrev/temp wine Launcher.exe
50                 cd ~/
51                 fusermount -u ~/.abandonia/$_pkgabbrev/temp
52         " >> /$pkgdir/usr/bin/$_pkgabbrev.sh 
54         chmod +x /$pkgdir/usr/bin/$_pkgabbrev.sh 
55         ln -s $_pkgabbrev.sh /$pkgdir/usr/bin/$_pkgabbrev 
57         # Automatic generation of a .desktop file
59         mkdir -p -m644 "$pkgdir/usr/share/" 
60         mkdir -p -m644 "$pkgdir/usr/share/applications/" 
62         printf "[Desktop Entry]
63 Version=$pkgver
64 Type=Application
65 Name=$pkgname
66 Comment=$pkgdesc
67 Exec=/usr/bin/$_pkgabbrev
68 Icon=/opt/abandonia/$_pkgabbrev/$_icon
69 Categories=Game;Abandonia;
70 Terminal=false
71 StartupNotify=false" >> /$pkgdir/usr/share/applications/$_pkgabbrev.desktop
73