1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

misc/openhab*: update to 4.0.2, rc.d script changes

The rc.d script is now instance-aware (like the tomcat port). [1]
This allows to make a copy of the rc.d script to a different name and
use similar-named rc.conf variables to start a second instance of
openhab.

Submitted by:	Jürgen Weber <weberjn@gmail.com> [1]
This commit is contained in:
Alexander Leidinger 2023-08-30 08:46:55 +02:00
parent 2a387e750f
commit b5bb6426f2
6 changed files with 63 additions and 36 deletions

View File

@ -1,5 +1,5 @@
PORTNAME= openhab-addons
PORTVERSION= 4.0.1
PORTVERSION= 4.0.2
CATEGORIES= misc java
MASTER_SITES= https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab-addons/${PORTVERSION}/
DISTNAME= openhab-addons-${PORTVERSION}

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1690713414
SHA256 (openhab-addons-4.0.1.kar) = edb34f7ad477ccfc5f9b171958139b780d27354384463c4b8e2a9d6d895bb75c
SIZE (openhab-addons-4.0.1.kar) = 393905810
TIMESTAMP = 1693376683
SHA256 (openhab-addons-4.0.2.kar) = de1fbbb2944176712852161b1311e69f3663f46854d216abab7f3b2c49638cfa
SIZE (openhab-addons-4.0.2.kar) = 393906978

View File

@ -1,5 +1,5 @@
PORTNAME= openhab
PORTVERSION= 4.0.1
PORTVERSION= 4.0.2
PORTREVISION= 0
CATEGORIES= misc java
MASTER_SITES= https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/${PORTVERSION}/

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1690711802
SHA256 (openhab-4.0.1.zip) = 9a3dee1ceea3fae5c1673da954886a0432d8cc121eac8d3d1220264e3ae59ecc
SIZE (openhab-4.0.1.zip) = 104031926
TIMESTAMP = 1693376325
SHA256 (openhab-4.0.2.zip) = f132b501fe997daf83db8fbb7d8d8910c87d5620c1adc3abb6ec1c609bac62ac
SIZE (openhab-4.0.2.zip) = 104058457

View File

