commit: dace9f76032db1788f0e5890370643b330f3570e
Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 20 11:54:20 2026 +0000
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Jan 20 12:05:33 2026 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dace9f76
app-misc/openhab-bin: add 5.1.1
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
app-misc/openhab-bin/Manifest | 1 +
app-misc/openhab-bin/openhab-bin-5.1.1.ebuild | 136 ++++++++++++++++++++++++++
2 files changed, 137 insertions(+)
diff --git a/app-misc/openhab-bin/Manifest b/app-misc/openhab-bin/Manifest
index aa1aea922945..ed8167962c58 100644
--- a/app-misc/openhab-bin/Manifest
+++ b/app-misc/openhab-bin/Manifest
@@ -1,3 +1,4 @@
DIST openhab-5.0.3.tar.gz 115565086 BLAKE2B
d4d660738539b8ff2bddaeb3cba04ebee999852efe2057d956df87fc7413b1c1ef1cb7f709698294ee07a578ba4c85e3db8d952668d76cc3bb44ba13ede5255c
SHA512
2485f4f67c5d3ce608eed3f0d99230761f0452761a013f10ff856be0f731195f45bfeb660aa14e3eb921daed8b2dc2f18ff74f7609b50235467ca803dece5369
DIST openhab-5.1.0.tar.gz 121015522 BLAKE2B
d4b2776319dbf7e85964771ca38ea5773dac182d0813100102bdb34aca2e7968702c6bc83d3841889a111b8529ee5f432df325a6b2e5c2f7f71d7648658dddbd
SHA512
73c43d77b5cec820b6696a02581f1c3272ddd7e63f59c2e48867eb9deaef7c3862d3bcf2fb01dcbbe302094c2b7b6ff0e2e4fdc63113ddb97a66fb19900d6d4b
+DIST openhab-5.1.1.tar.gz 121148601 BLAKE2B
0f98afe583debeb61a42c7beeffd9c4637ebacc67dc5e19d70b27a3e79e41fa4732d788e2ddf898c5435ab25d3a45b41cc94264d569667dfc226bff428569a74
SHA512
cb171b63f9d35981466f603cd733bfb771f1f63b8e07a8f7e5f2775a05f50b309dd320564d52d684a89c1865def1b496a27acc23ac2298e17d1010f30ff0646c
DIST openhab-cli-2024-01-14 8633 BLAKE2B
0b0999abcb884b779087b92f9f3e08fee3662753692392fbb30d218d0fc25fd1fca613c32b8193a3365764c55ac3525f8369aeea4edbf61223cd0219209c4cbf
SHA512
bf24ae776d4362e8a60a0c71cb025834e5f645a24377a87484477f544026f2fdd996a1781f1082e62197fce33a9dadb5972df22ce3e4cd9f73d3088ec5bc0a98
diff --git a/app-misc/openhab-bin/openhab-bin-5.1.1.ebuild
b/app-misc/openhab-bin/openhab-bin-5.1.1.ebuild
new file mode 100644
index 000000000000..f63db4479aea
--- /dev/null
+++ b/app-misc/openhab-bin/openhab-bin-5.1.1.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo systemd tmpfiles
+
+MY_PN=${PN%-bin}
+MY_P=${MY_PN}-${PV}
+MY_CLI_VER=2024-01-14
+
+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-${MY_CLI_VER}
+"
+
+S="${WORKDIR}"
+LICENSE="EPL-2.0"
+SLOT="0"
+
+KEYWORDS="~amd64 ~arm64"
+
+MY_JAVA_DEPEND="virtual/jre:21"
+
+# 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"
+
+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-${MY_CLI_VER} openhab-cli
+
+ newinitd "${FILESDIR}"/openhab.initd openhab
+}
+
+pkg_postinst() {
+ tmpfiles_process openhab.conf
+
+ if [[ -z ${REPLACING_VERSIONS} && -z ${OPENHAB_POSTINST_UPDATE} ]]; then
+ return
+ fi
+
+ if [[ -d "${EROOT}"/run/systemd/system ]]; then
+ if systemctl is-active --quiet openhab; then
+ local openhab_service_active=1
+ einfo "Restarting OpenHAB service due to version update"
+ edob systemctl daemon-reload
+ edob systemctl stop openhab
+ fi
+
+ echo y | edob -m "Cleaning OpenHAB cache" \
+ openhab-cli clean-cache
+ assert "Failed to clean OpenHAB cache"
+
+ if [[ -v openhab_service_active ]]; then
+ edob systemctl start openhab
+ fi
+ elif [[ -d /run/openrc ]]; then
+ einfo "Follow these steps to complete the update of OpenHAB:"
+ einfo
+ einfo "1. Stop the OpenHAB's service"
+ einfo "$ rc-service openhab stop"
+ einfo "2. Clean OpenHAB's cache"
+ einfo "$ openahb-cli clean-cache"
+ einfo "3. Restart OpenHAB's service"
+ einfo "$ rc-service openhab start"
+ fi
+}