2 # Contributors: Charles Ghislain, Guillaume ALAUX, Daniel J Griffiths, Jason Chu, Geoffroy Carrier, Army, kfgz, Thomas Dziedzic, Dan Serban
8 pkgdesc="Java 7 Runtime Environment"
9 url=http://www.oracle.com/technetwork/java/javase/downloads/index.html
10 arch=('i686' 'x86_64')
12 depends=('desktop-file-utils' 'libxtst' 'shared-mime-info' 'xdg-utils')
13 provides=('java-runtime=7')
14 conflicts=('java-runtime')
16 _arch=i386; [ "$CARCH" == 'x86_64' ] && _arch=amd64
17 source=("http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/jre-$pkgver-linux-i586.tar.gz"
18 'java-policy-settings.desktop'
22 md5sums=('78923ef097586c36a6242c54cb20abd7'
23 '6614b04176b9b7dfe26f22e9ce846801'
24 '7cd3dc10e7a37468cad4053a067dcd01'
25 'cc90df2df6fe80fab885a80036d420a1'
26 '45c15a6b4767288f2f745598455ea2bf')
27 [ "$CARCH" == 'x86_64' ] && source[0]="http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/jre-$pkgver-linux-x64.tar.gz" && md5sums[0]='c6d0aa62337148787795870a12c17974'
30 # Create required dirs
31 cd $(ls -1d jre1.7.0_*/ | tail -1)
32 mkdir -p "$pkgdir"/{opt/java/jre,usr/{share/{,licenses/jre},lib/mozilla/plugins},etc/{.java/.systemPrefs,profile.d}}
34 # Re-order folders a bit
35 mv lib/desktop/{applications,icons,mime} "$pkgdir"/usr/share/
37 # Remove empty and redundant dirs
39 rmdir lib/{applet,desktop}
42 mv * "$pkgdir"/opt/java/jre
46 ln -s /opt/java/jre/lib/$_arch/libnpjp2.so "$pkgdir"/usr/lib/mozilla/plugins/libnpjp2.so
48 # Install scripts, .desktop file and licenses
49 install -m755 javaws-launcher "$pkgdir"/opt/java/jre/bin/
50 install -Dm644 java-policy-settings.desktop "$pkgdir"/usr/share/applications/java-policy-settings.desktop
51 install -m755 jre.{c,}sh "$pkgdir"/etc/profile.d/
52 cp "$pkgdir"/opt/java/jre/{COPYRIGHT,LICENSE,THIRDPARTYLICENSEREADME.txt} "$pkgdir"/usr/share/licenses/jre/
54 # Tweak the javaws .desktop file
55 sed -e 's/Exec=javaws/&-launcher %f/' -e '/NoDisplay=true/d' -i "$pkgdir"/usr/share/applications/sun-javaws.desktop