diff options
Diffstat (limited to 'pcr/protobuf-java/PKGBUILD')
-rw-r--r-- | pcr/protobuf-java/PKGBUILD | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/pcr/protobuf-java/PKGBUILD b/pcr/protobuf-java/PKGBUILD new file mode 100644 index 000000000..b4f283774 --- /dev/null +++ b/pcr/protobuf-java/PKGBUILD @@ -0,0 +1,62 @@ +# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> + +_libname=protobuf +pkgname=${_libname}-java +pkgver=2.6.1 +pkgrel=1 +pkgdesc="Google's data interchange format utility (java API)." +url="http://code.google.com/p/protobuf/" +license=('custom:BSD') +arch=('any') +depends=('java-runtime') +makedepends=('java-environment' 'jh' "${_libname}>=${pkgver}") +conflicts=('google-gson') +replaces=('google-gson') +source=("https://github.com/google/${_libname}/releases/download/v${pkgver}/${_libname}-${pkgver}.tar.gz" + 'protobuf-java.patch') +sha256sums=('dbbd7bdd2381633995404de65a945ff1a7610b0da14593051b4738c90c6dd164' + '60a83c90dc00c819c6614791956aa2957e1d6245fc51a38840416e8506ea1dfc') + +prepare() { + cd "${srcdir}/${_libname}-${pkgver}" + patch -Np1 -i "${srcdir}/protobuf-java.patch" + + cd java + mkdir -p build/classes +} + +build() { + cd "${srcdir}/${_libname}-${pkgver}/java" + + protoc --java_out=src/main/java -I../src \ + ../src/google/protobuf/descriptor.proto + + javac -cp . -d "build/classes" \ + $(find "src/main/java" -name \*.java) + + javadoc -d "build/javadoc" \ + -sourcepath "src/main/java" -subpackages com + + jar -cvf "${_libname}.jar" -C "build/classes" . +} + +package() { + cd "${srcdir}/${_libname}-${pkgver}/java" + + # 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 "com.google.${_libname}" "${_libname}-java" ${pkgver} \ + pom.xml \ + "${_libname}.jar" \ + "${_libname}-${pkgver}.jar" + + ln -s "/usr/share/java/${_libname}-${pkgver}.jar" \ + "${pkgdir}/usr/share/java/${_libname}.jar" +} |