1 # Contributor: Jens Staal <staal1978@gmail.com>
3 pkgname="kings-quest-3-agd-remake"
6 pkgdesc="A free windows port of the classic adventure game from Abandonia, played in Wine."
7 url=('http://www.agdinteractive.com/games/kq3/about/overview.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=13')
14 md5sums=('4aa10efe6259a3f589a2d8250eafba10')
18 if [ ${CARCH}=x86_64 ]
20 _winedir="drive_c/Program\ (\x86\)/AGD\ Interactive/King\'s\ Quest\ III\ Redux"
22 _winedir="drive_c/Program\ Files/AGD\ Interactive/King\'s\ Quest\ III\ Redux"
25 _icon="$_winedir/kq3reduxmenu.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=13" $srcdir/Kq3install.exe
32 mkdir -p -m755 $srcdir/.tmp
33 WINEPREFIX=$srcdir/.tmp/ wine $srcdir/Kq3install.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 ~/.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 $_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 -m755 "$pkgdir/usr/share/"
60 mkdir -p -m755 "$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