archrelease: copy trunk to community-any
[arch-community.git] / opensearch-ml-commons-plugin / trunk / PKGBUILD
blob7982831fbbb449dd1a8403903b44a3decfa4d1e1
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
3 pkgname=opensearch-ml-commons-plugin
4 pkgver=2.6.0.0
5 pkgrel=1
6 _opensearchver=2.6.0
7 _jdkver=11
8 pkgdesc="OpenSearch Machine Learning Commons Plugin"
9 arch=('x86_64')
10 url="https://opensearch.org/docs/latest/ml-commons-plugin/index/"
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/ml-commons/archive/${pkgver}.tar.gz"
17 sha256sums=('277ae1816a729811a1b1fd31aa29b0a73b3112e29cb8dd649aa2c5ac3b550a8b')
19 build() {
20   cd "ml-commons-${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   ./gradlew build \
25     --exclude-task ":opensearch-ml-algorithms:jacocoTestReport" \
26     --exclude-task ":opensearch-ml-algorithms:jacocoTestCoverageVerification" \
27     --exclude-task ":opensearch-ml-common:jacocoTestReport" \
28     --exclude-task ":opensearch-ml-common:jacocoTestCoverageVerification" \
29     --exclude-task ":opensearch-ml-client:jacocoTestReport" \
30     --exclude-task ":opensearch-ml-client:jacocoTestCoverageVerification"
33 package() {
34   install -dm755 "${pkgdir}/usr/share/opensearch/plugins/opensearch-ml"
35   cd "${pkgdir}/usr/share/opensearch/plugins/opensearch-ml"
36   unzip "${srcdir}/ml-commons-${pkgver}/plugin/build/distributions/opensearch-ml-${pkgver}.zip"
38   install -Dm644 "${srcdir}/ml-commons-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"