Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 2013 16:52:22 +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: r334865 - in head/net-mgmt: . unifi unifi/files
Message-ID:  <201311251652.rAPGqMQJ024360@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: feld
Date: Mon Nov 25 16:52:21 2013
New Revision: 334865
URL: http://svnweb.freebsd.org/changeset/ports/334865

Log:
  Unifi is the wireless controller software for Ubiquiti's Unifi APs
  
  Approved by:	crees (mentor)

Added:
  head/net-mgmt/unifi/
  head/net-mgmt/unifi/Makefile   (contents, props changed)
  head/net-mgmt/unifi/distinfo   (contents, props changed)
  head/net-mgmt/unifi/files/
  head/net-mgmt/unifi/files/unifi.in   (contents, props changed)
  head/net-mgmt/unifi/pkg-descr   (contents, props changed)
  head/net-mgmt/unifi/pkg-plist   (contents, props changed)
Modified:
  head/net-mgmt/Makefile

Modified: head/net-mgmt/Makefile
==============================================================================
--- head/net-mgmt/Makefile	Mon Nov 25 16:47:32 2013	(r334864)
+++ head/net-mgmt/Makefile	Mon Nov 25 16:52:21 2013	(r334865)
@@ -312,6 +312,7 @@
     SUBDIR += tcpreplay
     SUBDIR += tcptrack
     SUBDIR += torrus
+    SUBDIR += unifi
     SUBDIR += vidalia
     SUBDIR += virt-viewer
     SUBDIR += virtinst

Added: head/net-mgmt/unifi/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/unifi/Makefile	Mon Nov 25 16:52:21 2013	(r334865)
@@ -0,0 +1,42 @@
+# Created by: Mark Felder <feld@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	unifi
+PORTVERSION=	3.1.6
+CATEGORIES=	net-mgmt java
+MASTER_SITES=	http://dl.ubnt.com/unifi/${PORTVERSION}/
+DISTNAME=	UniFi.unix
+DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
+
+MAINTAINER=	feld@FreeBSD.org
+COMMENT=	UniFi Wireless Controller
+
+RUN_DEPENDS=	mongodb>0:${PORTSDIR}/databases/mongodb
+
+SUB_LIST+=	USERS=${USERS} GROUPS=${GROUPS} JAVASHAREDIR=${JAVASHAREDIR}
+
+USE_ZIP=	yes
+USE_JAVA=	yes
+JAVA_VERSION=	1.6+
+JAVA_OS=	native
+JAVA_VENDOR=	openjdk bsdjava
+JAVA_RUN=	yes
+
+NO_BUILD=	yes
+
+USE_RC_SUBR=	${PORTNAME}
+
+USERS=	unifi
+GROUPS=	unifi
+
+PLIST_SUB+=	USERS="${USERS}"
+PLIST_SUB+=	GROUPS="${GROUPS}"
+WRKSRC=	${WRKDIR}/UniFi
+
+RESTRICTED=	Redistribution of bundled firmware images is not permitted
+
+do-install:
+	${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/)
+
+.include <bsd.port.mk>

Added: head/net-mgmt/unifi/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/unifi/distinfo	Mon Nov 25 16:52:21 2013	(r334865)
@@ -0,0 +1,2 @@
+SHA256 (unifi-3.1.6/UniFi.unix.zip) = 1eddda84eed13c0f244a02126bebaf260caf72ae84955361f18e2c9096d9bd84
+SIZE (unifi-3.1.6/UniFi.unix.zip) = 34522586

Added: head/net-mgmt/unifi/files/unifi.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/unifi/files/unifi.in	Mon Nov 25 16:52:21 2013	(r334865)
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Created by: Mark Felder <feld@feld.me>
+# $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}
+
+command_interpreter=.
+command="%%PREFIX%%/bin/java"
+command_args="-Djava.awt.headless=true -Xmx1024M -jar lib/ace.jar"
+start_cmd=start_cmd
+start_precmd=start_precmd
+stop_cmd=stop_cmd
+status_cmd=status_cmd
+pidfile="/var/run/${name}.pid"
+
+procname=$(JAVAVM_DRYRUN=yes ${command} | fgrep JAVAVM_COMMAND)
+
+start_precmd()
+{
+	if [ ! -e /var/run/unifi ] ; then
+		install -d -o %%USERS%% -g %%GROUPS%% /var/run/unifi;
+	fi
+}
+
+start_cmd()
+{
+	check_startmsgs && echo "Starting ${name}."
+	cd ${unifi_chdir}
+	daemon -u %%USERS%% -f -p ${pidfile} ${command} ${command_args} start
+}
+
+stop_cmd()
+{
+	check_startmsgs && echo "Stopping ${name}."
+	rc_pid=$(check_pidfile $pidfile $procname)
+	cd ${unifi_chdir}
+	${command} ${command_args} stop
+	wait_for_pids $rc_pid
+}
+
+status_cmd()
+{
+	if [ -e ${pidfile} ] && $(pgrep -F ${pidfile} > /dev/null) ; then
+                mypid=$(cat ${pidfile})
+	fi
+
+        if [ ! ${mypid} = '' ]; then
+                echo "${name} is running with PID ${mypid}.";
+        else
+                echo "${name} not running?";
+        fi
+}
+
+run_rc_command "$1"

