git: 99b47104381e - main - net-im/jicofo: update to 1.0-877

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Tue, 24 May 2022 03:03:12 UTC
The branch main has been updated by acm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=99b47104381ee9f1e42c7da8c416ff194aef960c

commit 99b47104381ee9f1e42c7da8c416ff194aef960c
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2022-05-24 02:47:00 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2022-05-24 02:47:00 +0000

    net-im/jicofo: update to 1.0-877
    
    - Add config samples
    - Now jicofo daemon is init using jicofo user
    - Modify pkg-message file
    PR:             257232
    Reported by:    grembo
---
 net-im/jicofo/Makefile                 | 34 ++++++++++-------------
 net-im/jicofo/distinfo                 | 10 +++----
 net-im/jicofo/files/jicofo.conf.sample | 21 ++++++++++++++
 net-im/jicofo/files/jicofo.in          | 51 +++++++++++++++++-----------------
 net-im/jicofo/files/pkg-message.in     | 10 +++++--
 net-im/jicofo/pkg-plist                |  5 ++++
 6 files changed, 78 insertions(+), 53 deletions(-)

diff --git a/net-im/jicofo/Makefile b/net-im/jicofo/Makefile
index 2307a54167bb..c0987d08eee1 100644
--- a/net-im/jicofo/Makefile
+++ b/net-im/jicofo/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	jicofo
-DISTVERSION=	1.0-555
-PORTREVISION=	2
+DISTVERSION=	1.0-877
 CATEGORIES=	net-im java
 
 MAINTAINER=	acm@FreeBSD.org
@@ -8,20 +7,24 @@ COMMENT=	Server side focus component used in Jitsi Meet conferences
 
 LICENSE=	APACHE20
 
-BUILD_DEPENDS=	${LOCALBASE}/share/java/maven/bin/mvn:devel/maven
-
 ONLY_FOR_ARCHS=	i386 amd64 powerpc64 powerpc64le
 
+BUILD_DEPENDS=	${LOCALBASE}/share/java/maven/bin/mvn:devel/maven
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	jitsi
-GH_TAGNAME=	ec1b29e
+GH_TAGNAME=	d8cca3d
 USE_JAVA=	yes
+JAVA_VERSION=	11
 
 USE_RC_SUBR=	${PORTNAME}
 SUB_FILES+=	pkg-message
 SUB_LIST+=	JAVA=${JAVA}
 ETCDIR=		${PREFIX}/etc/jitsi/jicofo
 
+USERS=		${PORTNAME} jitsi
+GROUPS=		${USERS}
+
 DEV_UPDATE_MODE=	no
 
 .if (${DEV_UPDATE_MODE} == "yes")
@@ -29,7 +32,8 @@ post-build:
 	@cd ${WRKDIR} && ${TAR} czf ${DISTDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX} m2
 	@${ECHO} "(!!!) Please upload the maven deps archive: ${DISTDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX}"
 .else
-MASTER_SITES+=	LOCAL/acm/:maven
+MASTER_SITES+=	LOCAL/acm/:maven \
+		LOCAL/grembo/:maven
 DISTFILES+=	${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX}:maven
 MAVEN_ARGS=	--offline
 .endif
@@ -39,7 +43,7 @@ MAVEN_REPO=	-Dmaven.repo.local=${WRKDIR}/m2
 
 do-build:
 	cd ${WRKSRC}; \
-		${SETENV} mvn ${MAVEN_REPO} ${MAVEN_ARGS} package
+		${SETENV} JAVA_VERSION=${JAVA_VERSION} mvn ${MAVEN_REPO} ${MAVEN_ARGS} package
 
 do-install:
 	@${MKDIR} ${STAGEDIR}${ETCDIR}
@@ -47,17 +51,9 @@ do-install:
 	cd ${WRKSRC}/lib \
 		&& ${FIND} . -type f -exec ${INSTALL_DATA} {} ${STAGEDIR}${DATADIR}/lib/{} \;
 
