2 # Contributors: Charles Ghislain, Guillaume ALAUX, Daniel J Griffiths, Jason Chu, Geoffroy Carrier, Army, kfgz, Thomas Dziedzic, Dan Serban
8 pkgdesc="The Java Development Kit"
9 url=http://www.oracle.com/technetwork/java/javase/downloads/index.html
10 arch=('i686' 'x86_64')
13 provides=('java-environment=7')
14 conflicts=(java-environment)
16 source=("http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/jdk-$pkgver-linux-i586.tar.gz"
17 'java-monitoring-and-management-console.desktop'
18 'java-visualvm.desktop'
21 'derby-network-server'
22 'derby-network-server.conf'
24 md5sums=('8a06141ffae6c96743ea405b75e54f84'
25 '352ca9559e47e06dfcd401c271fb0f4c'
26 '38c38a60fde0e064c5258a2406f03039'
27 'b83ab5742651b4234b7d2e20785c6693'
28 '6f4cbf332816d2c4e9578ecd1d0dce7f'
29 'a279e195e249000646895d93e199860d'
30 '4bdff6982c66d24a879c424aaac3d04d'
31 '45c15a6b4767288f2f745598455ea2bf')
33 [ "$CARCH" == 'x86_64' ] && _arch=amd64 && source[0]="http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/jdk-$pkgver-linux-x64.tar.gz" && md5sums[0]='a0bbb9265b4633cfd7823928649f450c'
36 # Create required dirs
37 cd $(ls -1d jdk1.7.0_* | tail -1)
38 mkdir -p "$pkgdir"/{opt/java/{,jre/lib/$_arch},etc/profile.d,usr/share/{applications,licenses/jdk}}
40 # Fetch missing libraries from 'jre' to fix jconsole
41 cp jre/lib/$_arch/lib{saproc,attach}.so "$pkgdir"/opt/java/jre/lib/$_arch/
43 # Remove already provided 'jre' and redundant .bat files
44 rm -r jre # lib/desktop
45 find . -name '*\.bat' -delete
48 mv * "$pkgdir"/opt/java/
50 # Install scripts, .desktop files, confs and licenses
52 install -m755 jdk.{c,}sh "$pkgdir"/etc/profile.d/
53 cp "$pkgdir"/opt/java/{COPYRIGHT,LICENSE,THIRDPARTYLICENSEREADME.txt} "$pkgdir"/usr/share/licenses/jdk/
54 cp java-{visualvm,monitoring-and-management-console}.desktop "$pkgdir"/usr/share/applications/
55 install -D derby-network-server "$pkgdir"/etc/rc.d/derby-network-server
56 install -Dm644 derby-network-server.conf "$pkgdir"/etc/conf.d/derby-network-server