summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDet2018-03-25 18:49:09 +0300
committerDet2018-03-25 18:49:09 +0300
commita86c8ddba261d7160de976b6529c10e76d4a31d1 (patch)
tree9235299bf431581d5194fc693468a8198351a105
parenta7e52325d341f64307e11d51d0b11f546bb78a47 (diff)
downloadaur-a86c8ddba261d7160de976b6529c10e76d4a31d1.tar.gz
Cosmetics & future major-update automatizations
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD179
-rw-r--r--jre.install5
-rw-r--r--policytool.desktop (renamed from policytool-jre10.desktop)0
4 files changed, 87 insertions, 105 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b5e95c3d0f4..4101228d8cf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -20,20 +20,18 @@ pkgbase = jre
provides = java-runtime-headless-jre=10
provides = java-web-start-jre=10
provides = java-openjfx=10
- conflicts = java-runtime-jre=10
+ provides = jre10
+ conflicts = jre10
backup = etc/java-jre10/management/jmxremote.access
backup = etc/java-jre10/management/management.properties
backup = etc/java-jre10/security/java.policy
backup = etc/java-jre10/security/java.security
backup = etc/java-jre10/security/javaws.policy
- backup = etc/java-jre10/fontconfig.properties.src
backup = etc/java-jre10/logging.properties
backup = etc/java-jre10/net.properties
- backup = etc/java-jre10/psfont.properties.ja
- backup = etc/java-jre10/psfontj2d.properties
backup = etc/java-jre10/sound.properties
source = http://download.oracle.com/otn-pub/java/jdk/10+46/76eac37278c24557a3c4199677f19b62/jre-10_linux-x64_bin.tar.gz
- source = policytool-jre10.desktop
+ source = policytool.desktop
sha256sums = 9c147ae25aceccf5bc2c9a878d0e7e5885b21ffbd861db6f8241d10915e38ab2
sha256sums = 175bf53f43aa42bcf719b9d08d6cbc926fb6e3fbdf2eea7a8090c1750a285a7f
diff --git a/PKGBUILD b/PKGBUILD
index a000cc8aa59..c547bf6849d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,6 +5,7 @@ pkgver=10
_major=${pkgver/.*}
_build=46
_hash=76eac37278c24557a3c4199677f19b62
+_jname=${pkgname}${_major}
pkgrel=1
pkgdesc="Oracle Java Runtime Environment"
arch=('x86_64')
@@ -15,118 +16,100 @@ optdepends=('alsa-lib: for basic sound support'
'gtk2: for Gtk+ look and feel (desktop)')
provides=("java-runtime=$_major" "java-runtime-headless=$_major" "java-web-start=$_major"
"java-runtime-jre=$_major" "java-runtime-headless-jre=$_major" "java-web-start-jre=$_major"
- "java-openjfx=$_major")
-conflicts=("java-runtime-jre=$_major")
-
-# Variables
-DLAGENTS=('http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -b oraclelicense=a -o %o %u')
-_jname=${pkgname}${_major}
+ "java-openjfx=$_major" "$_jname")
+conflicts=("$_jname")
_jvmdir=/usr/lib/jvm/java-$_major-$pkgname/jre
-
backup=("etc/java-$_jname/management/jmxremote.access"
"etc/java-$_jname/management/management.properties"
"etc/java-$_jname/security/java.policy"
"etc/java-$_jname/security/java.security"
"etc/java-$_jname/security/javaws.policy"
- "etc/java-$_jname/fontconfig.properties.src"
"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")
install=$pkgname.install
source=("http://download.oracle.com/otn-pub/java/jdk/${pkgver}+${_build}/${_hash}/${pkgname}-${pkgver}_linux-x64_bin.tar.gz"
- "policytool-$_jname.desktop")
+ "policytool.desktop")
sha256sums=('9c147ae25aceccf5bc2c9a878d0e7e5885b21ffbd861db6f8241d10915e38ab2'
'175bf53f43aa42bcf719b9d08d6cbc926fb6e3fbdf2eea7a8090c1750a285a7f')
+DLAGENTS=('http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -b oraclelicense=a -o %o %u')
+
package() {
- cd $pkgname-$pkgver
-
- msg2 "Creating directory structure..."
- install -d "$pkgdir"/etc/.java/.systemPrefs
- install -d "$pkgdir"/usr/lib/jvm/java-$_major-$pkgname/jre/bin
- install -d "$pkgdir"/usr/lib/mozilla/plugins
- install -d "$pkgdir"/usr/share/licenses/java$_major-$pkgname
-
- msg2 "Removing redundancies..."
- rm -r lib/desktop/icons/HighContrast
- rm -r lib/desktop/icons/HighContrastInverse
- rm -r lib/desktop/icons/LowContrast
- rm lib/fontconfig.*.bfc
- rm lib/fontconfig.*.properties.src
-
- msg2 "Moving contents..."
- mv * "$pkgdir"/$_jvmdir
-
- # Cd to the new playground
- cd "$pkgdir"/$_jvmdir
-
- msg2 "Fixing directory structure..."
- # Suffix .desktops + icon (sun-jcontrol.png -> sun-jcontrol-$_jname.png)
- for i in $(find lib/desktop/ -type f); do
- rename -- "." "-$_jname." $i
- done
-
- # Link missing icons
- for i in $(find lib/desktop/icons/ -name "sun-jcontrol-$_jname.png" -type f); do
- ln -s "sun-jcontrol-$_jname.png" "${i/jcontrol/java}"
- ln -s "sun-jcontrol-$_jname.png" "${i/jcontrol/javaws}"
- done
-
- # Fix .desktop's
- sed -e '/JavaWS/!s|Name=Java|Name=Java '"$_major"'|' \
- -e "s|Name=JavaWS|Name=JavaWS $_major|" \
- -e "s|Comment=Java|Comment=Java $_major|" \
- -e "s|Exec=|Exec=$_jvmdir/bin/|" \
- -e "s|.png|-$_jname.png|" \
- -i lib/desktop/applications/*
-
- # Move .desktops + icons to /usr/share
- mv lib/desktop/* "$pkgdir"/usr/share/
- install -m644 "$srcdir"/*.desktop "$pkgdir"/usr/share/applications/
-
- # Move confs to /etc and link back to /usr: /usr/lib/jvm/java-$_jname/conf -> /etc
- for old_usr_path in $(find conf/ -type f); do
- # New location
- new_etc_path="/etc/java-$_jname/${old_usr_path/conf\/}"
-
- # Move /link
- install -Dm644 "$old_usr_path" "$pkgdir/$new_etc_path"
- ln -sf "$new_etc_path" "$old_usr_path"
- done
-
- # Move confs to /etc and link back to /usr: /usr/lib/jvm/java-$_jname/lib -> /etc
- for new_etc_path in ${backup[@]}; do
- # Old location
- old_usr_path="lib/${new_etc_path#*$_jname/}"
-
- # Move/link
- if [[ -f $old_usr_path ]]; then
- install -Dm644 "$old_usr_path" "$pkgdir/$new_etc_path"
- ln -sf "/$new_etc_path" "$old_usr_path"
- fi
- done
-
- # Link NPAPI plugin
- ln -sf $_jvmdir/lib/libnpjp2.so "$pkgdir"/usr/lib/mozilla/plugins/libnpjp2-$_jname.so
-
- # Replace JKS keystore with 'ca-certificates-java'
- ln -sf /etc/ssl/certs/java/cacerts lib/security/cacerts
-
- # Move/link licenses
- mv legal/ "$pkgdir"/usr/share/licenses/java$_major-$pkgname/
- ln -sf /usr/share/licenses/java$_major-$pkgname/ "$pkgdir"/usr/share/licenses/$pkgname
-
- 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\";" \
+ cd $pkgname-$pkgver
+
+ msg2 "Creating directory structure..."
+ install -d "$pkgdir"/etc/.java/.systemPrefs
+ install -d "$pkgdir"/usr/lib/jvm/java-$_major-$pkgname/jre/bin
+ install -d "$pkgdir"/usr/lib/mozilla/plugins
+ install -d "$pkgdir"/usr/share/licenses/java$_major-$pkgname
+
+ msg2 "Removing redundancies..."
+ rm -r lib/desktop/icons/HighContrast
+ rm -r lib/desktop/icons/HighContrastInverse
+ rm -r lib/desktop/icons/LowContrast
+ rm lib/fontconfig.*.bfc
+ rm lib/fontconfig.*.properties.src
+
+ msg2 "Moving contents..."
+ mv * "$pkgdir"/$_jvmdir
+
+ # Cd to the new playground
+ cd "$pkgdir"/$_jvmdir
+
+ msg2 "Fixing directory structure..."
+ # Fix bundled .desktops
+ sed -e "s|Exec=|Exec=$_jvmdir/bin/|" \
+ -e "s|.png|-$_jname.png|" \
+ -i lib/desktop/applications/*
+
+ # Move .desktops + icons to /usr/share
+ mv lib/desktop/* "$pkgdir"/usr/share/
+ install -m644 "$srcdir"/*.desktop "$pkgdir"/usr/share/applications/
+
+ # Suffix .desktops + icon (sun-jcontrol.png -> sun-jcontrol-$_jname.png)
+ for i in $(find "$pkgdir"/usr/share/ -type f); do
+ rename -- "." "-$_jname." $i
+ done
+
+ # Write versions to .desktops + .install
+ sed -i "s/<version>/$_major/" "$pkgdir"/usr/share/applications/* "$startdir"/$pkgname.install
+
+ # Link missing icons
+ for i in $(find "$pkgdir"/usr/share/icons/ -name "sun-jcontrol-$_jname.png" -type f); do
+ ln -s "sun-jcontrol-$_jname.png" "${i/jcontrol/java}"
+ ln -s "sun-jcontrol-$_jname.png" "${i/jcontrol/javaws}"
+ done
+
+ # Move confs to /etc and link back to /usr: /usr/lib/jvm/java-$_jname/conf -> /etc
+ for sub_path in $(find conf/ -type f); do
+ # New location
+ new_etc_path="/etc/java-$_jname/${sub_path/conf\/}"
+
+ # Move & link
+ install -Dm644 "$sub_path" "$pkgdir/$new_etc_path"
+ ln -sf "$new_etc_path" "$sub_path"
+ done
+
+ # Link NPAPI plugin
+ ln -sf $_jvmdir/lib/libnpjp2.so "$pkgdir"/usr/lib/mozilla/plugins/libnpjp2-$_jname.so
+
+ # Replace JKS keystore with 'ca-certificates-java'
+ ln -sf /etc/ssl/certs/java/cacerts lib/security/cacerts
+
+ # Move & link licenses
+ mv legal/ "$pkgdir"/usr/share/licenses/java$_major-$pkgname/
+ ln -sf /usr/share/licenses/java$_major-$pkgname/ "$pkgdir"/usr/share/licenses/$pkgname
+
+ 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
}
diff --git a/jre.install b/jre.install
index 9fa600120c7..25f98a8d2a2 100644
--- a/jre.install
+++ b/jre.install
@@ -1,4 +1,5 @@
-THIS_JAVA='java-10-jre/jre'
+VERSION='<version>'
+THIS_JAVA='java-${VERSION}-jre/jre'
NAME='JRE'
all_off="$(tput sgr0)"
@@ -39,7 +40,7 @@ post_install() {
note2 "Since Oracle Java 9, some Qt 5 applications (such as the reader apps Zeal and
GoldenDict) will crash due to the existance of the Java NPAPI plugin symlink
- (/usr/lib/mozilla/plugins/libnpjp2-jre10.so).
+ (/usr/lib/mozilla/plugins/libnpjp2-jre${VERSION}.so).
See:
- https://github.com/zealdocs/zeal/issues/802
diff --git a/policytool-jre10.desktop b/policytool.desktop
index 578043c1844..578043c1844 100644
--- a/policytool-jre10.desktop
+++ b/policytool.desktop