git: 32bf8b42bae4 - main - net-mgmt/unifi7: Update to 7.1.61

From: Juraj Lutter <otis_at_FreeBSD.org>
Date: Thu, 28 Apr 2022 21:42:47 UTC
The branch main has been updated by otis:

URL: https://cgit.FreeBSD.org/ports/commit/?id=32bf8b42bae48917c2ff2edd28a78900f8310f47

commit 32bf8b42bae48917c2ff2edd28a78900f8310f47
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2022-04-28 20:34:24 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2022-04-28 21:41:57 +0000

    net-mgmt/unifi7: Update to 7.1.61
    
    - Update to 7.1.61
    - And while here, also allow for external MongoDB server (suggested
      by Peter Kubica <peter@kubica.ch>)
---
 net-mgmt/unifi7/Makefile                   | 18 +++++++++++++-----
 net-mgmt/unifi7/distinfo                   | 10 +++++-----
 net-mgmt/unifi7/files/pkg-message.extdb.in | 19 +++++++++++++++++++
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/net-mgmt/unifi7/Makefile b/net-mgmt/unifi7/Makefile
index 2707a4a217bf..fec57d9d76e2 100644
--- a/net-mgmt/unifi7/Makefile
+++ b/net-mgmt/unifi7/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	unifi7
-PORTVERSION=	7.0.23
+PORTVERSION=	7.1.61
 CATEGORIES=	net-mgmt java
 MASTER_SITES=	http://dl.ubnt.com/unifi/%SUBDIR%/:unifi \
 		https://repo1.maven.org/maven2/%SUBDIR%/:jax
@@ -11,10 +11,9 @@ DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
 EXTRACT_ONLY=	unifi_sysvinit_all.deb
 
 MAINTAINER=	otis@FreeBSD.org
-COMMENT=	UniFi Controller v6
+COMMENT=	UniFi Controller v7
 
-RUN_DEPENDS=	mongodb36>0:databases/mongodb36 \
-		snappyjava>0:archivers/snappy-java
+RUN_DEPENDS=	snappyjava>0:archivers/snappy-java
 
 USES=		cpe
 
@@ -46,6 +45,13 @@ NO_WRKSUBDIR=	yes
 USERS=		unifi
 GROUPS=		unifi
 
+OPTIONS_DEFINE=	EXTERNALDB
+
+EXTERNALDB_DESC=	Use external MongoDB server
+EXTERNALDB_VARS=	PKGMESSAGE=${WRKSRC}/pkg-message.extdb \
+			SUB_FILES+=pkg-message.extdb
+EXTERNALDB_VARS_OFF=	RUN_DEPENDS+=mongodb36>0:databases/mongodb36
+
 _DIR_LIST=	conf data logs run work
 _JAX_DISTNAME=	javax.activation-api
 _JAX_VERSION=	1.2.0
@@ -63,12 +69,14 @@ do-install:
 	${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/unifi
 	(cd ${WRKSRC}/usr/lib/unifi && \
 		${COPYTREE_SHARE} \* ${STAGEDIR}${JAVASHAREDIR}/unifi/)
-	${LN} -sf ${PREFIX}/bin/mongod ${STAGEDIR}${JAVASHAREDIR}/unifi/bin/mongod
 # Create directories that will be writable by unifi
 .for i in data logs run work
 	${MKDIR} ${STAGEDIR}/${JAVASHAREDIR}/unifi/${i}
 .endfor
 
+do-install-EXTERNALDB-off:
+	${LN} -sf ${PREFIX}/bin/mongod ${STAGEDIR}${JAVASHAREDIR}/unifi/bin/mongod
+
 post-install:
 	@${FIND} -s ${STAGEDIR}${JAVASHAREDIR}/unifi -not -type d | \
 		${SORT} | ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
diff --git a/net-mgmt/unifi7/distinfo b/net-mgmt/unifi7/distinfo
index 263fe39bbc33..2bdd1b633ecf 100644
--- a/net-mgmt/unifi7/distinfo
+++ b/net-mgmt/unifi7/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1646325635
-SHA256 (unifi7-7.0.23/unifi_sysvinit_all.deb) = bcf6abe39f1386a7730204675076ad6b2deeaae97f67c977370aaf4797005ff8
-SIZE (unifi7-7.0.23/unifi_sysvinit_all.deb) = 136272532
-SHA256 (unifi7-7.0.23/javax.activation-api-1.2.0.jar) = 43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393
-SIZE (unifi7-7.0.23/javax.activation-api-1.2.0.jar) = 56674
+TIMESTAMP = 1651177355
+SHA256 (unifi7-7.1.61/unifi_sysvinit_all.deb) = ec073c0639412c2b25494e8864ad04b6178acf80ad1fbb5c991f09dab50661bb
+SIZE (unifi7-7.1.61/unifi_sysvinit_all.deb) = 176429490
+SHA256 (unifi7-7.1.61/javax.activation-api-1.2.0.jar) = 43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393
+SIZE (unifi7-7.1.61/javax.activation-api-1.2.0.jar) = 56674
diff --git a/net-mgmt/unifi7/files/pkg-message.extdb.in b/net-mgmt/unifi7/files/pkg-message.extdb.in
new file mode 100644
index 000000000000..945b333966c7
--- /dev/null
+++ b/net-mgmt/unifi7/files/pkg-message.extdb.in
@@ -0,0 +1,19 @@
+[
+{ type: install
+  message: <<EOM
+In order to use the external MongoDB server, put the following lines
+into %%JAVASHAREDIR%%/unifi/data/system.properties file:
+
+db.mongo.local=false
+db.mongo.uri=mongodb://ubnt:password@IP_ADDRESS:PORT/unifi-test
+statdb.mongo.uri=mongodb://ubnt:password@IP_ADDRESS:PORT/unifi-test_stat
+unifi.db.name=unifi-test
+
+Adjust username, password, IP_ADDRESS, PORT and database name
+according to your needs.
+
+For more information see:
+https://community.ui.com/questions/External-MongoDB-Server/d311a8f8-43b6-4aeb-859d-eefec9dc1bbc
+EOM
+}
+]