summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-03-29 10:25:29 +0100
committerFlorian Schmaus <flow@gentoo.org>2024-03-29 10:29:37 +0100
commit061ac696d02008d87fbfdcf40c04167f96f1126e (patch)
treea00fca03db22b1132738b9118e8bc5af0de5d571 /app-misc/openhab-bin
parentdev-ruby/json: tests depend on test-unit-ruby-core (diff)
downloadgentoo-061ac696d02008d87fbfdcf40c04167f96f1126e.tar.gz
gentoo-061ac696d02008d87fbfdcf40c04167f96f1126e.tar.bz2
gentoo-061ac696d02008d87fbfdcf40c04167f96f1126e.zip
app-misc/openhab-bin: add 4.1.2
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'app-misc/openhab-bin')
-rw-r--r--app-misc/openhab-bin/Manifest1
-rw-r--r--app-misc/openhab-bin/openhab-bin-4.1.2.ebuild103
2 files changed, 104 insertions, 0 deletions
diff --git a/app-misc/openhab-bin/Manifest b/app-misc/openhab-bin/Manifest
index a1e936b40038..3a246139f423 100644
--- a/app-misc/openhab-bin/Manifest
+++ b/app-misc/openhab-bin/Manifest
@@ -1,2 +1,3 @@
DIST openhab-4.1.1.zip 110909555 BLAKE2B df89e2391e8abe926635fc1e0fbb5c7b1f6a03a87ba643d68a3c8bf1ef52f8b6ca862d8655112a225e1ec2f2d9cc90e0906c40a5dc00f52b53fcb4bac8059378 SHA512 50125e025e4ed8f3ea93359a777e0944150cf157b853bc3f6e777c04956c59346d77d4f3680756241d3d71b8c57014f777601cb5ca836b8e80046ce5a5aac770
+DIST openhab-4.1.2.tar.gz 110558399 BLAKE2B b77800898d5358caaadf31e921351d5431a09cf97ad881e091c0f7f7ca6efa13439f39075e15d4887df3b28d2548b10cbf44176328570cf2b8df8fc15bc25ecd SHA512 ccad90d1905f2190cd54284353981453d4d38f1206a427b91094dfd8e8a25e31cc15921544ac883f501ee33d018226b07e12e04bfd5c928771ff090826de3cba
DIST openhab-cli-2024-01-14 8633 BLAKE2B 0b0999abcb884b779087b92f9f3e08fee3662753692392fbb30d218d0fc25fd1fca613c32b8193a3365764c55ac3525f8369aeea4edbf61223cd0219209c4cbf SHA512 bf24ae776d4362e8a60a0c71cb025834e5f645a24377a87484477f544026f2fdd996a1781f1082e62197fce33a9dadb5972df22ce3e4cd9f73d3088ec5bc0a98
diff --git a/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild b/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild
new file mode 100644
index 000000000000..9c559963aaa1
--- /dev/null
+++ b/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd tmpfiles
+
+MY_PN=${PN%-bin}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="An open-source automation software for your home"
+HOMEPAGE="https://www.openhab.org/"
+SRC_URI="
+ https://github.com/openhab/openhab-distro/releases/download/${PV}/${MY_P}.tar.gz
+ https://raw.githubusercontent.com/openhab/openhab-linuxpkg/10061acd36524afb12a033fea6dcf142b399bf56/resources/usr/bin/openhab-cli
+ -> openhab-cli-2024-01-14
+"
+KEYWORDS="~amd64 ~arm64"
+
+LICENSE="EPL-2.0"
+SLOT="0"
+
+MY_JAVA_DEPEND=">=virtual/jre-17"
+
+# app-arch/zip: used by "openhab-cli backup"
+RDEPEND="
+ ${MY_JAVA_DEPEND}
+ acct-user/openhab
+ app-arch/zip
+ dev-java/java-config
+"
+
+BDEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+src_compile() {
+ :
+}
+
+src_install() {
+ # We use move here to preserve the executable bit on the files under
+ # openhab/runtime/bin.
+ domove() {
+ local source="${1}"
+ local target="${2}"
+
+ local dest="${ED}/${target}"
+
+ mkdir -p "${dest}" || die "Failed to create ${dest}"
+ mv "${source}"/* "${dest}" || die "Failed to move"
+ }
+
+ domove runtime /usr/share/openhab/runtime
+ domove conf /etc/openhab
+
+ domove userdata /var/lib/openhab
+ fowners -R openhab:openhab /var/lib/openhab
+
+ local dirs=(
+ /usr/share/openhab/addons
+ /var/log/openhab
+ )
+ local d
+ for d in "${dirs[@]}"; do
+ keepdir "${d}"
+ fowners openhab:openhab "${d}"
+ done
+
+ newenvd "${FILESDIR}"/openhab.env 50openhab
+
+ systemd_dounit "${FILESDIR}"/openhab.service
+ newtmpfiles "${FILESDIR}"/openhab.tmpfiles openhab.conf
+
+ newbin - openhab <<EOF
+#!/usr/bin/env bash
+set -eu
+
+if [[ -v JAVA_HOME_OVERRIDE ]]; then
+ JAVA_HOME="\${JAVA_HOME_OVERRIDE}"
+else
+ if ! GENTOO_JAVA_VM="\$(depend-java-query --get-vm '${MY_JAVA_DEPEND}')"; then
+ >&2 echo "Could not find Java VM for ${MY_JAVA_DEPEND}"
+ exit 1
+ fi
+
+ if ! JAVA_HOME_ASSIGNMENT=\$(java-config -P \${GENTOO_JAVA_VM} | grep JAVA_HOME); then
+ >&2 echo "Could not retrieve JAVA_HOME of \${GENTOO_JAVA_VM}"
+ exit 1
+ fi
+
+ eval \${JAVA_HOME_ASSIGNMENT}
+fi
+
+export JAVA_HOME
+exec /usr/share/openhab/runtime/bin/karaf "\$@"
+EOF
+ newbin "${DISTDIR}"/openhab-cli-2024-01-14 openhab-cli
+}
+
+pkg_postinst() {
+ tmpfiles_process openhab.conf
+}