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

_pkgname=javax.inject
pkgname=java-atinject
pkgver=1
pkgrel=1
pkgdesc="Java API for JSR-330 Dependency Injection"
arch=('any')
url="https://code.google.com/p/atinject/"
license=('APACHE')
depends=('java-runtime')
makedepends=('java-environment' 'jh' 'junit' 'subversion')
source=("${pkgname}-${pkgver}::svn+https://atinject.googlecode.com/svn/tags/${pkgver}/"
        "https://repo1.maven.org/maven2/javax/inject/${_pkgname}-tck/${pkgver}/${_pkgname}-tck-${pkgver}.pom")
md5sums=('SKIP'
         '4895a3d4064b3197f2f8c1aa65bae3c3')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  rm -rv lib
  rm -v "atinject."{iml,ipr}
  rm -v build.sh
  rm -v tck/tck.iml
  mkdir -p build/classes
  mkdir -p build/tck/classes
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  CLASSPATH="build/classes:/usr/share/java/junit.jar"
  javac -d build/classes $(find src -name \*.java)
  javac -classpath $CLASSPATH -d build/tck/classes $(find tck -name \*.java)
  javadoc -classpath $CLASSPATH -sourcepath "src:tck" -d build/javadoc \
    javax.inject org.atinject.tck org.atinject.tck.auto org.atinject.tck.auto.accessories

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

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # 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 ${_pkgname} ${_pkgname} ${pkgver} \
    "${srcdir}/${pkgname}-${pkgver}/pom.xml" \
    "${srcdir}/${pkgname}-${pkgver}/${_pkgname}.jar" \
    "${_pkgname}.jar"
  jh mvn-install ${_pkgname} "${_pkgname}-tck" ${pkgver} \
    "${srcdir}/${_pkgname}-tck-${pkgver}.pom" \
    "${srcdir}/${pkgname}-${pkgver}/${_pkgname}-tck.jar" \
    "${_pkgname}-tck.jar"
  ln -s "/usr/share/java/${_pkgname}.jar" \
    "${pkgdir}/usr/share/java/${_pkgname}-${pkgver}.jar"
  ln -s "/usr/share/java/${_pkgname}-tck.jar" \
    "${pkgdir}/usr/share/java/${_pkgname}-tck-${pkgver}.jar"
}