summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/apiguardian/PKGBUILD52
1 files changed, 52 insertions, 0 deletions
diff --git a/pcr/apiguardian/PKGBUILD b/pcr/apiguardian/PKGBUILD
new file mode 100644
index 000000000..882b9299f
--- /dev/null
+++ b/pcr/apiguardian/PKGBUILD
@@ -0,0 +1,52 @@
+# Copyright (C) 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the CC0 1.0 License.
+# Maintainers: Parabola hackers <dev@lists.parabola.nu>
+
+pkgname=apiguardian
+pkgver=1.1.2
+pkgrel=1
+pkgdesc='Java library that provides the `@API` annotation'
+arch=('any')
+url='https://apiguardian-team.github.io/apiguardian/docs/current/api/'
+license=('Apache')
+depends=('java-runtime')
+makedepends=('jh')
+source=("https://github.com/${pkgname}-team/${pkgname}/archive/refs/tags/r${pkgver}.tar.gz")
+sha512sums=('7c56ee15e0aba07e95b6f2fe7cedd98e449e774958eb63b2467066c381e1e82ad67c982c2885e18154c62e55fda80a1c2e0f689253afe449db9f7e7563122db6')
+
+build() {
+ cd "${srcdir}/${pkgname}-r${pkgver}"
+
+ mkdir -p build/classes
+ mkdir -p build/javadoc
+
+ javac -d "build/classes" -encoding UTF-8 \
+ "src/main/java/org/${pkgname}/api/API.java"
+
+ javadoc -d build/javadoc/ \
+ -sourcepath src/main/java/ \
+ -encoding UTF-8 \
+ org.apiguardian.api
+
+ jar -cvf "${pkgname}.jar" -C build/classes .
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-r${pkgver}"
+
+ # Install license file
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+
+ # Install documentation
+ install -d "${pkgdir}/usr/share/doc/${pkgname}"
+ cp -r build/javadoc "${pkgdir}/usr/share/doc/${pkgname}"
+
+ # Install Maven artifacts
+ export DESTDIR=${pkgdir}
+ jh mvn-install "org.apiguardian.api" "${pkgname}" ${pkgver} \
+ pom.xml "${pkgname}.jar" "${pkgname}.jar"
+
+ ln -s "/usr/share/java/${_libname}.jar" \
+ "$pkgdir/usr/share/java/${_libname}-$pkgver.jar"
+}