diff options
author | abs <abs@pkgsrc.org> | 2021-12-06 15:33:27 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2021-12-06 15:33:27 +0000 |
commit | bcf34ac8ea7d87e408bc0a53e8d73cd81bcc8dcf (patch) | |
tree | 89e80910e483662d5c4e5da9447431fa6fd3b9d7 /net | |
parent | 78873ddc2453f113c8c74bd5e3d26cc226741634 (diff) | |
download | pkgsrc-bcf34ac8ea7d87e408bc0a53e8d73cd81bcc8dcf.tar.gz |
Add option to choose between mongodb3 and mongodb4, default remains at mongodb3
Diffstat (limited to 'net')
-rw-r--r-- | net/unifi/Makefile | 11 | ||||
-rw-r--r-- | net/unifi/PLIST | 3 | ||||
-rw-r--r-- | net/unifi/files/README.mongodb | 20 | ||||
-rw-r--r-- | net/unifi/options.mk | 20 |
4 files changed, 48 insertions, 6 deletions
diff --git a/net/unifi/Makefile b/net/unifi/Makefile index dbeadad1c88..0faebc18875 100644 --- a/net/unifi/Makefile +++ b/net/unifi/Makefile @@ -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 library 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" diff --git a/net/unifi/PLIST b/net/unifi/PLIST index fef4ec541b1..fa15d714700 100644 --- a/net/unifi/PLIST +++ b/net/unifi/PLIST @@ -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 --git a/net/unifi/files/README.mongodb b/net/unifi/files/README.mongodb new file mode 100644 index 00000000000..3d54f293a47 --- /dev/null +++ b/net/unifi/files/README.mongodb @@ -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 --git a/net/unifi/options.mk b/net/unifi/options.mk new file mode 100644 index 00000000000..8efe63406b6 --- /dev/null +++ b/net/unifi/options.mk @@ -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 |