updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / java-jce_ustrength7 / PKGBUILD
blob863eeb9e4e1ea91d6518c9f4fa9b3e7955034bfe
1 # Maintainer: Cedric Sougne <cedric@sougne.name>
2 # Contributor: Tom < reztho at archlinux dot us >
3 pkgname=java-jce_ustrength7
4 pkgver=7
5 pkgrel=1
6 pkgdesc="Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7"
7 arch=('any')
8 url="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"
9 license=('custom')
10 depends=('jre')
11 install=${pkgname}.install
12 source=('http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip' 'install_java_jce_ustrength')
13 _zipfile="UnlimitedJCEPolicyJDK${pkgver}.zip"
15 build() {
16         # Oracle doesn't give us a direct download for jce_policy-6.zip
17         # So the user must download it manually...
18         if [ ! -e "$(dirname ${srcdir})/${_zipfile}" ]; then
19                 echo 
20                 echo "You need to download this manually from Oracle:"
21                 echo "JCE Unlimited Strength Jurisdiction Policy Files 6 Release Candidate: ${_zipfile}"
22                 echo "and put it in the same directory of this PKGBUILD."
23                 echo
24                 echo "Go to: ${url}"
25                 echo
26                 return 1
27         fi
29     [ ! -e "${srcdir}/${_zipfile}" ] && ln -s $(dirname ${srcdir})/${_zipfile} ${srcdir} &> /dev/null
31         _mdfiveneeded=c47e997b90ddfd0d813a37ccc97fb933
32         _mdfivefile=$(md5sum ${srcdir}/${_zipfile} | cut -d " " -f 1)
33         if [ "${_mdfiveneeded}" != "${_mdfivefile}" ]; then
34                 echo
35                 echo "The MD5SUM of ${_zipfile} isn't correct."
36                 echo "Unfinished download or updated zip file."
37                 echo
38                 return 1
39         fi
41         # Fixed place for the jce_policy files
42         mkdir -p ${pkgdir}/usr/share/java/${pkgname}/
43         cd ${pkgdir}/usr/share/java/${pkgname}/
44         bsdtar -xf ${srcdir}/${_zipfile}
45         mv UnlimitedJCEPolicy/* .
46         rmdir UnlimitedJCEPolicy
47         find ${pkgdir}/usr/share/java/${pkgname}/* -type f -exec chmod 644 {} \;
48         find ${pkgdir}/usr/share/java/${pkgname}/* -type d -exec chmod 755 {} \;
50         # Installing the script
51         mkdir -p ${pkgdir}/sbin/
52         install -m 755 ${srcdir}/install_java_jce_ustrength ${pkgdir}/sbin/
54         # The documentation
55         mkdir -p ${pkgdir}/usr/share/doc/${pkgname}
56         mv ${pkgdir}/usr/share/java/${pkgname}/README.txt ${pkgdir}/usr/share/doc/${pkgname}/
59 md5sums=('c47e997b90ddfd0d813a37ccc97fb933' 'f77ff988319bdbc2407395192fcb2ca0')