summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJOLIMAITRE Matthieu2024-03-18 16:58:55 +0100
committerJOLIMAITRE Matthieu2024-03-18 16:58:55 +0100
commit2ec54bf0f6bba914cf57080bdf981c91b048acb9 (patch)
treee475ad0a2ae91bda232905ab99c0917162e35666
downloadaur-2ec54bf0f6bba914cf57080bdf981c91b048acb9.tar.gz
init
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD74
2 files changed, 87 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0f60fb0926a1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = californium-tools-git
+ pkgdesc = Californium tools, including cf-client, cf-server and cf-browser.
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://eclipse.dev/californium/
+ arch = x86_64
+ license = Eclipse Distribution License 1.0 or Eclipse Public License 2.0
+ depends = maven
+ depends = liberica-jdk-11-full-bin
+ source = git+https://github.com/eclipse-californium/californium.tools.git
+ sha256sums = SKIP
+
+pkgname = californium-tools-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..53c1d7e7d2eb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,74 @@
+pkgname="californium-tools-git"
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Californium tools, including cf-client, cf-server and cf-browser."
+url="https://eclipse.dev/californium/"
+arch=("x86_64")
+license=("Eclipse Distribution License 1.0 or Eclipse Public License 2.0")
+makedepends=()
+optdepends=()
+depends=('maven' 'liberica-jdk-11-full-bin')
+source=("git+https://github.com/eclipse-californium/californium.tools.git")
+sha256sums=("SKIP")
+
+build() {
+ cd "$srcdir/californium.tools"
+ export JAVA_HOME="/usr/lib/jvm/liberica-jdk-11-full"
+ mvn clean install -Daether.dependencyCollector.impl=bf
+
+ rm -fr jars bin applications
+ mkdir jars bin applications
+
+ add_bin() {
+ identifier="$1"
+ jar_local_dir="$2"
+
+ jar_file=$(find $jar_local_dir | grep "$identifier" | grep 'SNAPSHOT\.jar$' | head -n 1)
+ cp "$jar_file" "jars/$identifier.jar"
+
+ echo "#!/bin/sh
+export JAVA_HOME='/usr/lib/jvm/liberica-jdk-11-full'
+/usr/lib/jvm/liberica-jdk-11-full/bin/java -jar /usr/share/californium-tools/jars/$identifier.jar
+" > "bin/$identifier"
+ chmod a+x "bin/$identifier"
+
+ }
+ add_app() {
+ name="$1"
+ identifier="$2"
+
+ echo "[Desktop Entry]
+Name=$name
+Comment=Part of the Californium tools.
+Exec=/usr/share/californium-tools/bin/$identifier
+Terminal=false
+Type=Application
+MimeType=
+" > "applications/$identifier.desktop"
+ }
+
+ add_bin "cf-browser" "cf-browser/target"
+ add_bin "cf-client" "cf-client/target"
+ add_bin "cf-coapbench" "cf-coapbench/target"
+ add_bin "cf-jmeter-plugin" "cf-jmeter-plugin/target"
+ add_bin "cf-polyfill" "cf-polyfill/target"
+ add_bin "cf-rd" "cf-rd/target"
+ add_bin "cf-server" "cf-server/target"
+
+ add_app "Californium Browser" "cf-browser"
+}
+
+package() {
+ cd "$srcdir/californium.tools"
+
+ mkdir -p "$pkgdir/usr/share/californium-tools/"
+ cp -r jars bin applications "$pkgdir/usr/share/californium-tools/"
+ mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/share/applications"
+
+ for binary in $(cd bin && ls)
+ do ln -s "/usr/share/californium-tools/bin/$binary" "$pkgdir/usr/bin/$binary"
+ done
+
+ for application in $(cd applications && ls)
+ do ln -s "/usr/share/californium-tools/applications/$application" "$pkgdir/usr/share/applications/$application"
+ done