-	@(echo "JVB_XMPP_HOST=localhost"; \
-	echo "JVB_XMPP_DOMAIN=jitsi.example.com"; \
-	echo "JVB_XMPP_PORT=5347"; \
-	echo "JVB_XMPP_SECRET=YOURSECRET3"; \
-	echo "JVB_XMPP_USER_DOMAIN=auth.jitsi.example.com"; \
-	echo "JVB_XMPP_USER_NAME=focus"; \
-	echo "JVB_XMPP_USER_SECRET=YOURSECRET3"; \
-        echo ""; \
-        echo "MAX_MEMORY=3072m"; \
-        ) > ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample
-
-	${INSTALL_DATA} ${WRKSRC}/target/${PORTNAME}-1.1-SNAPSHOT-jar-with-dependencies.jar ${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar
+	${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf.sample \
+		${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample
+	${INSTALL_DATA} ${WRKSRC}/target/${PORTNAME}-1.1-SNAPSHOT-jar-with-dependencies.jar \
+		${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar
  	
 .include <bsd.port.mk>
diff --git a/net-im/jicofo/distinfo b/net-im/jicofo/distinfo
index f12f47f24e12..8f212255c0fc 100644
--- a/net-im/jicofo/distinfo
+++ b/net-im/jicofo/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1587854975
-SHA256 (jicofo-1.0-555-deps.tar.gz) = 25cb5f8263922415c07f83daf4b4c3d3ff387f0344fda9bfdf4787d4951c4b88
-SIZE (jicofo-1.0-555-deps.tar.gz) = 122309690
-SHA256 (jitsi-jicofo-1.0-555-ec1b29e_GH0.tar.gz) = 6d0222aebdff1d32397d462b97f12c190505e5526fb8a140944192f6685264ca
-SIZE (jitsi-jicofo-1.0-555-ec1b29e_GH0.tar.gz) = 291752
+TIMESTAMP = 1653264341
+SHA256 (jicofo-1.0-877-deps.tar.gz) = 4d98c46192101c632f5c9ed7b82fae3e2b168b4f4a9569afeeaba37a4e387858
+SIZE (jicofo-1.0-877-deps.tar.gz) = 146671715
+SHA256 (jitsi-jicofo-1.0-877-d8cca3d_GH0.tar.gz) = 1749da8f3fbb93e7f297e7312838d7ffdec37d43a9462bdcd155dad367f1f640
+SIZE (jitsi-jicofo-1.0-877-d8cca3d_GH0.tar.gz) = 232999
diff --git a/net-im/jicofo/files/jicofo.conf.sample b/net-im/jicofo/files/jicofo.conf.sample
new file mode 100644
index 000000000000..1da3a21a2520
--- /dev/null
+++ b/net-im/jicofo/files/jicofo.conf.sample
@@ -0,0 +1,21 @@
+jicofo {
+  bridge {
+    brewery-jid = "JvbBrewery@internal.auth.jitsi.example.com"
+  }
+
+  sctp {
+    enabled = false
+  }
+
+  xmpp {
+    client {
+      enabled = true
+      hostname = "localhost"
+      port = 5222
+      domain = "auth.jitsi.example.com"
+      username = "focus"
+      password = "supersecret"
+      conference-muc-jid = "conference.jitsi.example.com"
+    }
+  }
+}
diff --git a/net-im/jicofo/files/jicofo.in b/net-im/jicofo/files/jicofo.in
index f2d1bfd50794..0076f7a348c6 100644
--- a/net-im/jicofo/files/jicofo.in
+++ b/net-im/jicofo/files/jicofo.in
@@ -7,6 +7,7 @@
 # Configuration settings for jicofo in /etc/rc.conf:
 #
 # jicofo_enable:	run jicofo server (default=NO)
+# jicofo_maxmem:	maximum memory used (default=3072m)
 # jicofo_flags:		additional flags for jicofo server (default="")
 #
 
@@ -15,19 +16,21 @@
 name="jicofo"
 rcvar=${name}_enable
 
-jicofo_env_file="%%ETCDIR%%/jicofo.conf"
+jicofo_config="%%ETCDIR%%/jicofo.conf"
 jicofo_jar="%%JAVAJARDIR%%/jicofo.jar"
 jicofo_logging_config="%%DATADIR%%/lib/logging.properties"
 jicofo_trust_store="%%ETCDIR%%/truststore.jks"
+jicofo_user="${name}"
 
 load_rc_config "${name}"
 
 : ${jicofo_enable="NO"}
+: ${jicofo_maxmem="3072m"}
 : ${jicofo_flags=""}
 
 command="%%JAVA%%"
 pidfile="/var/run/jicofo.pid"
-required_files="${jicofo_env_file} ${jicofo_trust_store}"
+required_files="${jicofo_config} ${jicofo_trust_store}"
 
 start_cmd=${name}_start
 stop_cmd=${name}_stop
@@ -36,51 +39,47 @@ restart_cmd=${name}_restart
 
 jicofo_start()
 {
-	daemon -p ${pidfile} -o /var/log/${name}.log \
-		${command} -Xmx${MAX_MEMORY} \
+	daemon -u ${jicofo_user} -p ${pidfile} -o /var/log/${name}.log \
+		${command} -Xmx${jicofo_maxmem} \
                 -XX:+HeapDumpOnOutOfMemoryError \
                 -XX:HeapDumpPath=/tmp \
                 -Djava.util.logging.config.file=${jicofo_logging_config} \
                 -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=%%LOCALBASE%%/etc/jitsi \
                 -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo \
                 -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/ \
+		-Dconfig.file=${jicofo_config} \
 		-Djavax.net.ssl.trustStore=${jicofo_trust_store} \
                 -cp ${jicofo_jar} \
                 org.jitsi.jicofo.Main \
-                --host=${JVB_XMPP_HOST} \
-                --domain=${JVB_XMPP_DOMAIN} \
-                --port=${JVB_XMPP_PORT} \
-                --secret=${JVB_XMPP_SECRET} \
-		--user_domain=${JVB_XMPP_USER_DOMAIN} \
-		--user_name=${JVB_XMPP_USER_NAME} \
-		--user_password=${JVB_XMPP_USER_SECRET} ${jicofo_flags}
-		echo "Started"
+		${jicofo_flags}
+
+		echo "Starting ${name}"
 }
 
 jicofo_stop()
 {
-        if [ -f ${pidfile} ]
-        then
-                kill `cat ${pidfile}`
-                rm ${pidfile}
-		echo "Stopped"
-        fi
+	if [ -f ${pidfile} ]
+	then
+		kill `cat ${pidfile}`
+		rm ${pidfile}
+		echo "Stopping ${name}"
+	fi
 }
 
 jicofo_status()
 {
-        # If running, show pid
-        if [ -f ${pidfile} ]
-        then
-                echo "${name} is running as pid" `cat ${pidfile}`
-        else
-                echo "${name} is not running"
-        fi
+	# If running, show pid
+	if [ -f ${pidfile} ]
+	then
+		echo "${name} is running as pid" `cat ${pidfile}`
+	else
+		echo "${name} is not running"
+	fi
 }
 
 jicofo_restart()
 {
-	echo "Performing restart"
+	echo "Performing restart: ${name}"
 	jicofo_stop
 	sleep 5
 	jicofo_start
diff --git a/net-im/jicofo/files/pkg-message.in b/net-im/jicofo/files/pkg-message.in
index 8ed474246bdd..d06603a5b3d3 100644
--- a/net-im/jicofo/files/pkg-message.in
+++ b/net-im/jicofo/files/pkg-message.in
@@ -3,20 +3,24 @@
   message: <<EOM
 Jitsi Conference Focus was installed
 
-1) The configuration file is used by the startup rcfile and located at:
+1) Edit the configuration file located at:
 
    %%ETCDIR%%/jicofo.conf
 
-2) Add jicofo_enable="YES" to /etc/rc.conf.
+2) Enable the service:
+
+   # service jicofo enable
 
 3) For use of jicofo with net-im/prosody, you need to import prosody's
    auth.jitsi.example.com TLS certificate into a Java truststore.
+   You should also install net-im/jitsi-prosody-plugins.
    The startup rcfile will pass this filename to jicofo:
    %%ETCDIR%%/truststore.jks - for example:
 
    # prosodyctl cert generate jitsi.example.com
    # prosodyctl cert generate auth.jitsi.example.com
-   # keytool -noprompt -keystore %%ETCDIR%%/truststore.jks -importcert -alias prosody -file /path/to/prosody/auth.jitsi.example.com.crt
+   # keytool -noprompt -keystore %%ETCDIR%%/truststore.jks -importcert \
+	-alias prosody -file /path/to/prosody/auth.jitsi.example.com.crt
 
 4) Enjoy it
 EOM
diff --git a/net-im/jicofo/pkg-plist b/net-im/jicofo/pkg-plist
index c6e558860bcc..074ed1299be6 100644
--- a/net-im/jicofo/pkg-plist
+++ b/net-im/jicofo/pkg-plist
@@ -1,3 +1,8 @@
+@owner jicofo
+@group jitsi
 @sample %%ETCDIR%%/jicofo.conf.sample
 %%JAVAJARDIR%%/jicofo.jar
 %%DATADIR%%/lib/logging.properties
+@dir(jicofo,jitsi,750) %%ETCDIR%%
+@owner
+@group