diff --git a/LEGAL b/LEGAL index 65e7d230899c..040f0e0b8465 100644 --- a/LEGAL +++ b/LEGAL @@ -266,6 +266,7 @@ twelf-* lang/twelf License is currently indeterminate tw_cli-* sysutils/tw_cli Redistribution forbidden by license uDrawGraph-* graphics/uDrawGraph Binary under GNU LGPL without accompanying source ue*dev.zip editors/uemacs Resale allowed for media cost only +unifi-2*/UniFi.unix.zip net-mgmt/unifi2 Redistribution limited unifi-3*/UniFi.unix.zip net-mgmt/unifi3 Redistribution limited uplink-demo* games/linux-uplink-demo Redistribution is limited, see license uppaal-*.zip devel/uppaal Downloading requires completion of a license agreement 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 +# $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 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 +# $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