diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-03-08 22:57:20 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-03-08 22:57:20 -0500 |
commit | 113cfea020cf50d034f7fb492158003a5a0d71e6 (patch) | |
tree | 027d7cf0021c8d031591d7d969e276b3c6fda0ea | |
parent | aa11529067093d4a95c2a8a16861a8d021aa20d4 (diff) |
java-guava: add new package to [pcr]
-rw-r--r-- | pcr/java-guava/PKGBUILD | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pcr/java-guava/PKGBUILD b/pcr/java-guava/PKGBUILD new file mode 100644 index 000000000..90f7aafe7 --- /dev/null +++ b/pcr/java-guava/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> + +_pkgname=guava +pkgname=java-${_pkgname} +pkgver=18.0 +pkgrel=1 +pkgdesc='Suite of Google common libraries for Java' +arch=('any') +url="https://github.com/google/guava" +license=('APACHE') +depends=('java-runtime') +makedepends=('java-environment' 'java-atinject' 'jsr305' 'jh') +source=("https://github.com/google/${_pkgname}/archive/v${pkgver}.tar.gz") +sha256sums=('02d1cd2e97fd8e38ba32aeb5354b18df36be8a176c8a754bb0ef020cd6122e75') + +prepare() { + cd "${srcdir}/${_pkgname}-${pkgver}" + rm -rv {guava-gwt,guava-testlib,guava-tests} + rm -v "${_pkgname}/lib/jdiff.jar" + mkdir -p "${_pkgname}/build/classes" +} + +build() { + cd "${srcdir}/${_pkgname}-${pkgver}/${_pkgname}" + + CLASSPATH="/usr/share/java/javax.inject.jar:/usr/share/java/jsr305.jar" + javac -cp $CLASSPATH -d "build/classes" -encoding UTF-8 $(find "src" -name \*.java) + javadoc -classpath $CLASSPATH -d "build/javadoc" -encoding UTF-8 -sourcepath src -subpackages com + + jar -cvf "${_pkgname}.jar" -C build/classes . +} + +package() { + cd "${srcdir}/${_pkgname}-${pkgver}/${_pkgname}" + + # Install license file + install -Dm644 "../COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" + + # 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 "com.google.guava" ${_pkgname} ${pkgver} \ + "pom.xml" \ + "${_pkgname}.jar" \ + "${_pkgname}-${pkgver}.jar" + + jh mvn-install "com.google.guava" "${_pkgname}-parent" ${pkgver} \ + "${srcdir}/${_pkgname}-${pkgver}/pom.xml" + + ln -s "/usr/share/java/${_pkgname}-${pkgver}.jar" \ + "${pkgdir}/usr/share/java/${_pkgname}.jar" +} |