aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2014-01-03 18:15:52 +0000
committerMark Felder <feld@FreeBSD.org>2014-01-03 18:15:52 +0000
commit2ee3459873a5a5e502499ce9d2c7ceb5e670fd86 (patch)
tree7a6f61a8be2dc27aa5a89a9ae5fb912c387f7e6b /net-mgmt
parent50d2b6f5ccfafb329cb1aa939ea8d311680f9157 (diff)
downloadports-2ee3459873a5a5e502499ce9d2c7ceb5e670fd86.tar.gz
ports-2ee3459873a5a5e502499ce9d2c7ceb5e670fd86.zip
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/unifi2/Makefile43
-rw-r--r--net-mgmt/unifi2/distinfo2
-rw-r--r--net-mgmt/unifi2/files/unifi.in74
-rw-r--r--net-mgmt/unifi2/pkg-descr3
-rw-r--r--net-mgmt/unifi2/pkg-plist85
6 files changed, 208 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index c60c1fbd4f73..460ba9b3616d 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -313,6 +313,7 @@
SUBDIR += tcpreplay
SUBDIR += tcptrack
SUBDIR += torrus
+ SUBDIR += unifi2
SUBDIR += unifi3
SUBDIR += vidalia
SUBDIR += virt-viewer
diff --git a/net-mgmt/unifi2/Makefile b/net-mgmt/unifi2/Makefile
new file mode 100644
index 000000000000..1c76cbcc6892
--- /dev/null
+++ b/net-mgmt/unifi2/Makefile
@@ -0,0 +1,43 @@
+# Created by: Mark Felder <feld@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= unifi2
+PORTVERSION= 2.4.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= unifi
+
+USERS= unifi
+GROUPS= unifi
+
+PLIST_SUB+= USERS="${USERS}"
+PLIST_SUB+= GROUPS="${GROUPS}"
+WRKSRC= ${WRKDIR}/UniFi
+
+RESTRICTED= Redistribution of bundled firmware images is not permitted
+CONFLICTS= unifi3-*
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/unifi
+ (cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}${JAVASHAREDIR}/unifi/)
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/unifi2/distinfo b/net-mgmt/unifi2/distinfo
new file mode 100644
index 000000000000..6bad821b042c
--- /dev/null
+++ b/net-mgmt/unifi2/distinfo
@@ -0,0 +1,2 @@
+SHA256 (unifi2-2.4.6/UniFi.unix.zip) = 0c4d24f281b27571ea98990c1162fc99ab60483b0976a805a4bb0ba4122af01a
+SIZE (unifi2-2.4.6/UniFi.unix.zip) = 34656352
diff --git a/net-mgmt/unifi2/files/unifi.in b/net-mgmt/unifi2/files/unifi.in
new file mode 100644
index 000000000000..f1dafecb738e
--- /dev/null
+++ b/net-mgmt/unifi2/files/unifi.in
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Created by: Mark Felder <feld@feld.me>
+# $FreeBSD: head/net-mgmt/unifi/files/unifi.in 334865 2013-11-25 16:52:21Z feld $
+#
+
+# 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"
diff --git a/net-mgmt/unifi2/pkg-descr b/net-mgmt/unifi2/pkg-descr
new file mode 100644
index 000000000000..546a2822feb9
--- /dev/null
+++ b/net-mgmt/unifi2/pkg-descr
@@ -0,0 +1,3 @@
+The UniFi Controller allows you to manage a UniFi Wireless Network.
+
+WWW: http://wiki.ubnt.com/UniFi_FAQ
diff --git a/net-mgmt/unifi2/pkg-plist b/net-mgmt/unifi2/pkg-plist
new file mode 100644
index 000000000000..4e7f48ed7c7c
--- /dev/null
+++ b/net-mgmt/unifi2/pkg-plist
@@ -0,0 +1,85 @@
+%%JAVASHAREDIR%%/unifi/bin/mongod
+%%JAVASHAREDIR%%/unifi/conf/catalina.policy
+%%JAVASHAREDIR%%/unifi/conf/catalina.properties
+%%JAVASHAREDIR%%/unifi/conf/context.xml
+%%JAVASHAREDIR%%/unifi/conf/server.xml
+%%JAVASHAREDIR%%/unifi/conf/tomcat-users.xml
+%%JAVASHAREDIR%%/unifi/conf/web.xml
+%%JAVASHAREDIR%%/unifi/data/system.properties
+%%JAVASHAREDIR%%/unifi/dl/firmware/BZ2/2.4.6.2178/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U2S48/2.4.6.2178/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U7E/2.4.6.2178/firmware.bin
+%%JAVASHAREDIR%%/unifi/dl/firmware/U7P/2.4.6.2178/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-1.4.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-collections.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-daemon.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-digester.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-httpclient-3.1.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-lang.jar
+%%JAVASHAREDIR%%/unifi/lib/commons-logging.jar
+%%JAVASHAREDIR%%/unifi/lib/dom4j.jar
+%%JAVASHAREDIR%%/unifi/lib/el-api.jar
+%%JAVASHAREDIR%%/unifi/lib/jasper-el.jar
+%%JAVASHAREDIR%%/unifi/lib/jasper-jdt.jar
+%%JAVASHAREDIR%%/unifi/lib/jasper.jar
+%%JAVASHAREDIR%%/unifi/lib/javassist.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/quartz-all-1.6.1.jar
+%%JAVASHAREDIR%%/unifi/lib/servlet-api.jar
+%%JAVASHAREDIR%%/unifi/lib/slf4j-api.jar
+%%JAVASHAREDIR%%/unifi/lib/slf4j-log4j12.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-aop-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-beans-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-context-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-context-support-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-core-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/spring-web-2.5.6.jar
+%%JAVASHAREDIR%%/unifi/lib/sshj.jar
+%%JAVASHAREDIR%%/unifi/lib/standard.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-juli-adapters.jar
+%%JAVASHAREDIR%%/unifi/lib/tomcat-juli.jar
+%%JAVASHAREDIR%%/unifi/readme.txt
+%%JAVASHAREDIR%%/unifi/webapps/ROOT.war
+@dirrmtry %%JAVASHAREDIR%%/unifi
+@dirrmtry %%JAVASHAREDIR%%/unifi/bin
+@dirrmtry %%JAVASHAREDIR%%/unifi/conf
+@dirrmtry %%JAVASHAREDIR%%/unifi/data
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/BZ2
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/BZ2/2.4.6.2178
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U2S48
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U2S48/2.4.6.2178
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7E
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7E/2.4.6.2178
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7P
+@dirrmtry %%JAVASHAREDIR%%/unifi/dl/firmware/U7P/2.4.6.2178
+@dirrmtry %%JAVASHAREDIR%%/unifi/lib
+@dirrmtry %%JAVASHAREDIR%%/unifi/webapps
+@exec chown -R %%USERS%%:%%GROUPS%% %D/%%JAVASHAREDIR%%/unifi
+@exec ln -sf %D/bin/mongod %D/%%JAVASHAREDIR%%/unifi/bin/mongod