summaryrefslogtreecommitdiff
path: root/java/java-commons-bsf2/PKGBUILD
blob: 57a9dfc1a0cf924a25f02dd95d4ed8bf6e540a8e (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
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

pkgname=java-commons-bsf2
pkgver=2.4.0
url="https://commons.apache.org/proper/commons-bsf/"
license=('Apache')
pkgdesc="Bean Scripting Framework"

pkgrel=1
arch=('any')
depends=('java-commons-logging')
makedepends=('apache-ant')

_mirror=http://archive.apache.org/dist
source=($_mirror/commons/bsf/source/bsf-src-$pkgver.tar.gz
  build-properties.xml::"https://svn.apache.org/viewvc/commons/proper/bsf/tags/bsf-2.4.0/build-properties.xml?view=co&content-type=text%2Fplain"
)

declare -A _opts
#_opts[jacl]="/usr/share/java/jacl.jar"
_opts[jython]="/opt/jython/jython.jar"
#_opts[nexrexx]="/usr/share/java/nexrexx.jar"
_opts[java-rhino]="/usr/share/java/js.jar"
_opts[xalan-java]="/usr/share/java/xalan.jar"
_opts[junit]="/usr/share/java/junit.jar"

for pkg in "${!_opts[@]}"; do
  optdepends+=("$pkg")
  makedepends+=("$pkg")
  _jars+="${_opts[$pkg]} "
done

prepare() {
  cd "${srcdir}/bsf-${pkgver}"
  rm lib/*.jar
}

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

  for jar in $_jars; do
	  ln -s "$jar" lib/
  done

  # Adjust it to work with jython 2.5+
  sed -i 's/PyJavaInstance/PyJavaType/g' src/org/apache/bsf/engines/jython/*

  ln -sf ../build-properties.xml ./
  ant jar
}

package() {
  cd "${srcdir}/bsf-${pkgver}"
  install -Dm644 build/lib/bsf.jar "$pkgdir"/usr/share/java/bsf-$pkgver.jar
  ln -s bsf-$pkgver.jar "$pkgdir"/usr/share/java/bsf2.jar
}

md5sums=('7e58b2a009c0f70ab36bbef420b25c07'
         'd7180c2b95f1a5424f785a2482260eaa')