pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/unifi Add option to choose between mongodb3 and mo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c57f2f5053a5
branches:  trunk
changeset: 770667:c57f2f5053a5
user:      abs <abs%pkgsrc.org@localhost>
date:      Mon Dec 06 15:33:27 2021 +0000

description:
Add option to choose between mongodb3 and mongodb4, default remains at mongodb3

diffstat:

 net/unifi/Makefile             |  11 ++++++-----
 net/unifi/PLIST                |   3 ++-
 net/unifi/files/README.mongodb |  20 ++++++++++++++++++++
 net/unifi/options.mk           |  20 ++++++++++++++++++++
 4 files changed, 48 insertions(+), 6 deletions(-)

diffs (106 lines):

diff -r 88fec8c31cbb -r c57f2f5053a5 net/unifi/Makefile
--- a/net/unifi/Makefile        Mon Dec 06 15:32:25 2021 +0000
+++ b/net/unifi/Makefile        Mon Dec 06 15:33:27 2021 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.29 2021/09/07 00:53:57 gdt Exp $
+# $NetBSD: Makefile,v 1.30 2021/12/06 15:33:27 abs Exp $
 
 DISTNAME=      unifi-6.2.26
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  -http://dl.ubnt.com/unifi/${PKGVERSION_NOREV}/UniFi.unix.zip
 EXTRACT_SUFX=  .zip
@@ -24,6 +25,7 @@
 DISTFILES=             ${DEFAULT_DISTFILES}
 EXTRACT_ONLY=          ${DEFAULT_DISTFILES}
 
+
 # Unifi bundles snappy-java-1.0.5.jar, which contains native code.
 # We can use the bundled snappy-java but we must recompile the native portion
 # because it only ship linux binaries. The rcd script takes care of loading the
@@ -42,7 +44,7 @@
 EXTRACT_ONLY+=         ${SNAPPY}.tar.gz
 
 CHECK_SHLIBS_SKIP=     unifi/lib/native/*
-INSTALLATION_DIRS=     unifi
+INSTALLATION_DIRS=     unifi share/doc/unifi
 
 # Emulated JDK doesn't work due to epoll issues.  Also, would require
 # matching emulated native libraries, and we only compile actual
@@ -54,9 +56,7 @@
 USE_TOOLS+=            gmake pax
 WRKSRC=                        ${WRKDIR}
 
-# Upstream documents 3.4.15, but 3.4.4 actually works.  Avoid mongodb4 because it
-# has a problematic license.
-DEPENDS+=              mongodb>=3.4.4:../../databases/mongodb3
+.include "options.mk"
 
 FILES_SUBST+=          UNIFI_USER=${UNIFI_USER:Q} UNIFI_GROUP=${UNIFI_GROUP:Q}
 FILES_SUBST+=          JAVA=${PKG_JAVA_HOME}/bin/java
@@ -113,6 +113,7 @@
 do-install:
        cd ${WRKSRC}/UniFi && pax -rw . ${DESTDIR}${PREFIX}/unifi
        ${INSTALL_LIB} ${WRKDIR}/${SNAPPY_JAVA}/target/snappy-1.0.5-Default/libsnappyjava.so ${DESTDIR}${PREFIX}/unifi/lib
+       ${INSTALL_DATA} ${FILESDIR}/README.mongodb ${DESTDIR}${PREFIX}/share/doc/unifi
 
 .include "../../mk/java-vm.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 88fec8c31cbb -r c57f2f5053a5 net/unifi/PLIST
--- a/net/unifi/PLIST   Mon Dec 06 15:32:25 2021 +0000
+++ b/net/unifi/PLIST   Mon Dec 06 15:33:27 2021 +0000
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.13 2021/09/07 00:53:57 gdt Exp $
+@comment $NetBSD: PLIST,v 1.14 2021/12/06 15:33:27 abs Exp $
+share/doc/unifi/README.mongodb
 unifi/bin/mongod
 unifi/dl/firmware/bundles.json
 unifi/lib/ace.jar
diff -r 88fec8c31cbb -r c57f2f5053a5 net/unifi/files/README.mongodb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unifi/files/README.mongodb    Mon Dec 06 15:33:27 2021 +0000
@@ -0,0 +1,20 @@
+Ubiquiti recommends using mongodb 3.6 with Unifi.
+
+Unifi in pkgsrc can use either mongodb3 or mongodb4
+- mongodb3 (the default, and the last 3.4 version of mongodb before
+  the switch to server-side-public-license)
+- mongodb4 (requires the 'new' server-side-public-license, and
+  is not officially supported by Ubiquiti)
+
+Recommended process of switching between them:
+- Login to unifi, and download a full backup
+- Shut down unifi
+- Install new unifi version
+- Rename away the old unifi/data directory (this also provides
+  a rollback option if you need to revert) & create new empty data
+  directory
+- Start up unifi
+- If you have customised data/system.properties for unifi.http.port
+  and similar, shut down unifi (now that a new data/system.properties
+  is present), merge the changes across in an editor then start unifi
+- Go to the web interface and select upload backup
diff -r 88fec8c31cbb -r c57f2f5053a5 net/unifi/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/unifi/options.mk      Mon Dec 06 15:33:27 2021 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: options.mk,v 1.1 2021/12/06 15:33:27 abs Exp $
+
+PKG_OPTIONS_VAR=               PKG_OPTIONS.unifi
+PKG_OPTIONS_GROUP.mongodb=     mongodb3 mongodb4
+PKG_OPTIONS_REQUIRED_GROUPS=   mongodb
+PKG_SUGGESTED_OPTIONS=         mongodb3
+
+.include "../../mk/bsd.options.mk"
+
+# Upstream recommends 3.6, but 3.4.4 is the last version before the
+# switch to server-side-public-license, and works fine
+.if !empty(PKG_OPTIONS:Mmongodb3)
+DEPENDS+=              mongodb>=3.4.4:../../databases/mongodb3
+.endif
+
+# For those happy with server-side-public-license
+# Note a backup/restore is required when switching versions
+.if !empty(PKG_OPTIONS:Mmongodb4)
+DEPENDS+=              mongodb>=4.0:../../databases/mongodb
+.endif



Home | Main Index | Thread Index | Old Index