Date: Sun, 4 Feb 2018 14:01:50 +0000 (UTC) From: Mark Felder <feld@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r460932 - in head/net-mgmt: . unifi-devel unifi-devel/files Message-ID: <201802041401.w14E1ov7040831@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: feld Date: Sun Feb 4 14:01:50 2018 New Revision: 460932 URL: https://svnweb.freebsd.org/changeset/ports/460932 Log: The UniFi Controller allows you to manage Wireless, Routing & Switching, VoIP and Video of Ubiquiti Networks. This port tracks the development releases. WWW: http://wiki.ubnt.com/UniFi_FAQ PR: 223401 Added: head/net-mgmt/unifi-devel/ head/net-mgmt/unifi-devel/Makefile (contents, props changed) head/net-mgmt/unifi-devel/distinfo (contents, props changed) head/net-mgmt/unifi-devel/files/ head/net-mgmt/unifi-devel/files/unifi.in (contents, props changed) head/net-mgmt/unifi-devel/pkg-descr (contents, props changed) Modified: head/net-mgmt/Makefile Modified: head/net-mgmt/Makefile ============================================================================== --- head/net-mgmt/Makefile Sun Feb 4 13:58:47 2018 (r460931) +++ head/net-mgmt/Makefile Sun Feb 4 14:01:50 2018 (r460932) @@ -366,6 +366,7 @@ SUBDIR += torrus SUBDIR += triton-guesttools SUBDIR += unbound_exporter + SUBDIR += unifi-devel SUBDIR += unifi5 SUBDIR += victorops-nagios SUBDIR += vidalia Added: head/net-mgmt/unifi-devel/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/unifi-devel/Makefile Sun Feb 4 14:01:50 2018 (r460932) @@ -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> Added: head/net-mgmt/unifi-devel/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/unifi-devel/distinfo Sun Feb 4 14:01:50 2018 (r460932) @@ -0,0 +1,3 @@ +TIMESTAMP = 1517752289 +SHA256 (unifi-5.7.15/unifi_sysvinit_all.deb) = 93684bcc311bd56ab74765e7b78bba9689f760d3457f044d3284c32a0f6fa820 +SIZE (unifi-5.7.15/unifi_sysvinit_all.deb) = 63651966 Added: head/net-mgmt/unifi-devel/files/unifi.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/unifi-devel/files/unifi.in Sun Feb 4 14:01:50 2018 (r460932) @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Created by: Mark Felder <feld@FreeBSD.org> +# $FreeBSD$ +# + +# PROVIDE: unifi +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable `unifi': +# +# unifi_enable="YES" + +. /etc/rc.subr +name=unifi + +rcvar=unifi_enable +load_rc_config ${name} + +: ${unifi_enable:=NO} +: ${unifi_user:=%%USERS%%} +: ${unifi_group:=%%GROUPS%%} +: ${unifi_chdir=%%JAVASHAREDIR%%/unifi} +: ${unifi_javaflags:="-Djava.awt.headless=true -Xmx1024M"} + +pidfile="/var/run/unifi/${name}.pid" +procname=%%JAVA%% +command="/usr/sbin/daemon" +command_args="-f -p ${pidfile} %%JAVA%% ${unifi_javaflags} -jar lib/ace.jar start" +start_precmd=start_precmd +stop_precmd=stop_precmd +stop_postcmd=stop_postcmd + +start_precmd() +{ + if [ ! -e /var/run/unifi ] ; then + install -d -o %%USERS%% -g %%GROUPS%% /var/run/unifi; + fi +} + +stop_precmd() +{ + if [ -r ${pidfile} ]; then + _UNIFIPID=$(check_pidfile ${pidfile} ${procname}) + export _UNIFI_CHILDREN=$(pgrep -P ${_UNIFIPID}) + fi +} + +stop_postcmd() +{ + if ! [ -z ${_UNIFI_CHILDREN} ]; then + echo "Cleaning up leftover child processes." + kill $sig_stop ${_UNIFI_CHILDREN} + wait_for_pids ${_UNIFI_CHILDREN} + fi +} + +run_rc_command "$1" Added: head/net-mgmt/unifi-devel/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/unifi-devel/pkg-descr Sun Feb 4 14:01:50 2018 (r460932) @@ -0,0 +1,6 @@ +The UniFi Controller allows you to manage Wireless, Routing & Switching, +VoIP and Video of Ubiquiti Networks. + +This port tracks the development releases. + +WWW: http://wiki.ubnt.com/UniFi_FAQ
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802041401.w14E1ov7040831>