diff options
-rw-r--r-- | pcr/java-commons-cli/PKGBUILD | 56 |
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 |