summaryrefslogtreecommitdiff
path: root/pcr/java-commons-cli/PKGBUILD
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2016-03-05 17:39:13 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2016-03-05 17:39:13 -0500
commit04f7aa23b718f50aeac285acee7e19f280303254 (patch)
tree5fd1fa1e4e6279f237d9541ca8fe0107c26727bf /pcr/java-commons-cli/PKGBUILD
parent78bbb1163b242cbd7d048fa7c7d6ffde02437ba7 (diff)
java-commons-cli: add new package to [pcr]
Diffstat (limited to 'pcr/java-commons-cli/PKGBUILD')
-rw-r--r--pcr/java-commons-cli/PKGBUILD56
1 files changed, 56 insertions, 0 deletions
diff --git a/pcr/java-commons-cli/PKGBUILD b/pcr/java-commons-cli/PKGBUILD
new file mode 100644
index 000000000..247f79f0e
--- /dev/null
+++ b/pcr/java-commons-cli/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_pkgname=commons-cli
+pkgname=java-${_pkgname}
+pkgver=1.3.1
+pkgrel=1
+pkgdesc="Java API for parsing command line options passed to programs"
+arch=('any')
+url="http://commons.apache.org/cli/"
+license=('APACHE')
+depends=('java-runtime')
+makedepends=('java-environment' 'jh' 'junit')
+source=("https://archive.apache.org/dist/commons/cli/source/${_pkgname}-${pkgver}-src.tar.gz")
+sha256sums=('d4f7eedf6def7cd574ff9b0050a5a7203a702ed13c88d9fbb85b84284ab172ba')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}-src"
+ mkdir -p build/classes
+ mkdir -p build/test-classes
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}-src"
+
+ javac -d "build/classes" \
+ $(find "src/main/java" -name \*.java)
+ javadoc -d "build/javadoc" \
+ -sourcepath "src/main/java" -subpackages org
+
+ CLASSPATH="build/classes:/usr/share/java/junit.jar"
+ javac -classpath $CLASSPATH -d "build/test-classes" \
+ $(find "src/test/java" -name \*.java)
+
+ jar -cvf "${_pkgname}.jar" -C "build/classes" .
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}-src"
+
+ # Install license file
+ install -Dm644 LICENSE.txt "${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 ${_pkgname} ${_pkgname} ${pkgver} \
+ "${srcdir}/${_pkgname}-${pkgver}-src/pom.xml" \
+ "${_pkgname}.jar" \
+ "${_pkgname}-${pkgver}.jar"
+
+ ln -s "/usr/share/java/${_pkgname}-${pkgver}.jar" \
+ "${pkgdir}/usr/share/java/${_pkgname}.jar"
+} \ No newline at end of file