summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fb17a6eff2f7af1164ee54cb46c77c9c6aeb0715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: D. Can Celasun <dcelasun[at]dcc[dot]im>
# Contributor: Daniel Bermond <dbermond@archlinux.org>
# Contributor: Det <nimetonmaili g-mail>

pkgname=jre14
pkgver=14.0.2
_majver="${pkgver%%.*}"
pkgrel=2
pkgdesc='Oracle Java 14 Runtime Environment'
arch=('x86_64')
url='https://www.oracle.com/java/'
license=('custom')
depends=('java-runtime-common' 'ca-certificates-utils' 'freetype2' 'libxtst'
         'libxrender' 'libnet')
optdepends=('alsa-lib: for basic sound support')
provides=("java-runtime=${_majver}" "java-runtime-headless=${_majver}"
          "java-runtime-jre=${_majver}" "java-runtime-headless-jre=${_majver}")
backup=("etc/java${_majver}-${pkgname}/management/jmxremote.access"
        "etc/java${_majver}-${pkgname}/management/jmxremote.password.template"
        "etc/java${_majver}-${pkgname}/management/management.properties"
        "etc/java${_majver}-${pkgname}/security/policy/limited/default_US_export.policy"
        "etc/java${_majver}-${pkgname}/security/policy/limited/default_local.policy"
        "etc/java${_majver}-${pkgname}/security/policy/limited/exempt_local.policy"
        "etc/java${_majver}-${pkgname}/security/policy/unlimited/default_US_export.policy"
        "etc/java${_majver}-${pkgname}/security/policy/unlimited/default_local.policy"
        "etc/java${_majver}-${pkgname}/security/policy/README.txt"
        "etc/java${_majver}-${pkgname}/security/java.policy"
        "etc/java${_majver}-${pkgname}/security/java.security"
        "etc/java${_majver}-${pkgname}/logging.properties"
        "etc/java${_majver}-${pkgname}/net.properties"
        "etc/java${_majver}-${pkgname}/sound.properties")
install="${pkgname}.install"
source=("local://jdk-${pkgver}_linux-x64_bin.tar.gz")
sha256sums=('cb811a86926cc0f529d16bec7bd2e25fb73e75125bbd1775cdb9a96998593dde')

package() {
    cd "jdk-${pkgver}"
    
    local _jvmdir="/usr/lib/jvm/java-${_majver}-jdk"
    
    install -d -m755 "${pkgdir}/etc"
    install -d -m755 "${pkgdir}/${_jvmdir}"
    install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}"
    
    # conf
    cp -a conf "${pkgdir}/etc/java${_majver}-${pkgname}"
    ln -s "../../../../etc/java${_majver}-${pkgname}" "${pkgdir}/${_jvmdir}/conf"
    
    # bin
    install -D -m755 bin/{java,jjs,jpackage,jrunscript} -t "${pkgdir}/${_jvmdir}/bin"
    install -D -m755 bin/{keytool,rmid,rmiregistry}     -t "${pkgdir}/${_jvmdir}/bin"
    
    # libs
    cp -a lib "${pkgdir}/${_jvmdir}"
    rm -r "${pkgdir}/${_jvmdir}/lib/jfr"
    rm "${pkgdir}/${_jvmdir}/lib/"{ct.sym,libattach.so,libsaproc.so,src.zip}
    
    # man pages
    local _file
    for _file in man/man1/{java,jjs,jpackage,jrunscript,keytool,rmid,rmiregistry}.1
    do
        install -D -m644 "$_file" "${pkgdir}/usr/share/${_file%.1}-jdk${_majver}.1"
    done
    
    install -D -m644 release -t "${pkgdir}/${_jvmdir}"
    
    # replace JKS keystore with ca-certificates-utils
    rm "${pkgdir}${_jvmdir}/lib/security/cacerts"
    ln -s /etc/ssl/certs/java/cacerts "${pkgdir}${_jvmdir}/lib/security/cacerts"
    
    # legal/licenses
    cp -a legal/* "${pkgdir}/usr/share/licenses/${pkgname}"
    ln -s "$pkgname" "${pkgdir}/usr/share/licenses/java${_majver}-${pkgname}"
    ln -s "../../../share/licenses/${pkgname}" "${pkgdir}/${_jvmdir}/legal"
}