summaryrefslogtreecommitdiffstats
path: root/abs/extra/java-common/PKGBUILD
blob: 97f7585dd36fde260be6222133bb0fcd135581cd (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
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
pkgname=('java-runtime-common' 'java-environment-common')
pkgbase=java-common
pkgver=3
pkgrel=1
arch=('any')
url='https://www.archlinux.org/packages/extra/any/java-common/'
license=('GPL')
checkdepends=('wget')
_shunitver=2.1.6
source=(profile_jre.csh
        profile_jre.sh
        bin_archlinux-java
        test_archlinux-java
        shunit2-${_shunitver}.tar.gz::https://github.com/kward/shunit2/archive/source.tar.gz)

sha256sums=('9d25638cafc2fabd1ba6f2f26aa01233eccf3d31db003d956b571f0ab655dd23'
            '519e9881a2a9f4fc3d581ea0ef0da594eedbfdfcf734f9fdc0bb595e8ac77e4c'
            '5101f9d3d42cd545843a537826451c1b2e0bf2b16aba4e36ac797d9ace16dc63'
            '721b225f6eb420f7b173ba2db8c65688f50ffd5dad0960ecce4cfefdb57b26a2'
            '6beca93d20b72b46083c8271c4cf1da21b45f250a92b401c2565c65e1d75138f')

check() {
  cd "${srcdir}"
  ln -s shunit2-source/${_shunitver} shunit2
  ./test_archlinux-java
}

package_java-runtime-common() {
  pkgdesc='Common files for Java Runtime Environments'
  conflicts=('java-common')
  replaces=('java-common')
  backup=(etc/profile.d/jre.sh
          etc/profile.d/jre.csh)
  install=install_java-runtime-common.sh

  cd "${srcdir}"

  install -d -m 755 "${pkgdir}/usr/lib/jvm/"
  ln -s /dev/null "${pkgdir}/usr/lib/jvm/default"
  ln -s /dev/null "${pkgdir}/usr/lib/jvm/default-runtime"

  install -D -m 644 profile_jre.sh  "${pkgdir}/etc/profile.d/jre.sh"
  install -D -m 644 profile_jre.csh "${pkgdir}/etc/profile.d/jre.csh"
  install -D -m 755 bin_archlinux-java "${pkgdir}/usr/bin/archlinux-java"

  install -d -m 755 "${pkgdir}/usr/bin/"
  # Official list of binaries that Java headless runtime packages MUST provide
  # This list is based on Arch Linux' default Java implementation: "OpenJDK 7 Icedtea"
  for b in \
    java keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200;
  do
    ln -s /usr/lib/jvm/default-runtime/bin/${b} "${pkgdir}/usr/bin/${b}"
  done
}

package_java-environment-common() {
  pkgdesc='Common files for Java Development Kits'

  cd "${srcdir}"

  install -d -m 755 "${pkgdir}/usr/bin/"
  # Official list of supplementary binaries that Java environment packages MUST provide
  # This list is based on Arch Linux' default Java implementation: "OpenJDK 7 Icedtea"
  for b in \
    jar jarsigner javac javadoc javah javap jcmd \
    jconsole jdb jinfo jmap jps jstack jstat \
    jstatd rmic schemagen serialver wsgen wsimport xjc;
  do
    ln -s /usr/lib/jvm/default/bin/${b} "${pkgdir}/usr/bin/${b}"
  done
}