aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/unifi6
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2020-10-06 18:32:42 +0000
committerMikael Urankar <mikael@FreeBSD.org>2020-10-06 18:32:42 +0000
commit49932cca21a88859a8aab9b3aaca35c6dc42a9fd (patch)
treea27e56d2681f2fc2d97165098c267e3915e69e68 /net-mgmt/unifi6
parent96447abedceaf49dcfeb401ac5e8d7112e86b354 (diff)
downloadports-49932cca21a88859a8aab9b3aaca35c6dc42a9fd.tar.gz
ports-49932cca21a88859a8aab9b3aaca35c6dc42a9fd.zip
net-mgmt/unifi6: create port
The UniFi Controller allows you to manage Wireless, Routing & Switching, VoIP and Video of Ubiquiti Networks. Changelog: https://ubntwiki.com/products/software/unifi-controller/6.0_consolidated_change_log PR: 249466 Submitted by: Juraj Lutter
Notes
Notes: svn path=/head/; revision=551591
Diffstat (limited to 'net-mgmt/unifi6')
-rw-r--r--net-mgmt/unifi6/Makefile87
-rw-r--r--net-mgmt/unifi6/distinfo5
-rw-r--r--net-mgmt/unifi6/files/unifi.in86
-rw-r--r--net-mgmt/unifi6/pkg-descr4
4 files changed, 182 insertions, 0 deletions
diff --git a/net-mgmt/unifi6/Makefile b/net-mgmt/unifi6/Makefile
new file mode 100644
index 000000000000..a61983292398
--- /dev/null
+++ b/net-mgmt/unifi6/Makefile
@@ -0,0 +1,87 @@
+# $FreeBSD$
+
+PORTNAME= unifi6
+PORTVERSION= 6.0.23
+CATEGORIES= net-mgmt java
+MASTER_SITES= http://dl.ubnt.com/unifi/%SUBDIR%/:unifi \
+ https://repo1.maven.org/maven2/%SUBDIR%/:jax
+MASTER_SITE_SUBDIR= ${PORTVERSION}/:unifi \
+ javax/activation/${JAX_DISTNAME}/${JAX_VERSION}/:jax
+DISTFILES= unifi_sysvinit_all.deb:unifi \
+ ${JAX_DISTNAME}-${JAX_VERSION}.jar:jax
+DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
+EXTRACT_ONLY= unifi_sysvinit_all.deb
+
+MAINTAINER= juraj@lutter.sk
+COMMENT= UniFi Controller v6
+
+RUN_DEPENDS= mongodb36>0:databases/mongodb36 \
+ snappyjava>0:archivers/snappy-java
+
+USES= cpe
+
+SUB_LIST+= GROUPS=${GROUPS} \
+ JAVA=${JAVA} \
+ JAVA_HOME=${JAVA_HOME} \
+ JAVASHAREDIR=${JAVASHAREDIR} \
+ USERS=${USERS}
+
+EXTRACT_CMD= /usr/bin/ar
+EXTRACT_BEFORE_ARGS= -p
+EXTRACT_AFTER_ARGS= data.tar.xz | ${TAR} -xf -
+
+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
+
+JAX_DISTNAME= javax.activation-api
+JAX_VERSION= 1.2.0
+
+NO_WRKSUBDIR= yes
+
+CONFLICTS= unifi-devel-*
+CONFLICTS+= unifi-lts-*
+CONFLICTS+= unifi5-*
+
+DIR_LIST= conf data logs run work
+
+post-extract:
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${JAX_DISTNAME}-${JAX_VERSION}.jar \
+ ${WRKSRC}/usr/lib/unifi/lib/
+
+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/unifi6/distinfo b/net-mgmt/unifi6/distinfo
new file mode 100644
index 000000000000..b393b09817ab
--- /dev/null
+++ b/net-mgmt/unifi6/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1601054231
+SHA256 (unifi6-6.0.23/unifi_sysvinit_all.deb) = b7fb345049340a09c07b276d2d64e0a598e7009aa7c9fc8448d3557b57793c7a
+SIZE (unifi6-6.0.23/unifi_sysvinit_all.deb) = 160563238
+SHA256 (unifi6-6.0.23/javax.activation-api-1.2.0.jar) = 43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393
+SIZE (unifi6-6.0.23/javax.activation-api-1.2.0.jar) = 56674
diff --git a/net-mgmt/unifi6/files/unifi.in b/net-mgmt/unifi6/files/unifi.in
new file mode 100644
index 000000000000..01c336f448fe
--- /dev/null
+++ b/net-mgmt/unifi6/files/unifi.in
@@ -0,0 +1,86 @@
+#!/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"
+#
+# Other configuration settings for unifi that can be set in /etc/rc.conf:
+#
+# unifi_user (str)
+# This is the user that unifi runs as
+# Set to %%USERS%% by default
+#
+# unifi_group (str)
+# This is the group that unifi runs as
+# Set to %%GROUPS%% by default
+#
+# unifi_chdir (str)
+# This is the directory that unifi chdirs into before starting
+# Set to %%JAVASHAREDIR%%/unifi by default
+#
+# unifi_java_home (str)
+# The path to the base directory for the Java to use to run unifi
+# Defaults to %%JAVA_HOME%%
+#
+# unifi_javaflags (str)
+# Flags passed to Java to run unifi
+# Set to "-Djava.awt.headless=true -Xmx1024M" by default
+#
+
+. /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_java_home=%%JAVA_HOME%%}
+: ${unifi_javaflags="-Djava.awt.headless=true -Xmx1024M"}
+
+pidfile="/var/run/unifi/${name}.pid"
+procname=${unifi_java_home}/bin/java
+command=/usr/sbin/daemon
+command_args="-f -p ${pidfile} ${unifi_java_home}/bin/java ${unifi_javaflags} com.ubnt.ace.Launcher start"
+start_precmd=start_precmd
+stop_precmd=stop_precmd
+stop_postcmd=stop_postcmd
+
+export CLASSPATH=$(echo ${unifi_chdir}/lib/*.jar | tr ' ' ':')
+
+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/unifi6/pkg-descr b/net-mgmt/unifi6/pkg-descr
new file mode 100644
index 000000000000..dd4e68458f55
--- /dev/null
+++ b/net-mgmt/unifi6/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