summaryrefslogtreecommitdiff
path: root/pcr/jssc/PKGBUILD
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2017-02-10 02:28:08 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2017-02-10 02:28:08 -0500
commitef47cbd2da071096d98e93c610fb342aa3ed633c (patch)
tree6c93c570d048e6adf4250cdc5e34c68b232c8bc9 /pcr/jssc/PKGBUILD
parente2d7b93ce0a5de0168fd107c9ea7ec356c21c632 (diff)
downloadabslibre-ef47cbd2da071096d98e93c610fb342aa3ed633c.tar.gz
abslibre-ef47cbd2da071096d98e93c610fb342aa3ed633c.tar.bz2
abslibre-ef47cbd2da071096d98e93c610fb342aa3ed633c.zip
jssc: add new package to [pcr]
Diffstat (limited to 'pcr/jssc/PKGBUILD')
-rw-r--r--pcr/jssc/PKGBUILD47
1 files changed, 47 insertions, 0 deletions
diff --git a/pcr/jssc/PKGBUILD b/pcr/jssc/PKGBUILD
new file mode 100644
index 000000000..abee77d1e
--- /dev/null
+++ b/pcr/jssc/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+pkgname=jssc
+pkgver=2.8.0
+pkgrel=1
+pkgdesc="Java Simple Serial Connector; for working with serial ports from Java"
+arch=('i686' 'x86_64')
+url="https://github.com/scream3r/java-simple-serial-connector"
+license=('LGPL')
+depends=('java-runtime')
+makedepends=('java-environment')
+source=("https://github.com/scream3r/java-simple-serial-connector/archive/v$pkgver.tar.gz")
+sha256sums=('c3287bfc31ea81929739271b087b833fb7050686af6a90ec953c5b2f41b4d42d')
+
+prepare() {
+ cd "$srcdir/java-simple-serial-connector-$pkgver"
+ rm -rv src/{cpp/windows,java/libs}
+ mkdir -p build/classes
+}
+
+build() {
+ cd "$srcdir/java-simple-serial-connector-$pkgver"
+ export JAVA_HOME=/usr/lib/jvm/default
+ g++ $CXXFLAGS $CPPFLAGS $LDFLAGS -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" \
+ -fPIC -shared -o libjSSC-$pkgver.so src/cpp/_nix_based/jssc.cpp
+
+ javac -d build/classes -encoding UTF-8 $(find src/java -name \*.java)
+ javadoc -d build/javadoc -encoding UTF-8 -sourcepath src/java -subpackages jssc
+ jar -cvf "$pkgname-$pkgver.jar" -C build/classes .
+}
+
+package() {
+ cd "$srcdir/java-simple-serial-connector-$pkgver"
+
+ # Install documentation
+ install -d "$pkgdir/usr/share/doc/$pkgname"
+ cp -r build/javadoc "$pkgdir/usr/share/doc/$pkgname"
+
+ # Install jar
+ install -Dm644 "$pkgname-$pkgver.jar" \
+ "$pkgdir/usr/share/java/$pkgname-$pkgver.jar"
+ ln -s "/usr/share/java/$pkgname-$pkgver.jar" \
+ "$pkgdir/usr/share/java/$pkgname.jar"
+
+ install -Dm644 "libjSSC-$pkgver.so" \
+ "$pkgdir/usr/lib/jni/libjSSC-$pkgver.so"
+}