Sat Dec 11 17:30:07 2021 UTC ()
net/unifi: Restore mongo option lost in wip update


(gdt)
diff -r1.31 -r1.32 pkgsrc/net/unifi/Makefile

cvs diff -r1.31 -r1.32 pkgsrc/net/unifi/Makefile (expand / switch to unified diff)

--- pkgsrc/net/unifi/Makefile 2021/12/11 17:28:25 1.31
+++ pkgsrc/net/unifi/Makefile 2021/12/11 17:30:07 1.32
@@ -1,73 +1,71 @@ @@ -1,73 +1,71 @@
1# $NetBSD: Makefile,v 1.31 2021/12/11 17:28:25 gdt Exp $ 1# $NetBSD: Makefile,v 1.32 2021/12/11 17:30:07 gdt Exp $
2 2
3# Please do not drop this; a new update cycle is likely very soon. 
4DISTNAME= unifi-6.5.54 3DISTNAME= unifi-6.5.54
5CATEGORIES= net 4CATEGORIES= net
6MASTER_SITES= -http://dl.ubnt.com/unifi/${PKGVERSION_NOREV}/UniFi.unix.zip 5MASTER_SITES= -http://dl.ubnt.com/unifi/${PKGVERSION_NOREV}/UniFi.unix.zip
7EXTRACT_SUFX= .zip 6EXTRACT_SUFX= .zip
8 7
9# Updates must be tested to not only build but actually function under 8# Updates must be tested to not only build but actually function under
10# at least NetBSD 9/amd64 with actual UBNT hardware. 9# at least NetBSD 9/amd64 with actual UBNT hardware.
11MAINTAINER= gdt@NetBSD.org 10MAINTAINER= gdt@NetBSD.org
12HOMEPAGE= https://www.ubnt.com/download/unifi/ 11HOMEPAGE= https://www.ubnt.com/download/unifi/
13# The content that belongs in NEWS are often in a blog. 12# The content that belongs in NEWS are often in a blog.
14#BLOGPAGE= https://community.ui.com/releases 13#BLOGPAGE= https://community.ui.com/releases
15COMMENT= Provisioning software for network products made by Ubiquiti 14COMMENT= Provisioning software for network products made by Ubiquiti
16LICENSE= ubiquiti-license 15LICENSE= ubiquiti-license
17 16
18# Bundled firmware images cannot be redistributed 17# Bundled firmware images cannot be redistributed
19RESTRICTED= No permission to redistribute 18RESTRICTED= No permission to redistribute
20NO_BIN_ON_CDROM= ${RESTRICTED} 19NO_BIN_ON_CDROM= ${RESTRICTED}
21NO_BIN_ON_FTP= ${RESTRICTED} 20NO_BIN_ON_FTP= ${RESTRICTED}
22NO_SRC_ON_CDROM= ${RESTRICTED} 21NO_SRC_ON_CDROM= ${RESTRICTED}
23NO_SRC_ON_FTP= ${RESTRICTED} 22NO_SRC_ON_FTP= ${RESTRICTED}
24 23
25DISTFILES= ${DEFAULT_DISTFILES} 24DISTFILES= ${DEFAULT_DISTFILES}
26EXTRACT_ONLY= ${DEFAULT_DISTFILES} 25EXTRACT_ONLY= ${DEFAULT_DISTFILES}
27 26
 27
