84 lines
2.4 KiB
Bash
84 lines
2.4 KiB
Bash
# Template file for 'oracle-jre'
|
|
pkgname=oracle-jre
|
|
version=8u60
|
|
_longVersion=1.8.0_60
|
|
revision=1
|
|
_build=27
|
|
|
|
short_desc="Java Runtime Environment (JRE)"
|
|
maintainer="Enno Boland <gottox@voidlinux.eu>"
|
|
homepage="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
|
|
license="oracle"
|
|
lib32disabled=yes
|
|
repository="nonfree"
|
|
only_for_archs="i686 x86_64"
|
|
depends="hicolor-icon-theme desktop-file-utils xdg-utils shared-mime-info wget"
|
|
hostmakedepends="wget"
|
|
provides="java-runtime-${version}_1"
|
|
replaces="java-runtime>=0"
|
|
|
|
case "${XBPS_TARGET_MACHINE}" in
|
|
x86_64)
|
|
_arch=amd64
|
|
_filename=jre-${version}-linux-x64.tar.gz
|
|
checksum="49dadecd043152b3b448288a35a4ee6f3845ce6395734bacc1eae340dff3cbf5"
|
|
;;
|
|
i686)
|
|
_arch=i386
|
|
_filename=jre-${version}-linux-i586.tar.gz
|
|
checksum="8e05fa8bf73937d5e63ae80583f1e33858f0ef6be23701fd3b0070ea7af4d93a"
|
|
;;
|
|
esac
|
|
|
|
distfiles="http://download.oracle.com/otn-pub/java/jdk/${version}-b${_build}/${_filename}"
|
|
wrksrc="jre$_longVersion"
|
|
|
|
do_fetch() {
|
|
mkdir -p $wrksrc
|
|
cd $wrksrc
|
|
wget \
|
|
--no-check-certificate \
|
|
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
|
|
--progress=bar:force \
|
|
-c -O $_filename \
|
|
$distfiles
|
|
echo "$checksum $_filename" | sha256sum -c || { sha256sum "$_filename"; return 1; }
|
|
}
|
|
|
|
do_extract() {
|
|
tar xf $_filename -C ..
|
|
}
|
|
|
|
do_build() {
|
|
sed \
|
|
-e "s|%LONG_VERSION%|${_longVersion}|" \
|
|
${FILESDIR}/oracle-jre.sh.in > 11_oracle-jre.sh
|
|
sed \
|
|
-e "s|%LONG_VERSION%|${_longVersion}|" \
|
|
-e "s|%ORACLE_JRE_URL%|${distfiles}|" \
|
|
-e "s|%ORACLE_JRE_CHECKSUM%|${checksum}|" \
|
|
${FILESDIR}/oracle-jre-vars.sh.in > oracle-jre-vars.sh
|
|
sed \
|
|
-e "s|^Exec=|Exec=/usr/lib/jvm/jre${_longVersion}/bin/policytool|" \
|
|
${FILESDIR}/java-policy-settings.desktop.in > java-policy-settings.desktop
|
|
}
|
|
|
|
do_install() {
|
|
vmkdir "usr/share/licenses/${pkgname}"
|
|
vinstall oracle-jre-vars.sh 644 "usr/lib/jvm/"
|
|
|
|
vinstall LICENSE 644 "usr/share/licenses/${pkgname}"
|
|
vinstall java-policy-settings.desktop 644 usr/share/applications
|
|
ln -s jre${_longVersion} ${DESTDIR}/usr/lib/jvm/oracle-jre
|
|
|
|
for i in 16 20 22 24 32 40 48 64 72 96 128 256 512; do
|
|
vinstall $FILESDIR/oracle-jre-${i}x${i}.png 644 usr/share/icons/hicolor/${i}x${i}/apps oracle-java.png
|
|
done
|
|
|
|
vmkdir "usr/lib/mozilla/plugins"
|
|
ln -srf ${DESTDIR}/usr/lib/jvm/jre${_longVersion}/lib/${_arch}/libnpjp2.so \
|
|
${DESTDIR}/usr/lib/mozilla/plugins
|
|
|
|
vmkdir "etc/profile.d"
|
|
vinstall 11_oracle-jre.sh 644 "etc/profile.d"
|
|
}
|