summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 072ce758a6e27f107658dd587b1317b63f06c3ce (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
# Maintainer: WorMzy Tykashi <wormzy.tykashi@gmail.com>
# Contributor: kalenz <https://aur.archlinux.org/account/kalenz>
# Contributor: Vojtech Horky <vojta . horky at-symbol seznam . cz>
pkgname=opengrok
pkgver=1.13.24
pkgrel=1
pkgdesc="A fast and usable source code search and cross reference engine, written in Java"
url="https://oracle.github.io/opengrok/"
arch=('any')
license=('CDDL-1.0')
depends=('tomcat10' 'sh' 'java-runtime>=11' 'java-runtime<=21' 'ctags' 'unzip')
makedepends=('apache-ant' 'java-runtime-openjdk' 'git' 'maven' 'python')
source=(git+"https://github.com/oracle/${pkgname}.git#tag=${pkgver}")
install=opengrok.install
sha1sums=('0deae49932b2b0c5631bc7c5d2d2370f3e18943a')

prepare() {
  # Supress deprecated warnings (issue reported at https://github.com/oracle/opengrok/issues/4312 )
  sed -i '/Werror/d' ${pkgname}/pom.xml
}

build() {
  cd ${pkgname}
  mvn compile

  # The following fails if tests are run, but upstream disable tests for their
  # automated builds, so we do the same and assume it's fine
  mvn -DskipTests=true package
}

package() {
  # make destination for most stuff
  install -dm755 "${pkgdir}/usr/share/java/${pkgname}"

  # extract distribution archive into destination (use --no-same-owner to change owner to root instead of builduser)
  bsdtar xf "${pkgname}/distribution/target/${pkgname}-${pkgver}.tar.gz" -C "${pkgdir}/usr/share/java/${pkgname}" -s "/${pkgname}-${pkgver}//" --no-same-owner

  # link licenses to /usr/share/licenses
  install -dm755 "${pkgdir}/usr/share/licenses"
  ln -s /usr/share/java/${pkgname}/doc "${pkgdir}/usr/share/licenses/${pkgname}"
}