summaryrefslogtreecommitdiff
path: root/pcr/java-cup/PKGBUILD
blob: 97b41e20b2feeeb8f17957ddfc76188b18fddfa5 (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
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

pkgname=java-cup
_pkgver=0.10k
pkgver=0.10.k
pkgdesc="LALR parser generator for Java"
url=http://www2.cs.tum.edu/projects/cup/
license=('custom:MIT')

pkgrel=1
arch=('any')
depends=('java-environment')

source=(http://www2.cs.tum.edu/projects/cup/java_cup_v${_pkgver#*.}.tar.gz java-cup.sh)
md5sums=('8b11edfec13c590ea443d0f0ae0da479'
         '2ec9859574d479ee27c71e8b7f978eea')

prepare() {
 cd "$srcdir"
 find . -name '*.class' -delete
}

build() {
  cd "$srcdir"
  mkdir classes
  find java_cup -name '*.java' -exec javac -d classes {} +
  jar cfe java_cup.jar java_cup.Main -C classes .
}

package() {
  cd "$srcdir"

  install -Dm644 java_cup.jar   "$pkgdir"/usr/share/java/java_cup-${_pkgver}.jar
  ln -s java_cup-${_pkgver}.jar "$pkgdir"/usr/share/java/java_cup.jar

  install -Dm755 java-cup.sh "$pkgdir"/usr/bin/java-cup
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

  install -d "$pkgdir"/usr/share/doc/$pkgname
  install -m644 manual.html cup_logo.gif -t "$pkgdir"/usr/share/doc/$pkgname
}