From owner-dev-commits-ports-all@freebsd.org Sun Jun 20 09:06:19 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AC4964BCAB; Sun, 20 Jun 2021 09:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G76GM3pphz4hRw; Sun, 20 Jun 2021 09:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A1E6268FF; Sun, 20 Jun 2021 09:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15K96Jnf001884; Sun, 20 Jun 2021 09:06:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15K96JGG001882; Sun, 20 Jun 2021 09:06:19 GMT (envelope-from git) Date: Sun, 20 Jun 2021 09:06:19 GMT Message-Id: <202106200906.15K96JGG001882@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexander Leidinger Subject: git: 207827e2a8e6 - main - misc/openhab: new v3 based upon copy from openhab2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: netchild X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 207827e2a8e65c4b0933edd15c0b21233c7cfa67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2021 09:06:19 -0000 The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/ports/commit/?id=207827e2a8e65c4b0933edd15c0b21233c7cfa67 commit 207827e2a8e65c4b0933edd15c0b21233c7cfa67 Author: Alexander Leidinger AuthorDate: 2021-06-20 09:02:42 +0000 Commit: Alexander Leidinger CommitDate: 2021-06-20 09:06:12 +0000 misc/openhab: new v3 based upon copy from openhab2 - copy openhab2* to openhab (follow upstream) - update to 3.0.2 - remove update script (no auto migration from v2, scrip may come back later, if needed) - use openhab instead openhabvX directories (follow upstream) - use openjdk 11 (new requirement) - add UPDATING entry for users which may want to switch to v3 --- UPDATING | 13 + misc/openhab-addons/openhab-addons/Makefile | 32 ++ misc/openhab-addons/openhab-addons/distinfo | 3 + misc/openhab-addons/openhab-addons/pkg-descr | 3 + misc/openhab/openhab/Makefile | 77 ++++ misc/openhab/openhab/distinfo | 3 + misc/openhab/openhab/files/openhab.in | 92 +++++ .../openhab/openhab/files/patch-runtime_bin_setenv | 12 + misc/openhab/openhab/files/pkg-message.in | 34 ++ misc/openhab/openhab/pkg-descr | 5 + misc/openhab/openhab/pkg-plist | 444 +++++++++++++++++++++ 11 files changed, 718 insertions(+) diff --git a/UPDATING b/UPDATING index 583882c0d2fe..4cf9da68c920 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,19 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20210620: + AFFECTS: users of misc/openhab2 + AUTHOR: netchild@FreeBSD.org + + The openhab v3 port has been committed. Upstream has removed the + version from the name, as such the FreeBSD port follows in all places + (start script name, directory names, ...). + Users are encuraged to migrate from misc/openhab2 to misc/openhab. + + No automatic config migration is available Both versions can be + installed in parallel, but an users has to take care to not run + both at the same time on the same port. + 20210617: AFFECTS: users of graphics/mesa-libs AUTHOR: kbowling@FreeBSD.org diff --git a/misc/openhab-addons/openhab-addons/Makefile b/misc/openhab-addons/openhab-addons/Makefile new file mode 100644 index 000000000000..1c027831e478 --- /dev/null +++ b/misc/openhab-addons/openhab-addons/Makefile @@ -0,0 +1,32 @@ +PORTNAME= openhab-addons +PORTVERSION= 3.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} +EXTRACT_SUFX= .kar + +MAINTAINER= netchild@FreeBSD.org +COMMENT= Addons for openhab + +LICENSE= EPL + +RUN_DEPENDS= ${LOCALBASE}/libexec/openhab/addons/README:misc/openhab + +USERS= openhab +GROUPS= openhab + +USES= zip +NO_WRKSUBDIR= yes +NO_BUILD= yes +EXTRACT_CMD= ${CP} +EXTRACT_BEFORE_ARGS="-v" +EXTRACT_AFTER_ARGS="${EXTRACT_WRKDIR}" + +PLIST_FILES= libexec/openhab/addons/openhab-addons-${PORTVERSION}.kar + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/openhab + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/openhab/addons + (cd ${WRKSRC} && ${INSTALL_DATA} ${DISTNAME}${EXTRACT_SUFX} ${STAGEDIR}${PREFIX}/libexec/openhab/addons/) + +.include diff --git a/misc/openhab-addons/openhab-addons/distinfo b/misc/openhab-addons/openhab-addons/distinfo new file mode 100644 index 000000000000..52f7d2e0be24 --- /dev/null +++ b/misc/openhab-addons/openhab-addons/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1624175939 +SHA256 (openhab-addons-3.0.2.kar) = 86d77be0e9dcc6050c43f68845469b4e64d13a18a0772f01b17d7444e6584627 +SIZE (openhab-addons-3.0.2.kar) = 213187024 diff --git a/misc/openhab-addons/openhab-addons/pkg-descr b/misc/openhab-addons/openhab-addons/pkg-descr new file mode 100644 index 000000000000..7120c31a9611 --- /dev/null +++ b/misc/openhab-addons/openhab-addons/pkg-descr @@ -0,0 +1,3 @@ +Addons for the openHAB smart-home software. + +WWW: http://www.openhab.org/ diff --git a/misc/openhab/openhab/Makefile b/misc/openhab/openhab/Makefile new file mode 100644 index 000000000000..cac024b87b77 --- /dev/null +++ b/misc/openhab/openhab/Makefile @@ -0,0 +1,77 @@ +PORTNAME= openhab +PORTVERSION= 3.0.2 +PORTREVISION= 0 +CATEGORIES= misc java +MASTER_SITES= https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/${PORTVERSION}/ +DISTNAME= openhab-${PORTVERSION} + +MAINTAINER= netchild@FreeBSD.org +COMMENT= Vendor and technology agnostic open source smart-home software + +LICENSE= EPL +LICENSE_FILE= ${WRKSRC}/LICENSE.TXT + +USES= zip +USE_JAVA= yes +JAVA_VERSION= 11 +JAVA_RUN= yes +USE_RC_SUBR= openhab +SUB_FILES= pkg-message +NO_WRKSUBDIR= yes +NO_ARCH= yes + +USERS= openhab +GROUPS= openhab + +PLIST_SUB= PORTVERSION=${PORTVERSION} + +post-patch: + @${REINPLACE_CMD} -e "s:%%LOCALBASE%%:${LOCALBASE}:g" ${WRKSRC}/runtime/bin/setenv + +do-build: +.for conf in services/runtime.cfg services/addons.cfg html/index.html transform/en.map transform/de.map + ${MV} ${WRKSRC}/conf/${conf} ${WRKSRC}/conf/${conf}.sample +.endfor + ${RM} -r ${WRKSRC}/runtime/bin/contrib + ${RM} ${WRKSRC}/*.ps1 ${WRKSRC}/*.bat ${WRKSRC}/runtime/bin/*.ps1 ${WRKSRC}/runtime/bin/*.bat \ + ${WRKSRC}/runtime/bin/*.psm1 \ + ${WRKSRC}/runtime/bin/setenv.bak \ + ${WRKSRC}/runtime/bin/setenv.orig + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/${PORTNAME} + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME} + ${MKDIR} ${STAGEDIR}${PREFIX}/share/${PORTNAME} + ${MKDIR} ${STAGEDIR}/var/log/${PORTNAME} + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME} + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/home + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/persistence + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/persistence/db4o + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/persistence/rrd4j + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/persistence/mapdb + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/backups + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/userdata + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/userdata/etc + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/userdata/etc/scripts + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}/userdata/tmp + ${MKDIR} ${STAGEDIR}/var/run/${PORTNAME} + (cd ${WRKSRC}/conf && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/etc/${PORTNAME}) + (cd ${WRKSRC} && ${COPYTREE_BIN} runtime ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}) + (cd ${WRKSRC} && ${COPYTREE_BIN} addons ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}) +.for script in start.sh start_debug.sh + ${INSTALL_SCRIPT} ${WRKSRC}/${script} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/ +.endfor + (cd ${WRKSRC}/userdata && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/${PORTNAME}) + +gen-plist: + ${FIND} ${STAGEDIR} -type f | sed -e "s:${STAGEDIR}${PREFIX}/::g ; s:${PORTVERSION}:%%PORTVERSION%%:g" | sort -u | grep libexec/ >pkg-plist.new + echo '@owner openhab' >>pkg-plist.new + echo '@group openhab' >>pkg-plist.new + ${FIND} ${STAGEDIR}${DATADIR} -type f | sed -E -e "s:${STAGEDIR}${DATADIR}/(.*):@sample %%DATADIR%%/\\1 /var/db/openhab/userdata/\\1:g ; s:${PORTVERSION}:%%PORTVERSION%%:g" | sort -u >>pkg-plist.new + ${FIND} ${STAGEDIR}${ETCDIR} -type d | sort -u | sed -e "s:${STAGEDIR}${ETCDIR}:@dir %%ETCDIR%%:g ; s:${PORTVERSION}:%%PORTVERSION%%:g" >>pkg-plist.new + ${FIND} ${STAGEDIR}${ETCDIR} -type f | sort -u | sed -E -e "s:${STAGEDIR}${ETCDIR}/:%%ETCDIR%%/:g ; s:${PORTVERSION}:%%PORTVERSION%%:g ; s:(.*.sample)$:@sample(openhab,openhab,640) \\1:" >>pkg-plist.new + ${FIND} ${STAGEDIR}/var/db/${PORTNAME} -type d | sort -ru | sed -e "s:${STAGEDIR}:@dir :g" >>pkg-plist.new + echo "@dir /var/log/${PORTNAME}" >>pkg-plist.new + echo "@dir /var/run/${PORTNAME}" >>pkg-plist.new + +.include diff --git a/misc/openhab/openhab/distinfo b/misc/openhab/openhab/distinfo new file mode 100644 index 000000000000..f9aa9e94834c --- /dev/null +++ b/misc/openhab/openhab/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1624174157 +SHA256 (openhab-3.0.2.zip) = ec35593b1d0a1c42f7ed1e7808dcfadf67546fe03bd64a5c2dc9f1cddbe3a728 +SIZE (openhab-3.0.2.zip) = 83737701 diff --git a/misc/openhab/openhab/files/openhab.in b/misc/openhab/openhab/files/openhab.in new file mode 100644 index 000000000000..3ff1043d3e7c --- /dev/null +++ b/misc/openhab/openhab/files/openhab.in @@ -0,0 +1,92 @@ +#!/bin/sh + +# +# PROVIDE: openhab +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# openhab_enable (bool): Set to NO by default. +# Set it to YES to enable openhab. +# openhab_user (username): Set to openhab by default. +# openhab_group (groupname): Set to openhab by default. +# openhab_http_port (port): Set to 8080 by default. +# openhab_https_port (port): Set to 8443 by default. +# openhab_listen_address (IP): Set to 0.0.0.0 for http/https by default. +# openhab_backup_dir (path): Set to /var/db/openhab/backups by default. +# openhab_java_opts (string): Empty by default. You can add additional java +# options like -Duser.timezone=Europe/Berlin and/or +# -Dgnu.io.rxtx.SerialPorts=/dev/cuau0 +# -Dsun.nio.fs.watchservice=polling +# openhab_home_dir (path): Set to %%PREFIX%%/libexec/openhab by default. +# openhab_conf_dir (path): Set to %%PREFIX%%/etc/openhab by default. +# openhab_runtime_dir (path): Set to %%PREFIX%%/libexec/openhab/runtime by default. +# openhab_userdata_dir (path): Set to /var/db/openhab/userdata by default. +# openhab_log_dir (path): Set to /var/log/openhab by default. + +. /etc/rc.subr + +name=openhab +rcvar=openhab_enable + +load_rc_config $name + +: ${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"} + +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}" +# for UTF-8 encoding, language can be set inside openhab: +export LC_ALL=en_US.UTF-8 +export JAVA_VERSION=11 + +pidfile=/var/run/${name}/${name}.pid + +command=/usr/sbin/daemon +command_args="-p ${pidfile} -t openhab ${OPENHAB_HOME}/start.sh server" + +openhab_stop() { + ${OPENHAB_RUNTIME}/bin/stop + if [ -e ${pidfile} ]; then + wait_for_pids $(cat ${pidfile}) + fi +} + +openhab_status() { + case "$(${OPENHAB_RUNTIME}/bin/status 2>&1)" in + "Not Running ...") + echo ${name} is not running, + ;; + "Running ...") + echo ${name} is running. + ;; + esac +} + +stop_cmd="openhab_stop" +status_cmd="openhab_status" + + +run_rc_command "$1" diff --git a/misc/openhab/openhab/files/patch-runtime_bin_setenv b/misc/openhab/openhab/files/patch-runtime_bin_setenv new file mode 100644 index 000000000000..6963e5b7e82b --- /dev/null +++ b/misc/openhab/openhab/files/patch-runtime_bin_setenv @@ -0,0 +1,12 @@ +--- runtime/bin/setenv.orig 2018-12-17 01:24:37 UTC ++++ runtime/bin/setenv +@@ -139,6 +139,9 @@ locateJava() { + if [ "x${JAVA}" = "x" ] && [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi ++ if [ "x$JAVA_HOME" = "x" ]; then ++ eval $(env JAVAVM_DRYRUN=true %%LOCALBASE%%/bin/java | grep JAVA_HOME) ++ fi + if [ "x${JAVA}" = "x" ]; then + if [ "x${JAVA_HOME}" != "x" ]; then + if [ ! -d "${JAVA_HOME}" ]; then diff --git a/misc/openhab/openhab/files/pkg-message.in b/misc/openhab/openhab/files/pkg-message.in new file mode 100644 index 000000000000..d84c9eed249f --- /dev/null +++ b/misc/openhab/openhab/files/pkg-message.in @@ -0,0 +1,34 @@ + +{ type: install + message: <