1 # Contributor: Jens Staal <staal1978@gmail.com>
3 pkgname="kings-quest-2-agd-remake"
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')
9 license=('custom-freeware' 'Abandonware')
11 depends=('wine' 'unionfs-fuse')
12 optdepends=('abandonia-menu')
13 source=('http://agdinteractive.com/countdl.php?action=download&game=12')
14 md5sums=('9b877a78b96c7bb34c1d2a95088e0ca7')
18 if [ ${CARCH}=x86_64 ]
20 _winedir="drive_c/Program\ (\x86\)/AGD\ Interactive/King\'s\ Quest\ II"
22 _winedir="drive_c/Program\ Files/AGD\ Interactive/King\'s\ Quest\ II"
25 _icon="$_winedir/kq2menu.ico"
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
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/
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
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]
67 Exec=/usr/bin/$_pkgabbrev
68 Icon=/opt/abandonia/$_pkgabbrev/$_icon
69 Categories=Game;Abandonia;
71 StartupNotify=false" >> /$pkgdir/usr/share/applications/$_pkgabbrev.desktop