summaryrefslogtreecommitdiff
path: root/pcr/java-gson
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2016-05-19 04:49:27 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2016-05-19 04:49:27 -0500
commit3bee1fa60b4b62da0cd625ea2e46a706533e9e15 (patch)
treefd65bd9259cec50a2d7e89b8e64123cd458afaa2 /pcr/java-gson
parent26787fc19b48e17d8d41cd2310a65aff9fc5e5c6 (diff)
java-gson: add new package to [pcr] (required by closure-compiler)
Diffstat (limited to 'pcr/java-gson')
-rw-r--r--pcr/java-gson/PKGBUILD54
1 files changed, 54 insertions, 0 deletions
diff --git a/pcr/java-gson/PKGBUILD b/pcr/java-gson/PKGBUILD
new file mode 100644
index 000000000..3e37ce29e
--- /dev/null
+++ b/pcr/java-gson/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_libname=gson
+pkgname=java-${_libname}
+pkgver=2.6.2
+pkgrel=1
+pkgdesc="Java library to convert Java Objects into JSON and back"
+arch=('any')
+url="http://code.google.com/p/google-gson/"
+license=('APACHE')
+depends=('java-runtime')
+makedepends=('java-environment' 'jh')
+conflicts=('google-gson')
+replaces=('google-gson')
+source=("https://github.com/google/${_libname}/archive/${_libname}-parent-${pkgver}.tar.gz")
+sha256sums=('b33ca70ee634a17e9b95651ea76cf5b0d9c1b5fb6e227a5a1d763513dcfd6d6d')
+
+prepare() {
+ cd "${srcdir}/${_libname}-${_libname}-parent-${pkgver}/${_libname}"
+ mkdir -p build/classes
+}
+
+build() {
+ cd "${srcdir}/${_libname}-${_libname}-parent-${pkgver}/${_libname}"
+
+ javac -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}-${_libname}-parent-${pkgver}/${_libname}"
+
+ # 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.code.${_libname}" ${_libname} ${pkgver} \
+ pom.xml \
+ "${_libname}.jar" \
+ "${_libname}-${pkgver}.jar"
+
+ ln -s "/usr/share/java/${_libname}-${pkgver}.jar" \
+ "${pkgdir}/usr/share/java/${_libname}.jar"
+}