summaryrefslogtreecommitdiff
path: root/pcr/osgi-compendium/PKGBUILD
blob: d5c92fa7d0374a96491a8fabd546bb170f70abc6 (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
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_pkgname=osgi.cmpn
pkgname=osgi-compendium
pkgver=6.0.0
pkgrel=2
pkgdesc="Java OSGi API - Compendium module"
arch=('any')
url='https://www.osgi.org/developer/specifications/'
license=('APACHE')
depends=('java-runtime')
makedepends=('java-geronimo-jpa' 'java-environment' 'jh' 'osgi-annotation' 'osgi-core' 'osgi-foundation-ee' 'tomcat8')
source=("https://repo1.maven.org/maven2/org/osgi/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}-sources.jar"
        "https://repo1.maven.org/maven2/org/osgi/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}.pom"
        'osgi-compendium-lookupreference.patch')
sha1sums=('cf4d979984a597753bf7e7df18369ec60f09a7fc'
          '400a960b790469c070650ff36090200b7e0f8c16'
          '8955d96f70bcf16fe75654f652ca0eb803241f06')

prepare() {
  cd ${srcdir}
  mkdir -p build/classes
  patch -Np1 -i "${srcdir}/osgi-compendium-lookupreference.patch"
}

build() {
  cd ${srcdir}
  CLASSPATH="/usr/share/java/ee.foundation.jar:/usr/share/java/geronimo-jpa_2.0_spec.jar"
  CLASSPATH="$CLASSPATH:/usr/share/java/osgi.annotation.jar:/usr/share/java/osgi.core.jar"
  CLASSPATH="$CLASSPATH:/usr/share/java/tomcat8/servlet-api.jar"
  javac -cp $CLASSPATH -d build/classes -encoding UTF-8 \
    $(find . -name \*.java)
  javadoc -classpath $CLASSPATH -d build/javadoc -encoding UTF-8 \
    -sourcepath . -subpackages org

  jar -cvf "${_pkgname}.jar" -C build/classes .
}

package() {
  cd ${srcdir}

  # Install license file
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"

  # Install documentation
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r build/javadoc "${pkgdir}/usr/share/doc/${pkgname}"

  # Install Maven artifacts
  export DESTDIR=${pkgdir}
  jh mvn-install org.osgi ${_pkgname} ${pkgver} \
    "${_pkgname}-${pkgver}.pom" \
    "${_pkgname}.jar" \
    "${_pkgname}-${pkgver}.jar"
  ln -s "/usr/share/java/${_pkgname}-${pkgver}.jar" \
    "${pkgdir}/usr/share/java/${_pkgname}.jar"
}