mirror of
https://github.com/moparisthebest/arch-ppa
synced 2025-02-16 07:00:15 -05:00
Add jdk6
This commit is contained in:
parent
7bbe2ae499
commit
6fc85c9b99
153
src/jdk6/PKGBUILD
Executable file
153
src/jdk6/PKGBUILD
Executable file
@ -0,0 +1,153 @@
|
||||
# Maintainer: Giovanni Santini 'ItachiSan' <giovannisantini93@yahoo.it>
|
||||
# Contributors: Det, JavaAtom, Ethan Hall, Giovanni Santini, Guillaume ALAUX, Daniel J Griffiths,
|
||||
# Jason Chu, Geoffroy Carrier, Thomas Dziedzic, Dan Serban
|
||||
|
||||
_pkgname=jdk
|
||||
pkgname=jdk6
|
||||
_major=6
|
||||
_minor=45
|
||||
_build=b06
|
||||
pkgver=${_major}u${_minor}
|
||||
pkgrel=4
|
||||
pkgdesc="Oracle Java $_major Development Kit (public release - end of support)"
|
||||
arch=('i686' 'x86_64')
|
||||
url=https://www.java.com/en/download/faq/java_6.xml
|
||||
license=('custom')
|
||||
depends=('ca-certificates-java' 'desktop-file-utils' 'hicolor-icon-theme' 'java-environment-common'
|
||||
'java-runtime-common' 'libx11' 'libxrender' 'libxslt' 'libxtst' 'shared-mime-info' 'xdg-utils')
|
||||
optdepends=('alsa-lib: for basic sound support'
|
||||
'derby: for Oracle Apache Derby Java database (AUR)'
|
||||
'eclipse: "Oracle Java Mission Control" plugins for Eclipse'
|
||||
'gtk2: for Gtk+ look and feel (desktop)'
|
||||
'ttf-font: fonts'
|
||||
'visualvm: for lightweight profiling capabilities')
|
||||
provides=("java-runtime=$_major" "java-runtime-headless=$_major" "java-web-start=$_major" "java-environment=$_major"
|
||||
"java-runtime-jre=$_major" "java-runtime-headless-jre=$_major" "java-web-start-jre=$_major" "java-environment-jdk=$_major")
|
||||
|
||||
# Variables
|
||||
DLAGENTS=('http::/usr/bin/curl -LC - -b oraclelicense=a -O')
|
||||
if [[ $CARCH = x86_64 ]]; then
|
||||
_arch=x64
|
||||
_arch2=amd64
|
||||
else # Force fallback to i386 for AUR
|
||||
_arch=i586
|
||||
_arch2=i386
|
||||
fi
|
||||
_jname=${_pkgname}${_major}
|
||||
_jvmdir=/usr/lib/jvm/java-$_major-$_pkgname
|
||||
|
||||
backup=("etc/java-$_jname/$_arch2/jvm.cfg"
|
||||
"etc/java-$_jname/$_arch2/server/Xusage.txt"
|
||||
"etc/java-$_jname/images/cursors/cursors.properties"
|
||||
"etc/java-$_jname/management/jmxremote.access"
|
||||
"etc/java-$_jname/management/jmxremote.password.template"
|
||||
"etc/java-$_jname/management/management.properties"
|
||||
"etc/java-$_jname/management/snmp.acl.template"
|
||||
"etc/java-$_jname/security/java.policy"
|
||||
"etc/java-$_jname/security/java.security"
|
||||
"etc/java-$_jname/security/javaws.policy"
|
||||
"etc/java-$_jname/calendars.properties"
|
||||
"etc/java-$_jname/content-types.properties"
|
||||
"etc/java-$_jname/flavormap.properties"
|
||||
"etc/java-$_jname/fontconfig.properties.src"
|
||||
"etc/java-$_jname/jvm.hprof.txt"
|
||||
"etc/java-$_jname/logging.properties"
|
||||
"etc/java-$_jname/net.properties"
|
||||
"etc/java-$_jname/psfont.properties.ja"
|
||||
"etc/java-$_jname/psfontj2d.properties"
|
||||
"etc/java-$_jname/sound.properties")
|
||||
options=(!strip) # JDK debug-symbols
|
||||
install=$pkgname.install
|
||||
source=('javaws-launcher'
|
||||
"jconsole-$_jname.desktop"
|
||||
"jmc-$_jname.desktop"
|
||||
"jvisualvm-$_jname.desktop"
|
||||
"policytool-$_jname.desktop"
|
||||
"http://download.oracle.com/otn-pub/java/jce_policy/$_major/jce_policy-$_major.zip")
|
||||
source_i686=("http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/$_pkgname-$pkgver-linux-i586.bin")
|
||||
source_x86_64=("http://download.oracle.com/otn-pub/java/jdk/$pkgver-$_build/$_pkgname-$pkgver-linux-x64.bin")
|
||||
md5sums=('45c15a6b4767288f2f745598455ea2bf'
|
||||
'4ecc28010b77b31c101e61f420a415fa'
|
||||
'6ab27fa31a5a83f98f4a36ec3bd47911'
|
||||
'b30ca4304c8bb6b01650d9d235f97995'
|
||||
'e513ee55f55467f7fd323195ae70f418'
|
||||
'b20f9d6ed14e55d73a5ed204bca01e7a')
|
||||
md5sums_i686=('3269370b7c34e6cbfed8785d3d0c5cbd')
|
||||
md5sums_x86_64=('40c1a87563c5c6a90a0ed6994615befe')
|
||||
|
||||
package() {
|
||||
msg2 "Extracting the .bin"
|
||||
rm -rf ${_pkgname}1.${_major}.0_${_minor}
|
||||
sh $_pkgname-$pkgver-linux-$_arch.bin >/dev/null
|
||||
|
||||
msg2 "Creating required dirs"
|
||||
cd ${_pkgname}1.${_major}.0_${_minor}
|
||||
install -d "$pkgdir"/{usr/{lib/{jvm/java-$_major-$_pkgname/bin,mozilla/plugins},share/licenses/java$_major-$_pkgname},etc/.java/.systemPrefs}
|
||||
|
||||
msg2 "Preparing"
|
||||
# Link duplicate binaries from jre/
|
||||
for i in $(ls jre/bin/); do
|
||||
ln -sf $_jvmdir/jre/bin/$i bin/$i
|
||||
done
|
||||
|
||||
# Link NPAPI plugin
|
||||
ln -sf $_jvmdir/jre/lib/$_arch2/libnpjp2.so "$pkgdir"/usr/lib/mozilla/plugins/libnpjp2-$_jname.so
|
||||
|
||||
# Replace JKS keystore with 'ca-certificates-java'
|
||||
ln -sf /etc/ssl/certs/java/cacerts jre/lib/security/cacerts
|
||||
|
||||
# Suffix .desktops, icons and MIME packages
|
||||
for i in $(find jre/lib/desktop/ -type f); do
|
||||
rename -- "." "-$_jname." $i
|
||||
done
|
||||
|
||||
# Suffix man pages
|
||||
rename -- ".1" "-$_jname.1" man/{,ja_JP.eucJP/}man1/*
|
||||
|
||||
# Fix .desktop paths
|
||||
sed -e "s,Exec=,&$_jvmdir/jre/bin/," \
|
||||
-e "s/\.png/-$_jname/" \
|
||||
-i jre/lib/desktop/applications/*
|
||||
|
||||
msg2 "Removing redundancies"
|
||||
rm -r db/ jre/lib/fontconfig.*.{bfc,properties.src} jre/plugin/ jre/{COPYRIGHT,LICENSE,README,*.txt} lib/visualvm/ man/ja
|
||||
|
||||
msg2 "Moving stuff in place"
|
||||
# .desktops + icons
|
||||
mv jre/lib/desktop/* "$pkgdir"/usr/share/
|
||||
install -m644 "$srcdir"/*.desktop "$pkgdir"/usr/share/applications/
|
||||
|
||||
# Move/link configs: /usr/lib/jvm/java-$_jname/jre/lib -> /etc
|
||||
for new_etc in ${backup[@]}; do
|
||||
old_usr=jre/lib/${new_etc#*$_jname/}
|
||||
install -Dm644 $old_usr "$pkgdir"/$new_etc
|
||||
ln -sf /$new_etc $old_usr
|
||||
done
|
||||
|
||||
# Man pages
|
||||
mv man/ja_JP.eucJP/ man/ja/
|
||||
mv man/ "$pkgdir"/usr/share/
|
||||
|
||||
# Licenses
|
||||
mv COPYRIGHT LICENSE *.txt "$pkgdir"/usr/share/licenses/java$_major-$_pkgname/
|
||||
ln -sf /usr/share/licenses/java$_major-$pkgname/ "$pkgdir"/usr/share/licenses/$pkgname
|
||||
|
||||
# Java Cryptography Extension (JCE) Unlimited Strength files
|
||||
rename -- ".jar" "-limited.jar" jre/lib/security/*
|
||||
install -Dm644 "$srcdir"/jce/* jre/lib/security/
|
||||
|
||||
# Do the move
|
||||
mv * "$pkgdir"/$_jvmdir
|
||||
|
||||
msg2 "Enabling copy+paste in unsigned applets"
|
||||
# Copy/paste from system clipboard to unsigned Java applets has been disabled since 6u24:
|
||||
# - https://blogs.oracle.com/kyle/entry/copy_and_paste_in_java
|
||||
# - http://slightlyrandombrokenthoughts.blogspot.com/2011/03/oracle-java-applet-clipboard-injection.html
|
||||
_line=$(awk '/permission/{a=NR}; END{print a}' "$pkgdir"/etc/java-$_jname/security/java.policy)
|
||||
sed "$_line a\\\\n \
|
||||
// (AUR) Allow unsigned applets to read system clipboard, see:\n \
|
||||
// - https://blogs.oracle.com/kyle/entry/copy_and_paste_in_java\n \
|
||||
// - http://slightlyrandombrokenthoughts.blogspot.com/2011/03/oracle-java-applet-clipboard-injection.html\n \
|
||||
permission java.awt.AWTPermission \"accessClipboard\";" \
|
||||
-i "$pkgdir"/etc/java-$_jname/security/java.policy
|
||||
}
|
7
src/jdk6/javaws-launcher
Executable file
7
src/jdk6/javaws-launcher
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$@" ]; then
|
||||
exec javaws -viewer
|
||||
else
|
||||
exec javaws "$@"
|
||||
fi
|
8
src/jdk6/jconsole-jdk6.desktop
Executable file
8
src/jdk6/jconsole-jdk6.desktop
Executable file
@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Exec=/usr/lib/jvm/java-6-jdk/bin/jconsole
|
||||
Icon=sun-java-jdk6
|
||||
Name=Java 6 Monitoring and Management Console
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Development;Java;
|
83
src/jdk6/jdk6.install
Executable file
83
src/jdk6/jdk6.install
Executable file
@ -0,0 +1,83 @@
|
||||
THIS_JDK='java-6-jdk'
|
||||
NAME='JDK'
|
||||
|
||||
note() {
|
||||
printf "${blue}::${yellow} archlinux-java:${bold} $1${all_off}\n"
|
||||
}
|
||||
|
||||
all_off="$(tput sgr0)"
|
||||
bold="${all_off}$(tput bold)"
|
||||
blue="${bold}$(tput setaf 4)"
|
||||
yellow="${bold}$(tput setaf 3)"
|
||||
|
||||
update_desktop() {
|
||||
update-desktop-database -q
|
||||
update-mime-database /usr/share/mime >/dev/null
|
||||
xdg-icon-resource forceupdate &>/dev/null
|
||||
xdg-icon-resource forceupdate --theme HighContrast &>/dev/null
|
||||
xdg-icon-resource forceupdate --theme HighContrastInverse &>/dev/null
|
||||
xdg-icon-resource forceupdate --theme LowContrast &>/dev/null
|
||||
}
|
||||
|
||||
fix_default() {
|
||||
if [[ -x /usr/bin/java ]]; then
|
||||
archlinux-java get
|
||||
else
|
||||
archlinux-java unset
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
default=$(fix_default)
|
||||
case ${default} in
|
||||
"")
|
||||
archlinux-java set ${THIS_JDK}
|
||||
note "${NAME} ('${THIS_JDK}') set as default Java environment."
|
||||
;;
|
||||
${THIS_JDK})
|
||||
# Nothing
|
||||
note "${NAME} ('${THIS_JDK}') set as default Java environment."
|
||||
;;
|
||||
*)
|
||||
note "Default Java environment already set to '${default}'.
|
||||
To use ${NAME} ('${THIS_JDK}'), run:
|
||||
# archlinux-java set ${THIS_JDK}
|
||||
For status, use:
|
||||
$ archlinux-java status"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ! -f /etc/ssl/certs/java/cacerts ]]; then
|
||||
init-jks-keystore
|
||||
fi
|
||||
|
||||
update_desktop
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
default=$(fix_default)
|
||||
if [[ ${default} = ${THIS_JDK} ]]; then
|
||||
archlinux-java unset
|
||||
fi
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
default=$(fix_default) # reassign
|
||||
if [[ ${default} ]]; then
|
||||
note "Default Java environment is '${default}'."
|
||||
else
|
||||
archlinux-java fix
|
||||
default=$(fix_default) # re-reassign
|
||||
if [[ ${default} ]]; then
|
||||
note "Default Java environment left as '${default}'."
|
||||
else
|
||||
note "Java environment unset."
|
||||
fi
|
||||
fi
|
||||
|
||||
update_desktop
|
||||
}
|
8
src/jdk6/jmc-jdk6.desktop
Executable file
8
src/jdk6/jmc-jdk6.desktop
Executable file
@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Exec=/usr/lib/jvm/java-6-jdk/bin/jmc
|
||||
Icon=sun-java-jdk6
|
||||
Name=Java 6 Mission Control
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Development;Java;
|
9
src/jdk6/jvisualvm-jdk6.desktop
Executable file
9
src/jdk6/jvisualvm-jdk6.desktop
Executable file
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Exec=/usr/lib/jvm/java-6-jdk/bin/jvisualvm
|
||||
GenericName=Java 6 Monitoring and Performance Monitoring Tool
|
||||
Icon=sun-java-jdk6
|
||||
Name=Java 6 VisualVM
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Development;Java;
|
8
src/jdk6/policytool-jdk6.desktop
Executable file
8
src/jdk6/policytool-jdk6.desktop
Executable file
@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Exec=/usr/lib/jvm/java-6-jdk/jre/bin/policytool
|
||||
Icon=sun-java-jdk6
|
||||
Name=Java 6 Policy Settings
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Settings;Java;
|
Loading…
Reference in New Issue
Block a user