updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / javahotpot / PKGBUILD
blob6784ecf66ad1856c559186b273c15c76f5ec8ca6
1 # Contributor: Jens Staal <staal1978@gmail.com>
2 pkgname=javahotpot
3 pkgver=6.1
4 pkgrel=2
5 pkgdesc="Java-based educational tool for creating web-based exercises"
6 url="http://hotpot.uvic.ca/"
7 arch=('any')
8 license=('Custom:freeware')
9 depends=('java-runtime' 'unionfs-fuse')
10 source=("http://hotpot.uvic.ca/javahotpot61.zip" "hpheader6.gif")
11 md5sums=('8283f6a693bb144858e055e254836448' '1394f2cdf4663a2845ccade535922213')
12 _exe=('JavaHotPotatoes6.app/Contents/Resources/Java/hotpot6.jar')
13 _pkgabbrev=JavaHotPot
14 _icon=('hpheader6.gif')
16 build() {
17 #       copy .jar files and icon
18         mkdir -p $pkgdir/usr/share/java/$_pkgabbrev 
19         cp -r $srcdir/javahotpot/* $pkgdir/usr/share/java/$_pkgabbrev
20         cp -r $_icon $pkgdir/usr/share/java/$_pkgabbrev
23 #       set-up a per-user start script and a .desktop file
25 mkdir $pkgdir/usr/bin
27 printf "#!${SHELL}
28 if whereis unionfs-fuse>/dev/null 2>&1;
29   then
30     if whereis jar>/dev/null 2>&1;
31         then
32                 mkdir ~/.$_pkgabbrev
33                 mkdir ~/.$_pkgabbrev.tmp
34                 unionfs -o cow -o umask=000 ~/.$_pkgabbrev=RW:/usr/share/java/$_pkgabbrev=RO ~/.$_pkgabbrev.tmp
35                 java -jar ~/.$_pkgabbrev.tmp/$_exe
36                 fusermount -u ~/.$_pkgabbrev.tmp
37         else
38                 echo '==> Please make sure to have a java runtime installed and have it in your PATH array.'
39     fi
40   else
41     echo '==> Please make sure to have unionfs-fuse installed and have it in your PATH array.'
43 return \$?" >> /$pkgdir/usr/bin/$_pkgabbrev.sh 
45         chmod +x /$pkgdir/usr/bin/$_pkgabbrev.sh 
46         ln -s $_pkgabbrev.sh /$pkgdir/usr/bin/$_pkgabbrev 
48         # Automatic generation of a .desktop file
50         mkdir -p -m644 $pkgdir/usr/share/ 
51         mkdir -p -m644 $pkgdir/usr/share/applications/ 
53         printf "[Desktop Entry]
54 Version=$pkgver
55 Type=Application
56 Name=$pkgname
57 Comment=$pkgdesc
58 Exec=/usr/bin/$_pkgabbrev
59 Icon=/usr/share/java/$_pkgabbrev/$_icon
60 Categories=Education;
61 Terminal=false
62 StartupNotify=false" >> /$pkgdir/usr/share/applications/$_pkgabbrev.desktop
65 #       Install licence file
67 install -D -m0644 $srcdir/javahotpot/ReadMe6-1-0-5.txt $pkgdir/usr/share/licenses/$_pkgabbrev/ReadMe6-1-0-5.txt