28# Unifi bundles snappy-java-1.0.5.jar, which contains native code. 28# Unifi bundles snappy-java-1.0.5.jar, which contains native code.
29# We can use the bundled snappy-java but we must recompile the native portion 29# We can use the bundled snappy-java but we must recompile the native portion
30# because it only ship linux binaries. The rcd script takes care of loading the 30# because it only ship linux binaries. The rcd script takes care of loading the
31# correct library. 31# correct library.
32SNAPPY_JAVA= snappy-java-1.0.5.4 32SNAPPY_JAVA= snappy-java-1.0.5.4
33# github.mk only works for the main MASTER_SITES definition and does 33# github.mk only works for the main MASTER_SITES definition and does
34# not support SITES 34# not support SITES
35SITES.${SNAPPY_JAVA}.tar.gz= -https://github.com/xerial/snappy-java/archive/${SNAPPY_JAVA:S/snappy-java-//}.tar.gz 35SITES.${SNAPPY_JAVA}.tar.gz= -https://github.com/xerial/snappy-java/archive/${SNAPPY_JAVA:S/snappy-java-//}.tar.gz
36DISTFILES+= ${SNAPPY_JAVA}.tar.gz 36DISTFILES+= ${SNAPPY_JAVA}.tar.gz
37EXTRACT_ONLY+= ${SNAPPY_JAVA}.tar.gz 37EXTRACT_ONLY+= ${SNAPPY_JAVA}.tar.gz
38 38
39SNAPPY= snappy-1.0.5 39SNAPPY= snappy-1.0.5
40SITES.${SNAPPY}.tar.gz= http://download.openpkg.org/components/cache/snappy/ \ 40SITES.${SNAPPY}.tar.gz= http://download.openpkg.org/components/cache/snappy/ \
41 http://ftp.NetBSD.org/pub/pkgsrc/distfiles/snappy-java10/ 41 http://ftp.NetBSD.org/pub/pkgsrc/distfiles/snappy-java10/
42DISTFILES+= ${SNAPPY}.tar.gz 42DISTFILES+= ${SNAPPY}.tar.gz
43EXTRACT_ONLY+= ${SNAPPY}.tar.gz 43EXTRACT_ONLY+= ${SNAPPY}.tar.gz
44 44
45CHECK_SHLIBS_SKIP= unifi/lib/native/* 45CHECK_SHLIBS_SKIP= unifi/lib/native/*
46INSTALLATION_DIRS= unifi 46INSTALLATION_DIRS= unifi share/doc/unifi
47 47
48# Emulated JDK doesn't work due to epoll issues. Also, would require 48# Emulated JDK doesn't work due to epoll issues. Also, would require
49# matching emulated native libraries, and we only compile actual 49# matching emulated native libraries, and we only compile actual
50# native libaries. 50# native libaries.
51# NetBSD openjdk11 fails to listen to https, so disable for now 51# NetBSD openjdk11 fails to listen to https, so disable for now
52PKG_JVMS_ACCEPTED= openjdk8 52PKG_JVMS_ACCEPTED= openjdk8
53PKGSRC_MAKE_ENV+= JAVA_HOME=${PKG_JAVA_HOME} 53PKGSRC_MAKE_ENV+= JAVA_HOME=${PKG_JAVA_HOME}
54USE_LANGUAGES= c c++ # for snappy JNI library 54USE_LANGUAGES= c c++ # for snappy JNI library
55USE_TOOLS+= gmake pax 55USE_TOOLS+= gmake pax
56WRKSRC= ${WRKDIR} 56WRKSRC= ${WRKDIR}
57 57
58# Upstream documents 3.4.15, but 3.4.4 actually works. Avoid mongodb4 because it 58.include "options.mk"
59# has a problematic license. 
60DEPENDS+= mongodb>=3.4.4:../../databases/mongodb3 
61 59
62FILES_SUBST+= UNIFI_USER=${UNIFI_USER:Q} UNIFI_GROUP=${UNIFI_GROUP:Q} 60FILES_SUBST+= UNIFI_USER=${UNIFI_USER:Q} UNIFI_GROUP=${UNIFI_GROUP:Q}
63FILES_SUBST+= JAVA=${PKG_JAVA_HOME}/bin/java 61FILES_SUBST+= JAVA=${PKG_JAVA_HOME}/bin/java
64RCD_SCRIPTS= unifi 62RCD_SCRIPTS= unifi
65UNIFI_USER?= unifi 63UNIFI_USER?= unifi
66UNIFI_GROUP?= unifi 64UNIFI_GROUP?= unifi
67PKG_USERS_VARS= UNIFI_USER 65PKG_USERS_VARS= UNIFI_USER
68PKG_GROUPS_VARS= UNIFI_GROUP 66PKG_GROUPS_VARS= UNIFI_GROUP
69PKG_GROUPS= ${UNIFI_GROUP} 67PKG_GROUPS= ${UNIFI_GROUP}
70PKG_USERS= ${UNIFI_USER}:${UNIFI_GROUP} 68PKG_USERS= ${UNIFI_USER}:${UNIFI_GROUP}
71 69
72.for d in data logs run work 70.for d in data logs run work
73OWN_DIRS_PERMS+= ${PREFIX}/unifi/${d} ${UNIFI_USER} ${UNIFI_GROUP} 0700 71OWN_DIRS_PERMS+= ${PREFIX}/unifi/${d} ${UNIFI_USER} ${UNIFI_GROUP} 0700
@@ -104,16 +102,17 @@ post-extract: @@ -104,16 +102,17 @@ post-extract:
104 rm -rf ${WRKDIR}/UniFi/lib/native/Mac/x86_64 102 rm -rf ${WRKDIR}/UniFi/lib/native/Mac/x86_64
105. endif 103. endif
106.endif 104.endif
107 105
108do-build: 106do-build:
109# bundled mongod is a linux binary; replace with symlink to native binary 107# bundled mongod is a linux binary; replace with symlink to native binary
110 rm -f ${WRKSRC}/UniFi/bin/mongod 108 rm -f ${WRKSRC}/UniFi/bin/mongod
111 ln -s ${PREFIX}/bin/mongod ${WRKSRC}/UniFi/bin/mongod 109 ln -s ${PREFIX}/bin/mongod ${WRKSRC}/UniFi/bin/mongod
112 cd ${WRKDIR}/${SNAPPY_JAVA} && ${BUILD_MAKE_CMD} native 110 cd ${WRKDIR}/${SNAPPY_JAVA} && ${BUILD_MAKE_CMD} native
113 111
114do-install: 112do-install:
115 cd ${WRKSRC}/UniFi && pax -rw . ${DESTDIR}${PREFIX}/unifi 113 cd ${WRKSRC}/UniFi && pax -rw . ${DESTDIR}${PREFIX}/unifi
116 ${INSTALL_LIB} ${WRKDIR}/${SNAPPY_JAVA}/target/snappy-1.0.5-Default/libsnappyjava.so ${DESTDIR}${PREFIX}/unifi/lib 114 ${INSTALL_LIB} ${WRKDIR}/${SNAPPY_JAVA}/target/snappy-1.0.5-Default/libsnappyjava.so ${DESTDIR}${PREFIX}/unifi/lib
 115 ${INSTALL_DATA} ${FILESDIR}/README.mongodb ${DESTDIR}${PREFIX}/share/doc/unifi
117 116
118.include "../../mk/java-vm.mk" 117.include "../../mk/java-vm.mk"
119.include "../../mk/bsd.pkg.mk" 118.include "../../mk/bsd.pkg.mk"