aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2013-11-25 16:52:21 +0000
committerMark Felder <feld@FreeBSD.org>2013-11-25 16:52:21 +0000
commit1e21036389a1ff7adadd15732befe87a5958d504 (patch)
treea502f21dc98f911cf0550ba559b78451434bf7b4 /net-mgmt
parent5d017b228648ebed493c55ba5c4930bdbf1fb1ee (diff)
downloadports-1e21036389a1ff7adadd15732befe87a5958d504.tar.gz
ports-1e21036389a1ff7adadd15732befe87a5958d504.zip
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/unifi/Makefile42
-rw-r--r--net-mgmt/unifi/distinfo2
-rw-r--r--net-mgmt/unifi/files/unifi.in74
-rw-r--r--net-mgmt/unifi/pkg-descr3
-rw-r--r--net-mgmt/unifi/pkg-plist73
6 files changed, 195 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index ac8035616fd5..9c931b90d967 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -312,6 +312,7 @@
SUBDIR += tcpreplay
SUBDIR += tcptrack
SUBDIR += torrus
+ SUBDIR += unifi
SUBDIR += vidalia
SUBDIR += virt-viewer
SUBDIR += virtinst
diff --git a/net-mgmt/unifi/Makefile b/net-mgmt/unifi/Makefile
new file mode 100644
index 000000000000..34d545aa25ad
--- /dev/null
+++ b/net-mgmt/unifi/Makefile
@@ -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>
diff --git a/net-mgmt/unifi/distinfo b/net-mgmt/unifi/distinfo
new file mode 100644
index 000000000000..fb2350856cd2
--- /dev/null
+++ b/net-mgmt/unifi/distinfo
@@ -0,0 +1,2 @@
+SHA256 (unifi-3.1.6/UniFi.unix.zip) = 1eddda84eed13c0f244a02126bebaf260caf72ae84955361f18e2c9096d9bd84
+SIZE (unifi-3.1.6/UniFi.unix.zip) = 34522586
diff --git a/net-mgmt/unifi/files/unifi.in b/net-mgmt/unifi/files/unifi.in
new file mode 100644
index 000000000000..c56c4fee3aee
--- /dev/null
+++ b/net-mgmt/unifi/files/unifi.in
@@ -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"
diff --git a/net-mgmt/unifi/pkg-descr b/net-mgmt/unifi/pkg-descr
new file mode 100644
index 000000000000..546a2822feb9
--- /dev/null
+++ b/net-mgmt/unifi/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/unifi/pkg-plist b/net-mgmt/unifi/pkg-plist
new file mode 100644
index 000000000000..d982d1180cab
--- /dev/null
+++ b/net-mgmt/unifi/pkg-plist
@@ -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