From b8c7370a682e4e29cda623222d17a790c01c3642 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 7 Aug 2024 12:37:21 +0100 Subject: gentoo auto-resync : 07:08:2024 - 12:37:20 --- app-misc/openhab-bin/Manifest | 3 +- app-misc/openhab-bin/files/openhab.initd | 18 +++ app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild | 135 +++++++++++++++++++++++ app-misc/openhab-bin/openhab-bin-4.2.0.ebuild | 124 --------------------- 4 files changed, 155 insertions(+), 125 deletions(-) create mode 100644 app-misc/openhab-bin/files/openhab.initd create mode 100644 app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild delete mode 100644 app-misc/openhab-bin/openhab-bin-4.2.0.ebuild (limited to 'app-misc/openhab-bin') diff --git a/app-misc/openhab-bin/Manifest b/app-misc/openhab-bin/Manifest index 2313bc55a76d..f416a13e71a1 100644 --- a/app-misc/openhab-bin/Manifest +++ b/app-misc/openhab-bin/Manifest @@ -1,4 +1,5 @@ AUX openhab.env 167 BLAKE2B 6e67342c7eb05fb4f3b2e57769ad51d0db195ad707719caa4adf66f5d26c8ed127ee718c807e7a834944c619d225c32697b336aed8f337421e202e6e75554705 SHA512 07c025837772273e13ff759cce28f0f1f7a06d951368b8255d5a7410096a9a90d9983fcbe81302ddf131916ed9ea61372630376e410ccde139ba34665e4e08f4 +AUX openhab.initd 257 BLAKE2B 79ba1215667579b116a4b8b7ab6252546b79562ae5b64e5bd7f21304ee6071e2cdababa35c27063e984955afca768777339a60a1c67d66950ef04b852fcc931f SHA512 5c00a12810c0166ed853c0414c402ea6e5b79b27a91ea13ad875adef563d9d8349a986a428344cfa2d10af5b8b66ff30412764e4a133a9615bd00bb018f279e2 AUX openhab.service 518 BLAKE2B f00b13946a588b1b2b9f94775d5ef281cac777888426bd97a87b72eed39fe23a609a51e819e690ebaae1c5ca5c4a37bb7874a64a52d39a305012602905be9e52 SHA512 e07cc1465bb8eee24cd1435b468279fcb2f95acbf44866306b0637e2d7e46c0aef50bb3ce9e22cafe5140d4b534df77bfcbdc7d7e697def9db94a0207f2e1dd3 AUX openhab.tmpfiles 352 BLAKE2B 23bab4c007c924cdfaa602654f19030d702b855f3baf62aaa016d944c8caf4f93252ae3ab9b3442ff6a8a528fcdd7a12f9767c29bfed7837c8f2cc2594955c26 SHA512 cb7cc7483915512f65664a9439b07c25b15c3066f321c8087cece2803e937392f9f0888a5c836949632c9b0974fb2d6cc577d8f785423cd42aa6ba575ba8fcc2 DIST openhab-4.1.1.zip 110909555 BLAKE2B df89e2391e8abe926635fc1e0fbb5c7b1f6a03a87ba643d68a3c8bf1ef52f8b6ca862d8655112a225e1ec2f2d9cc90e0906c40a5dc00f52b53fcb4bac8059378 SHA512 50125e025e4ed8f3ea93359a777e0944150cf157b853bc3f6e777c04956c59346d77d4f3680756241d3d71b8c57014f777601cb5ca836b8e80046ce5a5aac770 @@ -7,5 +8,5 @@ DIST openhab-4.2.0.tar.gz 110566875 BLAKE2B 25f07801258b958d3845cc43360eac970741 DIST openhab-cli-2024-01-14 8633 BLAKE2B 0b0999abcb884b779087b92f9f3e08fee3662753692392fbb30d218d0fc25fd1fca613c32b8193a3365764c55ac3525f8369aeea4edbf61223cd0219209c4cbf SHA512 bf24ae776d4362e8a60a0c71cb025834e5f645a24377a87484477f544026f2fdd996a1781f1082e62197fce33a9dadb5972df22ce3e4cd9f73d3088ec5bc0a98 EBUILD openhab-bin-4.1.1.ebuild 2229 BLAKE2B 378e56fb29a89c02be2c61eaa6d9e1bd5389d06b82ddb3409419b528c96f33f492485723ce5358d28cf9313862462ced24418f172bd1868a4e0974b877bec665 SHA512 6fecb3a02da8a16c51b8a17e0acb441f8aa21d214e0ac8d52c47d2b9e3550638c4e34515ea54bac666b0612664afd100ebd4cf59363161aa8078b6c0a261a54e EBUILD openhab-bin-4.1.2.ebuild 2801 BLAKE2B d6d1f91d0b2838b4d9e4591631cd9b94a38ae21c1638dd61762ff5211ceb2adceee4ed43baf2db0872aa3aa7a77afa999e0c6af254eaf0b07b2c4edfc4bf7e77 SHA512 5a705405daa98005bc7cef3984cca7194231d67a8f8ae298882929cbd5778088faf627331c7866994ab58d35a2c977671ce9b6c81661811de1f8e013c2bdbdbf -EBUILD openhab-bin-4.2.0.ebuild 2801 BLAKE2B d6d1f91d0b2838b4d9e4591631cd9b94a38ae21c1638dd61762ff5211ceb2adceee4ed43baf2db0872aa3aa7a77afa999e0c6af254eaf0b07b2c4edfc4bf7e77 SHA512 5a705405daa98005bc7cef3984cca7194231d67a8f8ae298882929cbd5778088faf627331c7866994ab58d35a2c977671ce9b6c81661811de1f8e013c2bdbdbf +EBUILD openhab-bin-4.2.0-r1.ebuild 3176 BLAKE2B 5d59ee97a386952137cf9c391dc99160977efc70e30f5261149c7e9bd625c923198c65532f8d8398cdb2c6fb5fb9d5b80e88ea299675b72b5db498e44ea02193 SHA512 64ca9c1e4e079d026b8dc51cd997010735b690e9666b3d2fb898de01b2c18b3f8cb862dc15d0aeb7b138990f63b9c430ee3082cf5358d8f8bbf9de0984e1b86d MISC metadata.xml 355 BLAKE2B 36aabcc2d06a2d16b5ebe20ac5d7a9edbbe1121e5b7ea65206142dc56ef2258141d4618883aa5121acb73b7a275d955dffa44219b2fcc0fc77d3ca5eaf79225e SHA512 09a9f603096ad6b0f806d53b4454a899a8692b98ff2b8721d4095c382ff09c928236f1c7400a2132d33a4b5949d6f18e48325dccb49b51eb662c0447845d2862 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-r1.ebuild b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild new file mode 100644 index 000000000000..6625624aba64 --- /dev/null +++ b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild @@ -0,0 +1,135 @@ +# Copyright 1999-2024 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} + +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 +" + +S="${WORKDIR}" +LICENSE="EPL-2.0" +SLOT="0" + +KEYWORDS="~amd64 ~arm64" + +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" + +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 <&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 + + 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 +} diff --git a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild b/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild deleted file mode 100644 index 9b1c384fe722..000000000000 --- a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 1999-2024 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} - -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 -" - -S="${WORKDIR}" -LICENSE="EPL-2.0" -SLOT="0" - -KEYWORDS="~amd64 ~arm64" - -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" - -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 <&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 - - 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 - fi -} -- cgit v1.2.3