summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevku2015-06-16 20:47:46 +0300
committerkevku2015-06-16 20:47:46 +0300
commit56dee08948f7f8210748ff2455452531ad7ce261 (patch)
tree619e1f0ba7d6f00775de2aaad58abaa0b1a103bf
downloadaur-56dee08948f7f8210748ff2455452531ad7ce261.tar.gz
Initial import
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD30
-rw-r--r--install_java_jce_ustrength111
-rw-r--r--java-jce_ustrength.install22
4 files changed, 179 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..be5b70c265a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = java-jce_ustrength
+ pkgdesc = Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8
+ pkgver = 8
+ pkgrel = 2
+ url = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
+ install = java-jce_ustrength.install
+ arch = any
+ license = custom
+ depends = java-runtime>=8
+ source = http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip
+ source = install_java_jce_ustrength
+ sha256sums = f3020a3922efd6626c2fff45695d527f34a8020e938a49292561f18ad1320b59
+ sha256sums = 3c7cc3b3aa0d748ce540ef4b679a1e01e3609144d3ca37ec9885d05d44d4c467
+
+pkgname = java-jce_ustrength
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..f073ac9f4b6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,30 @@
+# Maintainer: kevku <kevku@gmx.com>
+# Contributor: Cedric Sougne <cedric@sougne.name>
+# Contributor: Tom < reztho at archlinux dot us >
+pkgname=java-jce_ustrength
+pkgver=8
+pkgrel=2
+pkgdesc="Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8"
+arch=('any')
+url="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"
+license=('custom')
+install=${pkgname}.install
+depends=('java-runtime>=8')
+source=('http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip' 'install_java_jce_ustrength')
+DLAGENTS=('http::/usr/bin/curl -LC - -b oraclelicense=a -O')
+sha256sums=('f3020a3922efd6626c2fff45695d527f34a8020e938a49292561f18ad1320b59'
+ '3c7cc3b3aa0d748ce540ef4b679a1e01e3609144d3ca37ec9885d05d44d4c467')
+
+package() {
+ cd "$srcdir/UnlimitedJCEPolicyJDK8"
+ # Fixed place for the jce_policy files
+ install -Dm644 US_export_policy.jar "${pkgdir}/usr/share/java/java-jce_ustrength/US_export_policy.jar"
+ install -Dm644 local_policy.jar "${pkgdir}/usr/share/java/java-jce_ustrength/local_policy.jar"
+
+ # Installing the script
+ install -Dm755 "${srcdir}/install_java_jce_ustrength" "${pkgdir}/usr/bin/install_java_jce_ustrength"
+
+ # The documentation
+ install -Dm644 README.txt "${pkgdir}/usr/share/doc/java-jce_ustrength/README.txt"
+}
+
diff --git a/install_java_jce_ustrength b/install_java_jce_ustrength
new file mode 100644
index 00000000000..497278b41e1
--- /dev/null
+++ b/install_java_jce_ustrength
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+# The affected files:
+# dabfcb23d7bf9bf5a201c3f6ea9bfb2c local_policy.jar
+# ef6e8eae7d1876d7f05d765d2c2e0529 US_export_policy.jar
+
+# Internal variables
+md5_this_localpolicy=dabfcb23d7bf9bf5a201c3f6ea9bfb2c
+md5_this_uspolicy=ef6e8eae7d1876d7f05d765d2c2e0529
+jcedir=/usr/share/java/java-jce_ustrength
+jresecuritydir=/usr/lib/jvm/default-runtime/lib/security
+_ext=java-jce_ustrength.backup
+
+# 1 = Root
+# 0 = other ID
+check_root(){
+ if [ ${UID} -eq 0 ]; then
+ return 1
+ fi
+ return 0
+}
+
+# 0 = Unlimited Strength JCE Policy already installed
+# 1 = Original JCE Policy installed
+# 2 = Destination files don't exist
+check_destinationfiles(){
+ if [ ! -e "${jresecuritydir}/US_export_policy.jar" -o ! -e "${jresecuritydir}/local_policy.jar" ];
+ then
+ return 2
+ fi
+ md5_uspolicy=$(md5sum ${jresecuritydir}/US_export_policy.jar | cut -d " " -f 1)
+ md5_localpolicy=$(md5sum ${jresecuritydir}/local_policy.jar | cut -d " " -f 1)
+ if [ "${md5_uspolicy}" == "${md5_this_uspolicy}" -a \
+ "${md5_localpolicy}" == "${md5_this_localpolicy}" ]; then
+ return 0
+ fi
+ return 1
+}
+
+install(){
+ check_destinationfiles
+ not_installed=$?
+ if [ "${not_installed}" -eq "1" ]; then
+ check_root
+ isroot=$?
+ if [ "${isroot}" -eq "0" ]; then
+ echo "You must be root for doing this operation."
+ exit 1
+ fi
+ echo -n "Installing Unlimited Strength JCE files..."
+ cp ${jresecuritydir}/US_export_policy.jar ${jresecuritydir}/US_export_policy.jar.${_ext} || return 1
+ cp ${jresecuritydir}/local_policy.jar ${jresecuritydir}/local_policy.jar.${_ext} || return 1
+ cp ${jcedir}/US_export_policy.jar ${jresecuritydir}/ || return 1
+ cp ${jcedir}/local_policy.jar ${jresecuritydir}/ || return 1
+ echo " installed."
+ else
+ echo "Unlimited Strength JCE files already installed."
+ fi
+}
+
+uninstall(){
+ check_destinationfiles
+ not_installed=$?
+ if [ "$not_installed" -eq "0" ]; then
+ check_root
+ isroot=$?
+ if [ "${isroot}" -eq "0" ]; then
+ echo "You must be root for doing this operation."
+ exit 0
+ fi
+ echo -n "Uninstalling Unlimited Strength JCE files..."
+ if [ ! -e "${jresecuritydir}/US_export_policy.jar.${_ext}" -a \
+ ! -e "${jresecuritydir}/local_policy.jar.${_ext}" ]; then
+ echo "Previous backup of the files doesn't exist!"
+ echo "For uninstall, reinstall the jre package."
+ exit 0
+ fi
+
+ mv ${jresecuritydir}/US_export_policy.jar.${_ext} ${jresecuritydir}/US_export_policy.jar || return 1
+ mv ${jresecuritydir}/local_policy.jar.${_ext} ${jresecuritydir}/local_policy.jar || return 1
+ echo " uninstalled."
+ else
+ if [ -e "${jresecuritydir}/US_export_policy.jar.${_ext}" -a \
+ -e "${jresecuritydir}/local_policy.jar.${_ext}" ]; then
+ check_root
+ isroot=$?
+ if [ "${isroot}" -eq "0" ]; then
+ echo "You must be root for doing this operation."
+ exit 1
+ fi
+ echo -n "Deleting old regular JCE files backup..."
+ rm ${jresecuritydir}/US_export_policy.jar.${_ext} || return 1
+ rm ${jresecuritydir}/local_policy.jar.${_ext} || return 1
+ echo " deleted."
+ fi
+
+ if [ "${not_installed}" -eq "1" ]; then
+ echo "Regular JCE files already installed."
+ fi
+ fi
+}
+
+case "$1" in
+ install) install
+ ;;
+ uninstall) uninstall
+ ;;
+ *) echo "Usage $0: {install|uninstall}"
+ ;;
+esac
+exit 0
diff --git a/java-jce_ustrength.install b/java-jce_ustrength.install
new file mode 100644
index 00000000000..bcb4727ee99
--- /dev/null
+++ b/java-jce_ustrength.install
@@ -0,0 +1,22 @@
+post_install() {
+ /usr/sbin/install_java_jce_ustrength install
+ echo "===> Everytime jre is updated, you must run:"
+ echo "===> /usr/bin/install_java_jce_ustrength install"
+ echo "===> Otherwise, the programs which need this package will break."
+}
+
+pre_upgrade() {
+ /usr/bin/install_java_jce_ustrength uninstall
+}
+
+post_upgrade() {
+ /usr/bin/install_java_jce_ustrength install
+}
+
+pre_remove() {
+ /usr/bin/install_java_jce_ustrength uninstall
+}
+
+op=$1
+shift
+$op $*