pkgsrc-Changes archive

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

CVS commit: pkgsrc/net/unifi



Module Name:    pkgsrc
Committed By:   abs
Date:           Mon Dec  6 15:33:28 UTC 2021

Modified Files:
        pkgsrc/net/unifi: Makefile PLIST
Added Files:
        pkgsrc/net/unifi: options.mk
        pkgsrc/net/unifi/files: README.mongodb

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


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 pkgsrc/net/unifi/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/net/unifi/PLIST
cvs rdiff -u -r0 -r1.1 pkgsrc/net/unifi/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/net/unifi/files/README.mongodb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/unifi/Makefile
diff -u pkgsrc/net/unifi/Makefile:1.29 pkgsrc/net/unifi/Makefile:1.30
--- pkgsrc/net/unifi/Makefile:1.29      Tue Sep  7 00:53:57 2021
+++ pkgsrc/net/unifi/Makefile   Mon Dec  6 15:33:27 2021
@@ -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 @@ NO_SRC_ON_FTP=                ${RESTRICTED}
 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 @@ DISTFILES+=           ${SNAPPY}.tar.gz
 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_LANGUAGES=                c c++   # for snappy JNI l
 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-build:
 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"

Index: pkgsrc/net/unifi/PLIST
diff -u pkgsrc/net/unifi/PLIST:1.13 pkgsrc/net/unifi/PLIST:1.14
--- pkgsrc/net/unifi/PLIST:1.13 Tue Sep  7 00:53:57 2021
+++ pkgsrc/net/unifi/PLIST      Mon Dec  6 15:33:27 2021
@@ -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

Added files:

Index: pkgsrc/net/unifi/options.mk
diff -u /dev/null pkgsrc/net/unifi/options.mk:1.1
--- /dev/null   Mon Dec  6 15:33:28 2021
+++ pkgsrc/net/unifi/options.mk Mon Dec  6 15:33:27 2021
@@ -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

Index: pkgsrc/net/unifi/files/README.mongodb
diff -u /dev/null pkgsrc/net/unifi/files/README.mongodb:1.1
--- /dev/null   Mon Dec  6 15:33:28 2021
+++ pkgsrc/net/unifi/files/README.mongodb       Mon Dec  6 15:33:28 2021
@@ -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



Home | Main Index | Thread Index | Old Index