public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/openhab-bin/, app-misc/openhab-bin/files/
Date: Thu, 25 Jul 2024 07:21:31 +0000 (UTC)	[thread overview]
Message-ID: <1721892039.e765c8b50800a67f21a7b5e65a13a6a6971b5b8b.flow@gentoo> (raw)

commit:     e765c8b50800a67f21a7b5e65a13a6a6971b5b8b
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 24 11:59:40 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 07:20:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e765c8b5

app-misc/openhab-bin: add support for OpenRC

Thanks to Xavier Miller for the initial patches.

Closes: https://bugs.gentoo.org/936265
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-misc/openhab-bin/files/openhab.initd               | 18 ++++++++++++++++++
 ...ab-bin-4.2.0.ebuild => openhab-bin-4.2.0-r1.ebuild} | 11 +++++++++++
 2 files changed, 29 insertions(+)

diff --git a/app-misc/openhab-bin/files/openhab.initd b/app-misc/openhab-bin/files/openhab.initd
new file mode 100644
index 000000000000..a5899b24994f
--- /dev/null
+++ b/app-misc/openhab-bin/files/openhab.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+pidfile=/run/${SVCNAME}.pid
+
+command_user="openhab:openhab"
+command="/usr/bin/openhab"
+command_args="daemon"
+command_background=true
+
+depend() {
+	need net
+}
+
+stop() {
+    ebegin "Stopping ${RC_SVCNAME}"
+    ${command} stop
+    eend $?
+}

diff --git a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild
similarity index 88%
rename from app-misc/openhab-bin/openhab-bin-4.2.0.ebuild
rename to app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild
index 9b1c384fe722..6625624aba64 100644
--- a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild
+++ b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild
@@ -96,6 +96,8 @@ export JAVA_HOME
 exec /usr/share/openhab/runtime/bin/karaf "\$@"
 EOF
 	newbin "${DISTDIR}"/openhab-cli-2024-01-14 openhab-cli
+
+	newinitd "${FILESDIR}"/openhab.initd openhab
 }
 
 pkg_postinst() {
@@ -120,5 +122,14 @@ pkg_postinst() {
 		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
 }


             reply	other threads:[~2024-07-25  7:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25  7:21 Florian Schmaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-24 17:16 [gentoo-commits] repo/gentoo:master commit in: app-misc/openhab-bin/, app-misc/openhab-bin/files/ Florian Schmaus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1721892039.e765c8b50800a67f21a7b5e65a13a6a6971b5b8b.flow@gentoo \
    --to=flow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox