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