summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2016-06-23 05:28:38 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2016-06-23 05:28:38 -0500
commit983b1b0bc40c038ed895d03406c9ba18226b6199 (patch)
tree5fc5ca8ab0f540c8e99702ce7a433ef901352f7f
parent5ac085060ee35727bf082169ceed1c3b5173a29b (diff)
java-commons-net: add new package to [pcr]
-rw-r--r--pcr/java-commons-net/PKGBUILD51
1 files changed, 51 insertions, 0 deletions
diff --git a/pcr/java-commons-net/PKGBUILD b/pcr/java-commons-net/PKGBUILD
new file mode 100644
index 000000000..fcf9ccc1a
--- /dev/null
+++ b/pcr/java-commons-net/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+_pkgname=commons-net
+pkgname=java-${_pkgname}
+pkgver=3.4
+pkgrel=1
+pkgdesc="Implementations of common net"
+arch=('any')
+url='https://commons.apache.org/net/'
+license=('APACHE')
+depends=('java-runtime')
+makedepends=('java-environment' 'jh')
+source=("https://archive.apache.org/dist/commons/net/source/${_pkgname}-${pkgver}-src.tar.gz")
+sha1sums=('abfba84427a06341e113d59d8f75855e67093087')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}-src"
+ mkdir -p build/classes
+ rm -rv src/main/java/examples
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}-src"
+ javac -d build/classes -encoding UTF-8 \
+ $(find src/main/java -name \*.java)
+ javadoc -d build/javadoc -encoding UTF-8 \
+ -sourcepath src/main/java -subpackages org
+
+ 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} \
+ pom.xml \
+ "${_pkgname}.jar" \
+ "${_pkgname}-${pkgver}.jar"
+
+ ln -s "/usr/share/java/${_pkgname}-${pkgver}.jar" \
+ "${pkgdir}/usr/share/java/${_pkgname}.jar"
+}