updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / kings-quest-3-agd-remake / PKGBUILD
blob5324fd132ffc0819d3a3ed4fc871a650394c2a1e
1 # Contributor: Jens Staal <staal1978@gmail.com>
3 pkgname="kings-quest-3-agd-remake"
4 pkgver="1.0"
5 pkgrel=3
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')
8 arch=('i686' 'x86_64')
9 license=('custom-freeware' 'Abandonware')
10 install='kq3.install'
11 depends=('wine' 'unionfs-fuse')
12 optdepends=('abandonia-menu')
13 source=('http://agdinteractive.com/countdl.php?action=download&game=13')
14 md5sums=('4aa10efe6259a3f589a2d8250eafba10')
15 _exe="Launcher.exe"
16 _pkgabbrev="kq3"
18 if [ ${CARCH}=x86_64 ]
19   then
20     _winedir="drive_c/Program\ (\x86\)/AGD\ Interactive/King\'s\ Quest\ III\ Redux"
21   else
22     _winedir="drive_c/Program\ Files/AGD\ Interactive/King\'s\ Quest\ III\ Redux"
25 _icon="$_winedir/kq3reduxmenu.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=13" $srcdir/Kq3install.exe
32         mkdir -p -m755 $srcdir/.tmp
33         WINEPREFIX=$srcdir/.tmp/ wine $srcdir/Kq3install.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 ~/.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
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 -m755 "$pkgdir/usr/share/" 
60         mkdir -p -m755 "$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