public
Created

aut/jre 7.4-1 PKGBUILD

  • Download Gist
PKGBUILD
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
# Maintainer: Det
# Contributors: Charles Ghislain, Guillaume ALAUX, Daniel J Griffiths, Jason Chu, Geoffroy Carrier, Army, kfgz, Thomas Dziedzic, Dan Serban
 
pkgname=jre
_major=7
_minor=4
_pkg=${_major}u$_minor
pkgver=$_major.$_minor
_build=b0$_minor
pkgrel=1
pkgdesc="Java 7 Runtime Environment"
url=http://www.oracle.com/technetwork/java/javase/downloads/index.html
arch=('i686' 'x86_64')
license=('custom')
depends=('desktop-file-utils' 'hicolor-icon-theme' 'libxrender' 'libxtst' 'shared-mime-info' 'xdg-utils')
optdepends=('alsa-lib: sound support'
'ttf-dejavu: fonts')
provides=('java-runtime=7' 'java-runtime-headless=7')
conflicts=('java-runtime' 'java-runtime-headless')
backup=(etc/profile.d/jre.sh
etc/profile.d/jre.csh)
install=jre.install
_arch=i386 && _arch2=i586; [ "$CARCH" == 'x86_64' ] && _arch=amd64 && _arch2=x64
# source=("http://download.oracle.com/otn-pub/java/jdk/$_pkg-$_build/jre-$_pkg-linux-i586.tar.gz"
# source=("http://uni-smr.ac.ru/archive/dev/java/JRE/oracle/7/jre-$_pkg-linux-i586.tar.gz"
source=('java-policy-settings.desktop'
'jre.sh'
'jre.csh'
'javaws-launcher')
# md5sums=('cfce10a05f8d152d39aef892f2cd4011' # jre-$_pkg-linux-i586.tar.gz"
md5sums=('f4e25ef1ccef8d36ff2433c3987a64fe' # java-policy-settings.desktop
'85ba1d2b39d5e6efad89ef98d0f19909' # jre.sh
'c106d744a5ca16a7bad35b3332818114' # jre.csh
'45c15a6b4767288f2f745598455ea2bf') # javaws-launcher
# [ "$CARCH" == 'x86_64' ] && source[0]="http://download.oracle.com/otn-pub/java/jdk/$_pkg-$_build/jre-$_pkg-linux-x64.tar.gz" && md5sums[0]='3d3e206cea84129f1daa8e62bf656a28'
# [ "$CARCH" == 'x86_64' ] && source[0]="http://uni-smr.ac.ru/archive/dev/java/JRE/oracle/7/jre-$_pkg-linux-x64.tar.gz" && md5sums[0]='3d3e206cea84129f1daa8e62bf656a28'
 
package() {
msg2 "Due to a change in how Oracle handles the Java SE License Agreement
you are required to:
1) accept the license and download the tarball (.tar.gz) yourself:
http://www.oracle.com/technetwork/java/javase/downloads/jre-7u4-download-1591157.html
2) move it to \$srcdir/ ($srcdir/)"
 
msg2 "If saved in ~/Desktop/, ~/Downloads/ or \$startdir/ ($startdir/),
it will be auto-moved for you"
 
msg2 "Press any key to continue"
read -n1
 
for i in ~/{Desktop,Downloads} $startdir; do
if [ -f $i/jre-$_pkg-linux-$_arch2.tar.gz ]; then
msg2 "Moving jre-$_pkg-linux-$_arch2.tar.gz from "$i"/ to $srcdir/"
mv $i/jre-$_pkg-linux-$_arch2.tar.gz .
fi
done
 
if [ ! -f $srcdir/jre-$_pkg-linux-$_arch2.tar.gz ]; then
error "The tarball was not found in the right location. Exiting.."
exit 1
fi
 
msg2 "Extracting sources..."
bsdtar -xf jre-$_pkg-linux-$_arch2.tar.gz
 
msg2 "Creating required dirs"
cd $(ls -1d jre1.7.0_*/ | tail -1)
mkdir -p "$pkgdir"/{opt/java/jre,usr/{share/{,licenses/jre},lib/mozilla/plugins},etc/{.java/.systemPrefs,profile.d}}
 
msg2 "Re-ordering folders a bit"
mv lib/desktop/{applications,icons,mime} "$pkgdir"/usr/share/
 
msg2 "Removing empty and redundant dirs"
rm -r plugin
rmdir lib/{applet,desktop}
 
msg2 "Moving stuff in place"
mv * "$pkgdir"/opt/java/jre/
 
msg2 "Symlinking the plugin"
cd "$srcdir"
ln -s /opt/java/jre/lib/$_arch/libnpjp2.so "$pkgdir"/usr/lib/mozilla/plugins/
 
msg2 "Installing scripts, .desktop file and licenses"
install -m755 javaws-launcher "$pkgdir"/opt/java/jre/bin/
install -Dm644 java-policy-settings.desktop "$pkgdir"/usr/share/applications/java-policy-settings.desktop
install -m755 jre.{c,}sh "$pkgdir"/etc/profile.d/
cp "$pkgdir"/opt/java/jre/{COPYRIGHT,LICENSE,THIRDPARTYLICENSEREADME.txt} "$pkgdir"/usr/share/licenses/jre/
 
msg2 "Tweaking the javaws .desktop file"
sed -e 's/Exec=javaws/&-launcher %f/' -e '/NoDisplay=true/d' -i "$pkgdir"/usr/share/applications/sun-javaws.desktop
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.