updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / jre / PKGBUILD
blob861e78b032de77039b90104ab5615918207cdd81
1 # Maintainer: Det
2 # Contributors: Charles Ghislain, Guillaume ALAUX, Daniel J Griffiths, Jason Chu, Geoffroy Carrier, Army, kfgz, Thomas Dziedzic, Dan Serban
4 pkgname=jre
5 pkgver=7u2
6 _build=b13
7 pkgrel=1
8 pkgdesc="Java 7 Runtime Environment"
9 url=http://www.oracle.com/technetwork/java/javase/downloads/index.html
10 arch=('i686' 'x86_64')
11 license=('custom')
12 depends=('desktop-file-utils' 'libxtst' 'shared-mime-info' 'xdg-utils')
13 provides=('java-runtime=7')
14 conflicts=('java-runtime')
15 install=jre.install
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'
19         'jre.sh'
20         'jre.csh'
21         'javaws-launcher')
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'
29 package() {
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
38   rm -r plugin
39   rmdir lib/{applet,desktop}
41   # Move stuff in place
42   mv * "$pkgdir"/opt/java/jre
44   # Symlink the plugin
45   cd "$srcdir"
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