@ -28,47 +28,73 @@
. /etc/rc.subr
name=openhab
rcvar=openhab_enable
case $0 in
/etc/rc*)
# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),
# so get the name of the script from $_file
name=$_file
;;
*)
name=$0
;;
esac
load_rc_config $name
name=${name##*/}
rcvar=${name}_enable
: ${openhab_enable:="NO"}
: ${openhab_user:="openhab"}
: ${openhab_group:="openhab"}
: ${openhab_http_port:="8080"}
: ${openhab_https_port:="8443"}
: ${openhab_listen_address:="0.0.0.0"}
: ${openhab_backup_dir:="/var/db/openhab/backups"}
: ${openhab_home_dir:="%%PREFIX%%/libexec/openhab"}
: ${openhab_conf_dir:="%%PREFIX%%/etc/openhab"}
: ${openhab_runtime_dir:="%%PREFIX%%/libexec/openhab/runtime"}
: ${openhab_userdata_dir:="/var/db/openhab/userdata"}
: ${openhab_log_dir:="/var/log/openhab"}
load_rc_config "${name}"
export OPENHAB_USER="${openhab_user}"
export OPENHAB_GROUP="${openhab_group}"
export OPENHAB_HTTP_PORT="${openhab_http_port}"
export OPENHAB_HTTPS_PORT="${openhab_https_port}"
export OPENHAB_HTTP_ADDRESS="${openhab_listen_address}"
eval "${rcvar}=\${${rcvar}:-'NO'}"
eval "_openhab_user=\${${name}_user:-'openhab'}"
eval "_openhab_group=\${${name}_group:-'openhab'}"
eval "_openhab_http_port=\${${name}_http_port:-'8080'}"
eval "_openhab_https_port=\${${name}_https_port:-'8443'}"
eval "_openhab_listen_address=\${${name}_listen_address:-'0.0.0.0'}"
eval "_openhab_backup_dir=\${${name}_backup_dir:-'/var/db/openhab/backups'}"
eval "_openhab_home_dir=\${${name}_home_dir:-'%%PREFIX%%/libexec/openhab'}"
eval "_openhab_conf_dir=\${${name}_conf_dir:-'%%PREFIX%%/etc/openhab'}"
eval "_openhab_runtime_dir=\${${name}_runtime_dir:-'%%PREFIX%%/libexec/openhab/runtime'}"
eval "_openhab_userdata_dir=\${${name}_userdata_dir:-'/var/db/openhab/userdata'}"
eval "_openhab_log_dir=\${${name}_log_dir:-'/var/log/openhab'}"
eval "_openhab_piddir=\${${name}_piddir}"
eval "_openhab_java_opts=\${${name}_java_opts:-''}"
export OPENHAB_USER="${_openhab_user}"
export OPENHAB_GROUP="${_openhab_group}"
export OPENHAB_HTTP_PORT="${_openhab_http_port}"
export OPENHAB_HTTPS_PORT="${_openhab_https_port}"
export OPENHAB_HTTP_ADDRESS="${_openhab_listen_address}"
export OPENHAB_BACKUPS="${openhab_backup_dir}"
export EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/cuau0 -Dsun.nio.fs.watchservice=polling ${openhab_java_opts}"
export OPENHAB_HOME="${openhab_home_dir}"
export OPENHAB_CONF="${openhab_conf_dir}"
export OPENHAB_RUNTIME="${openhab_runtime_dir}"
export OPENHAB_USERDATA="${openhab_userdata_dir}"
export OPENHAB_LOGDIR="${openhab_log_dir}"
export EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/cuau0 -Dsun.nio.fs.watchservice=polling ${_openhab_java_opts}"
export OPENHAB_HOME="${_openhab_home_dir}"
export OPENHAB_CONF="${_openhab_conf_dir}"
export OPENHAB_RUNTIME="${_openhab_runtime_dir}"
export OPENHAB_USERDATA="${_openhab_userdata_dir}"
export OPENHAB_LOGDIR="${_openhab_log_dir}"
# for UTF-8 encoding, language can be set inside openhab:
export LC_ALL=en_US.UTF-8
export JAVA_VERSION=17
pidfile=/var/run/${name}/${name}.pid
start_precmd="openhab_prestart"
command=/usr/sbin/daemon
command_args="-p ${pidfile} -c -t openhab ${OPENHAB_HOME}/start.sh server"
openhab_prestart() {
# Make sure we have our RUNDIR, even if it's on a tmpfs
install -d -o ${_openhab_user} -g ${_openhab_group} -m 0755 "${_openhab_piddir}"
install -d -o ${_openhab_user} -g ${_openhab_group} -m 0755 "${_openhab_log_dir}"
}
openhab_stop() {
${OPENHAB_RUNTIME}/bin/stop
su -m ${_openhab_user} -c "${OPENHAB_RUNTIME}/bin/stop"
if [ -e ${pidfile} ]; then
wait_for_pids $(cat ${pidfile})
fi

View File

@ -233,8 +233,9 @@ libexec/openhab/runtime/system/org/javassist/javassist/3.27.0-GA/javassist-3.27.
libexec/openhab/runtime/system/org/jctools/jctools-core/2.1.2/jctools-core-2.1.2.jar
libexec/openhab/runtime/system/org/jline/jline/3.21.0/jline-3.21.0.jar
libexec/openhab/runtime/system/org/jmdns/jmdns/3.5.8/jmdns-3.5.8.jar
libexec/openhab/runtime/system/org/jupnp/org.jupnp/2.7.0/org.jupnp-2.7.0.jar
libexec/openhab/runtime/system/org/jupnp/org.jupnp/2.7.1.OH1/org.jupnp-2.7.1.OH1.jar
libexec/openhab/runtime/system/org/jvnet/staxex/stax-ex/1.7.4/stax-ex-1.7.4.jar
libexec/openhab/runtime/system/org/openhab/base-fixes/1.0.0/base-fixes-1.0.0.jar
libexec/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.addon.marketplace.karaf/%%PORTVERSION%%/org.openhab.core.addon.marketplace.karaf-%%PORTVERSION%%.jar
libexec/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.addon.marketplace/%%PORTVERSION%%/org.openhab.core.addon.marketplace-%%PORTVERSION%%.jar
libexec/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.addon/%%PORTVERSION%%/org.openhab.core.addon-%%PORTVERSION%%.jar