Added: head/net-mgmt/unifi/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/unifi/pkg-descr	Mon Nov 25 16:52:21 2013	(r334865)
@@ -0,0 +1,3 @@
+The UniFi Controller allows you to manage a UniFi Wireless Network.
+
+WWW: http://wiki.ubnt.com/UniFi_FAQ

Added: head/net-mgmt/unifi/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/unifi/pkg-plist	Mon Nov 25 16:52:21 2013	(r334865)
@@ -0,0 +1,73 @@
+%%JAVASHAREDIR%%/unifi/bin/mongod
+%%JAVASHAREDIR%%/unifi/dl/firmware/BZ2/3.1.6.2316/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U2S48/3.1.6.2316/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U7E/3.1.6.2316/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U7P/3.1.6.2316/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/bundles.json
+%%JAVASHAREDIR%%/unifi/lib/MRJAdapter.jar
+%%JAVASHAREDIR%%/unifi/lib/ace.jar
+%%JAVASHAREDIR%%/unifi/lib/annotations-api.jar
+%%JAVASHAREDIR%%/unifi/lib/asm.jar
+%%JAVASHAREDIR%%/unifi/lib/bootstrap.jar
+%%JAVASHAREDIR%%/unifi/lib/catalina-ant.jar
+%%JAVASHAREDIR%%/unifi/lib/catalina-ha.jar
+%%JAVASHAREDIR%%/unifi/lib/catalina-tribes.jar
+%%JAVASHAREDIR%%/unifi/lib/catalina.jar
+%%JAVASHAREDIR%%/unifi/lib/cglib.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-beanutils.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-codec.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-daemon.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-httpclient.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-lang.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-logging.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-net.jar
+%%JAVASHAREDIR%%/unifi/lib/dom4j.jar
+%%JAVASHAREDIR%%/unifi/lib/ecj-4.2.1.jar
+%%JAVASHAREDIR%%/unifi/lib/el-api.jar
+%%JAVASHAREDIR%%/unifi/lib/jasper-el.jar
+%%JAVASHAREDIR%%/unifi/lib/jasper.jar
+%%JAVASHAREDIR%%/unifi/lib/jmdns.jar
+%%JAVASHAREDIR%%/unifi/lib/jsp-api.jar
+%%JAVASHAREDIR%%/unifi/lib/jstl.jar
+%%JAVASHAREDIR%%/unifi/lib/jstun-0.7.3.jar
+%%JAVASHAREDIR%%/unifi/lib/jul-log4j-bridge.jar
+%%JAVASHAREDIR%%/unifi/lib/log4j.jar
+%%JAVASHAREDIR%%/unifi/lib/mail.jar
+%%JAVASHAREDIR%%/unifi/lib/mongo.jar
+%%JAVASHAREDIR%%/unifi/lib/org.springframework.config.java-1.0.0.M4.jar
+%%JAVASHAREDIR%%/unifi/lib/servlet-api.jar
+%%JAVASHAREDIR%%/unifi/lib/slf4j-api.jar
+%%JAVASHAREDIR%%/unifi/lib/slf4j-log4j12.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-beans-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-context-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-core-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/sshj.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-api.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-coyote.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-dbcp.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-i18n-es.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-i18n-fr.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-i18n-ja.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-jdbc.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-juli-adapters.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-juli.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-util.jar
+%%JAVASHAREDIR%%/unifi/readme.txt
+%%JAVASHAREDIR%%/unifi/webapps/ROOT.war
+@dirrmtry %%JAVASHAREDIR%%/unifi/webapps
+@dirrmtry %%JAVASHAREDIR%%/unifi/lib
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7P/3.1.6.2316
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7P
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7E/3.1.6.2316
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7E
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U2S48/3.1.6.2316
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U2S48
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/BZ2/3.1.6.2316
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/BZ2
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl
+@dirrmtry %%JAVASHAREDIR%%/unifi/conf
+@dirrmtry %%JAVASHAREDIR%%/unifi/bin
+@dirrmtry %%JAVASHAREDIR%%/unifi
+@exec chown -R %%USERS%%:%%GROUPS%% %D/%%JAVASHAREDIR%%/unifi
+@exec ln -sf %D/bin/mongod %D/%%JAVASHAREDIR%%/unifi/bin/mongod



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311251652.rAPGqMQJ024360>