summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDet2018-03-25 18:48:39 +0300
committerDet2018-03-25 18:48:39 +0300
commit0e3ebe95c8be5b3debd63271b61d0df7afd0726d (patch)
tree79da921bc7a7fcbc492906780159ff3c1002cdba /PKGBUILD
parent27967a4cf2555aa2f4ea00d9872a3c87173e3803 (diff)
downloadaur-0e3ebe95c8be5b3debd63271b61d0df7afd0726d.tar.gz
Cosmetics & future major-update automatizations
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD195
1 files changed, 89 insertions, 106 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 875aae95198..d475133670b 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 Development Kit"
arch=('x86_64')
@@ -16,126 +17,108 @@ 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-environment=$_major"
"java-runtime-jre=$_major" "java-runtime-headless-jre=$_major" "java-web-start-jre=$_major" "java-environment-jdk=$_major"
- "java-openjfx=$_major")
-conflicts=("java-runtime-jre=$_major" "java-environment-jdk=$_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
-
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")
options=('!strip') # JDK debug-symbols
install=$pkgname.install
source=("http://download.oracle.com/otn-pub/java/jdk/${pkgver}+${_build}/${_hash}/${pkgname}-${pkgver}_linux-x64_bin.tar.gz"
- "jconsole-$_jname.desktop"
- "jmc-$_jname.desktop"
- "policytool-$_jname.desktop")
+ "jconsole.desktop"
+ "jmc.desktop"
+ "policytool.desktop")
sha256sums=('ac487a2738d3d59f7a4b95095207970b811143068752b6b4ec404d5a3aa8680c'
- '5ddf1c0da441d095fce41cef7acfbff7c82d89da1b62aa57adcaeab544fb31de'
- 'ea8dda965af272a95e9559c54332752bd686276216244c44267717df1483e0b1'
- '32b7791d31bafbba38f9637e7541c43f419bf6650504ee41a3c04ec632245f11')
+ '3ea717825268a66837380c9ca2b076f02a3298d2df48c3450152fdaf1d0dbc6e'
+ '365b33b197e6be65ad746e5ed864428e45ae1e24dba53aa7d9c71de0644cf4e2'
+ '5dfde6ee531056571d9601d47fbb4a3e56062e4d611667a56ba7931ec7948b36')
+
+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/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
-
- # Create a placeholder 'jre' link
- ln -s . jre
-
- 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/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..."
+ # Create a placeholder 'jre' link
+ ln -s . jre
+
+ # 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
}