diff options
author | Mark Felder <feld@FreeBSD.org> | 2018-04-03 14:00:03 +0000 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2018-04-03 14:00:03 +0000 |
commit | f0f9bdfde20d59934db83d913892046faa3ce177 (patch) | |
tree | 3a0d69848bd80a1dd273d7cb2bf5a928be9518eb /net-mgmt | |
parent | 16ee6fccde23e462f7a1ce8549ad8096f673c391 (diff) | |
download | ports-f0f9bdfde20d59934db83d913892046faa3ce177.tar.gz ports-f0f9bdfde20d59934db83d913892046faa3ce177.zip |
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/unifi-lts/Makefile | 70 | ||||
-rw-r--r-- | net-mgmt/unifi-lts/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/unifi-lts/files/unifi.in | 60 | ||||
-rw-r--r-- | net-mgmt/unifi-lts/pkg-descr | 4 |
5 files changed, 138 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 51ccdaca94a3..6f4fcb509031 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -375,6 +375,7 @@ SUBDIR += triton-guesttools SUBDIR += unbound_exporter SUBDIR += unifi-devel + SUBDIR += unifi-lts SUBDIR += unifi5 SUBDIR += victorops-nagios SUBDIR += vidalia diff --git a/net-mgmt/unifi-lts/Makefile b/net-mgmt/unifi-lts/Makefile new file mode 100644 index 000000000000..ce72e81a56b4 --- /dev/null +++ b/net-mgmt/unifi-lts/Makefile @@ -0,0 +1,70 @@ +# Created by: Alban MAIRE <a.maire@s2mi.fr> +# $FreeBSD$ + +PORTNAME= unifi +PORTVERSION= 5.6.30 +PORTREVISION= 0 +CATEGORIES= net-mgmt java +MASTER_SITES= http://dl.ubnt.com/unifi/${PORTVERSION}/ +PKGNAMESUFFIX= -lts +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 - + +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= unifi5-* unifi-devel-* + +DIR_LIST= conf data logs run work + +post-patch: + (cd ${WRKSRC}/usr/lib/unifi/lib && ${LN} -f -s ${JAVAJARDIR}/snappy-java.jar snappy-java-*.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> diff --git a/net-mgmt/unifi-lts/distinfo b/net-mgmt/unifi-lts/distinfo new file mode 100644 index 000000000000..e415bd5de8fe --- /dev/null +++ b/net-mgmt/unifi-lts/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1517534338 +SHA256 (unifi5-5.6.30/unifi_sysvinit_all.deb) = 44facefdca0e3270ccbacdf661a9dd2a2e3fe126a840c3a402f6b61393806b20 +SIZE (unifi5-5.6.30/unifi_sysvinit_all.deb) = 50209900 diff --git a/net-mgmt/unifi-lts/files/unifi.in b/net-mgmt/unifi-lts/files/unifi.in new file mode 100644 index 000000000000..4a59ad775dba --- /dev/null +++ b/net-mgmt/unifi-lts/files/unifi.in @@ -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" diff --git a/net-mgmt/unifi-lts/pkg-descr b/net-mgmt/unifi-lts/pkg-descr new file mode 100644 index 000000000000..dd4e68458f55 --- /dev/null +++ b/net-mgmt/unifi-lts/pkg-descr @@ -0,0 +1,4 @@ +The UniFi Controller allows you to manage Wireless, Routing & Switching, +VoIP and Video of Ubiquiti Networks. + +WWW: http://wiki.ubnt.com/UniFi_FAQ |