aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/unifi-devel/Makefile
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2018-02-04 14:01:50 +0000
committerMark Felder <feld@FreeBSD.org>2018-02-04 14:01:50 +0000
commit4917e3305196b7fccd33e6be0c75e695a7de5ad8 (patch)
treef748f984bc57082698c6158a1fa4e411be31f7f6 /net-mgmt/unifi-devel/Makefile
parent2d34d654aed13779f57ff3f5868fbabde94939f9 (diff)
downloadports-4917e3305196b7fccd33e6be0c75e695a7de5ad8.tar.gz
ports-4917e3305196b7fccd33e6be0c75e695a7de5ad8.zip
Notes
Diffstat (limited to 'net-mgmt/unifi-devel/Makefile')
-rw-r--r--net-mgmt/unifi-devel/Makefile75
1 files changed, 75 insertions, 0 deletions
diff --git a/net-mgmt/unifi-devel/Makefile b/net-mgmt/unifi-devel/Makefile
new file mode 100644
index 000000000000..756d7634fde3
--- /dev/null
+++ b/net-mgmt/unifi-devel/Makefile
@@ -0,0 +1,75 @@
+# Created by: Alban MAIRE <a.maire@s2mi.fr>
+# $FreeBSD$
+
+PORTNAME= unifi
+PORTVERSION= 5.7.15
+PORTREVISION= 0
+CATEGORIES= net-mgmt java
+MASTER_SITES= http://dl.ubnt.com/unifi/${PORTVERSION}-${UNIFI_BUILD}/
+PKGNAMESUFFIX= -devel
+DISTNAME= unifi_sysvinit_all
+EXTRACT_SUFX= .deb
+DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= feld@FreeBSD.org
+COMMENT= UniFi Controller v5
+
+RUN_DEPENDS= mongodb>0:databases/mongodb \
+ snappyjava>0:archivers/snappy-java
+
+SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS} JAVASHAREDIR=${JAVASHAREDIR} \
+ JAVA=${JAVA}
+
+EXTRACT_CMD= /usr/bin/ar
+EXTRACT_BEFORE_ARGS= -p
+EXTRACT_AFTER_ARGS= data.tar.xz | ${TAR} -xf -
+
+UNIFI_BUILD= e9b882be05
+
+CONFLICTS= unifi5-*
+
+USES= cpe
+CPE_VENDOR= ubnt
+CPE_PRODUCT= unifi_controller
+USE_JAVA= yes
+JAVA_VERSION= 1.8
+JAVA_OS= native
+JAVA_VENDOR= openjdk bsdjava
+JAVA_RUN= yes
+
+NO_BUILD= yes
+NO_ARCH= yes
+
+USE_RC_SUBR= unifi
+
+USERS= unifi
+GROUPS= unifi
+
+NO_WRKSUBDIR= yes
+
+CONFLICTS= unifi2-* unifi3-* unifi4-*
+
+DIR_LIST= conf data logs run work
+
+post-patch:
+ ${RM} ${WRKSRC}/usr/lib/unifi/lib/snappy-java-1.1.2.6.jar ${WRKSRC}/usr/lib/unifi/bin/*
+ (cd ${WRKSRC}/usr/lib/unifi/lib && ${LN} -s ${JAVAJARDIR}/snappy-java.jar snappy-java-1.1.2.6.jar)
+ ${RM} -r ${WRKSRC}/usr/lib/unifi/lib/native
+
+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
+
+post-install:
+ @${FIND} -s ${STAGEDIR}${JAVASHAREDIR}/unifi -not -type d | ${SORT} | \
+ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
+.for dir in ${DIR_LIST}
+ @${ECHO} "@dir(unifi,wheel,) ${JAVASHAREDIR}/unifi/${dir}" >> ${TMPPLIST}
+.endfor
+
+.include <bsd.port.mk>