Created
April 27, 2012 15:41
-
-
Save anonymous/2510259 to your computer and use it in GitHub Desktop.
PKGBUILD for jre 7.4-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 $startdir/" | |
msg2 "If saved in /tmp/, ~/Desktop/ or ~/Downloads/ it will be auto-moved for you" | |
msg2 "Press any key to continue" | |
read -n1 | |
if [ ! -f "jre-$_pkg-linux-$_arch2.tar.gz" ]; then | |
if [ ! -f "$startdir/jre-$_pkg-linux-$_arch2.tar.gz" ]; then | |
# look in common (download) locations, and move it in startdir | |
for i in /tmp ~/{Desktop,Downloads}; do | |
if [ -f "$i/jre-$_pkg-linux-$_arch2.tar.gz" ]; then | |
msg2 "Moving jre-$_pkg-linux-$_arch2.tar.gz from $i/ to $startdir/" | |
mv "$i/jre-$_pkg-linux-$_arch2.tar.gz" "$startdir/" | |
break | |
fi | |
done | |
if [ ! -f "$startdir/jre-$_pkg-linux-$_arch2.tar.gz" ]; then | |
error "Tarball not found" | |
exit 1 | |
fi | |
fi | |
# create symlink to startdir in src/ | |
ln -s ../jre-$_pkg-linux-$_arch2.tar.gz jre-$_pkg-linux-$_arch2.tar.gz | |
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment