summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/osgi-core/PKGBUILD52
1 files changed, 52 insertions, 0 deletions
diff --git a/pcr/osgi-core/PKGBUILD b/pcr/osgi-core/PKGBUILD
new file mode 100644
index 000000000..3ec5fb8db
--- /dev/null
+++ b/pcr/osgi-core/PKGBUILD
@@ -0,0 +1,52 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_pkgname=osgi.core
+pkgname=osgi-core
+pkgver=6.0.0
+pkgrel=1
+pkgdesc="Java OSGi API - Core module"
+arch=('any')
+url='https://www.osgi.org/developer/specifications/'
+license=('APACHE')
+depends=('java-runtime')
+makedepends=('java-environment' 'jh' 'osgi-annotation')
+source=("https://repo1.maven.org/maven2/org/osgi/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}-sources.jar"
+ "https://repo1.maven.org/maven2/org/osgi/${_pkgname}/${pkgver}/${_pkgname}-${pkgver}.pom")
+sha1sums=('921a11d64e9a5e6fb04f99a006a3b4b9773f44b8'
+ 'a3ad88c11f55bb75d04dc15e66c8a7098561ce4a')
+
+prepare() {
+ cd ${srcdir}
+ mkdir -p build/classes
+}
+
+build() {
+ cd ${srcdir}
+ CLASSPATH="/usr/share/java/osgi.annotation.jar"
+ javac -cp $CLASSPATH -d build/classes -encoding UTF-8 \
+ $(find . -name \*.java)
+ javadoc -classpath $CLASSPATH -d "build/javadoc" -encoding UTF-8 \
+ -sourcepath . -subpackages org
+
+ jar -cvf "${_pkgname}.jar" -C build/classes .
+}
+
+package() {
+ cd ${srcdir}
+
+ # 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.osgi "org.${_pkgname}" ${pkgver} \
+ pom.xml \
+ ${_pkgname}.jar \
+ ${_pkgname}-${pkgver}.jar
+ ln -s "/usr/share/java/${_pkgname}-${pkgver}.jar" \
+ "${pkgdir}/usr/share/java/${_pkgname}.jar"
+}