archrelease: copy trunk to community-any
[ArchLinux/community.git] / opensearch-anomaly-detection-plugin / trunk / PKGBUILD
blobee5a544d5648e8a3624f5f45ca35383b277fe4f0
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
3 pkgname=opensearch-anomaly-detection-plugin
4 pkgver=2.6.0.0
5 pkgrel=1
6 _opensearchver=2.6.0
7 _jdkver=11
8 pkgdesc="OpenSearch Anomaly Detection Plugin"
9 arch=('x86_64')
10 url="https://opensearch.org/docs/latest/monitoring-plugins/ad"
11 license=('Apache')
12 depends=("opensearch=${_opensearchver}")
13 makedepends=("java-environment=${_jdkver}" 'unzip')
14 source=(
15   "${pkgname}-${pkgver}.tar.gz::https://github.com/opensearch-project/anomaly-detection/archive/${pkgver}.tar.gz"
17 sha256sums=('8719f7a35260ad27991b6df743bfbff318398c87edf7f4a81284e1054ddf4d5d')
19 build() {
20   cd "anomaly-detection-${pkgver}"
21   export JAVA_HOME="/usr/lib/jvm/java-${_jdkver}-openjdk"
22   export PATH="/usr/lib/jvm/java-${_jdkver}-openjdk/bin:$PATH"
23   export GRADLE_OPTS="-Dbuild.snapshot=false -Dopensearch.version=${_opensearchver}"
24   # integTest (Reaper) requires JDK 14
25   ./gradlew assemble \
26     --exclude-task ":integTest" \
27     --exclude-task ":jacocoTestReport"
30 package() {
31   install -dm755 "${pkgdir}/usr/share/opensearch/plugins/opensearch-anomaly-detection"
32   cd "${pkgdir}/usr/share/opensearch/plugins/opensearch-anomaly-detection"
33   unzip "${srcdir}/anomaly-detection-${pkgver}/build/distributions/opensearch-anomaly-detection-${pkgver}.zip"
35   install -Dm644 "${srcdir}/anomaly-detection-${pkgver}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"