View | Details | Raw Unified | Return to bug 249466 | Differences between
and this patch

Collapse All | Expand All

(-)b/net-mgmt/unifi6/Makefile (+88 lines)
Added Link Here
1
# Created by: Juraj Lutter <juraj@lutter.sk>
2
# $FreeBSD$
3
4
PORTNAME=	unifi6
5
PORTVERSION=	6.0.23
6
CATEGORIES=	net-mgmt java
7
MASTER_SITES=	http://dl.ubnt.com/unifi/%SUBDIR%/:unifi \
8
		https://repo1.maven.org/maven2/%SUBDIR%/:jax
9
MASTER_SITE_SUBDIR=	${PORTVERSION}/:unifi \
10
			javax/activation/${JAX_DISTNAME}/${JAX_VERSION}/:jax
11
DISTFILES=	unifi_sysvinit_all.deb:unifi \
12
		${JAX_DISTNAME}-${JAX_VERSION}.jar:jax
13
DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
14
EXTRACT_ONLY=	unifi_sysvinit_all.deb
15
16
MAINTAINER=	juraj@lutter.sk
17
COMMENT=	UniFi Controller v6
18
19
RUN_DEPENDS=	mongodb36>0:databases/mongodb36 \
20
		snappyjava>0:archivers/snappy-java
21
22
USES=		cpe
23
24
SUB_LIST+=	GROUPS=${GROUPS} \
25
		JAVA=${JAVA} \
26
		JAVA_HOME=${JAVA_HOME} \
27
		JAVASHAREDIR=${JAVASHAREDIR} \
28
		USERS=${USERS}
29
30
EXTRACT_CMD=	/usr/bin/ar
31
EXTRACT_BEFORE_ARGS=	-p
32
EXTRACT_AFTER_ARGS=	data.tar.xz | ${TAR} -xf -
33
34
CPE_VENDOR=	ubnt
35
CPE_PRODUCT=	unifi_controller
36
USE_JAVA=	yes
37
JAVA_VERSION=	1.8+
38
JAVA_OS=	native
39
JAVA_VENDOR=	openjdk bsdjava
40
JAVA_RUN=	yes
41
42
NO_BUILD=	yes
43
NO_ARCH=	yes
44
45
USE_RC_SUBR=	unifi
46
47
USERS=		unifi
48
GROUPS=		unifi
49
50
JAX_DISTNAME=	javax.activation-api
51
JAX_VERSION=	1.2.0
52
53
NO_WRKSUBDIR=	yes
54
55
CONFLICTS=	unifi-devel-*
56
CONFLICTS+=	unifi-lts-*
57
CONFLICTS+=	unifi5-*
58
59
DIR_LIST=	conf data logs run work
60
61
post-extract:
62
	${CP} ${DISTDIR}/${DIST_SUBDIR}/${JAX_DISTNAME}-${JAX_VERSION}.jar \
63
		${WRKSRC}/usr/lib/unifi/lib/
64
65
post-patch:
66
	(cd ${WRKSRC}/usr/lib/unifi/lib && \
67
		${LN} -f -s ${JAVAJARDIR}/snappy-java.jar snappy-java-*.jar)
68
	${RM} -r ${WRKSRC}/usr/lib/unifi/lib/native
69
70
do-install:
71
	${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/unifi
72
	(cd ${WRKSRC}/usr/lib/unifi && \
73
		${COPYTREE_SHARE} \* ${STAGEDIR}${JAVASHAREDIR}/unifi/)
74
	${LN} -sf ${PREFIX}/bin/mongod ${STAGEDIR}${JAVASHAREDIR}/unifi/bin/mongod
75
# Create directories that will be writable by unifi
76
.for i in data logs run work
77
	${MKDIR} ${STAGEDIR}/${JAVASHAREDIR}/unifi/${i}
78
.endfor
79
80
post-install:
81
	@${FIND} -s ${STAGEDIR}${JAVASHAREDIR}/unifi -not -type d | \
82
		${SORT} | ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
83
.for dir in ${DIR_LIST}
84
	@${ECHO} "@dir(unifi,wheel,) ${JAVASHAREDIR}/unifi/${dir}" >> \
85
		${TMPPLIST}
86
.endfor
87
88
.include <bsd.port.mk>
(-)b/net-mgmt/unifi6/distinfo (+5 lines)
Added Link Here
1
TIMESTAMP = 1601054231
2
SHA256 (unifi6-6.0.23/unifi_sysvinit_all.deb) = b7fb345049340a09c07b276d2d64e0a598e7009aa7c9fc8448d3557b57793c7a
3
SIZE (unifi6-6.0.23/unifi_sysvinit_all.deb) = 160563238
4
SHA256 (unifi6-6.0.23/javax.activation-api-1.2.0.jar) = 43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393
5
SIZE (unifi6-6.0.23/javax.activation-api-1.2.0.jar) = 56674
(-)b/net-mgmt/unifi6/files/unifi.in (+86 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# Created by: Mark Felder <feld@FreeBSD.org>
4
# $FreeBSD$
5
#
6
7
# PROVIDE: unifi
8
# REQUIRE: LOGIN
9
# KEYWORD: shutdown
10
11
#
12
# Add the following line to /etc/rc.conf to enable `unifi':
13
#
14
# unifi_enable="YES"
15
#
16
# Other configuration settings for unifi that can be set in /etc/rc.conf:
17
#
18
# unifi_user (str)
19
#   This is the user that unifi runs as
20
#   Set to %%USERS%% by default
21
#
22
# unifi_group (str)
23
#   This is the group that unifi runs as
24
#   Set to %%GROUPS%% by default
25
#
26
# unifi_chdir (str)
27
#   This is the directory that unifi chdirs into before starting
28
#   Set to %%JAVASHAREDIR%%/unifi by default
29
#
30
# unifi_java_home (str)
31
#   The path to the base directory for the Java to use to run unifi
32
#   Defaults to %%JAVA_HOME%%
33
#
34
# unifi_javaflags (str)
35
#   Flags passed to Java to run unifi
36
#   Set to "-Djava.awt.headless=true -Xmx1024M" by default
37
#
38
39
. /etc/rc.subr
40
name=unifi
41
42
rcvar=unifi_enable
43
load_rc_config ${name}
44
45
: ${unifi_enable:=NO}
46
: ${unifi_user:=%%USERS%%}
47
: ${unifi_group:=%%GROUPS%%}
48
: ${unifi_chdir=%%JAVASHAREDIR%%/unifi}
49
: ${unifi_java_home=%%JAVA_HOME%%}
50
: ${unifi_javaflags="-Djava.awt.headless=true -Xmx1024M"}
51
52
pidfile="/var/run/unifi/${name}.pid"
53
procname=${unifi_java_home}/bin/java
54
command=/usr/sbin/daemon
55
command_args="-f -p ${pidfile} ${unifi_java_home}/bin/java ${unifi_javaflags} com.ubnt.ace.Launcher start"
56
start_precmd=start_precmd
57
stop_precmd=stop_precmd
58
stop_postcmd=stop_postcmd
59
60
export CLASSPATH=$(echo ${unifi_chdir}/lib/*.jar | tr ' ' ':')
61
62
start_precmd()
63
{
64
	if [ ! -e /var/run/unifi ] ; then
65
		install -d -o %%USERS%% -g %%GROUPS%% /var/run/unifi;
66
	fi
67
}
68
69
stop_precmd()
70
{
71
	if [ -r ${pidfile} ]; then
72
		_UNIFIPID=$(check_pidfile ${pidfile} ${procname})
73
		export _UNIFI_CHILDREN=$(pgrep -P ${_UNIFIPID})
74
	fi
75
}
76
77
stop_postcmd()
78
{
79
	if ! [ -z ${_UNIFI_CHILDREN} ]; then
80
		echo "Cleaning up leftover child processes."
81
		kill $sig_stop ${_UNIFI_CHILDREN}
82
		wait_for_pids ${_UNIFI_CHILDREN}
83
	fi
84
}
85
86
run_rc_command "$1"
(-)b/net-mgmt/unifi6/pkg-descr (+4 lines)
Added Link Here
1
The UniFi Controller allows you to manage Wireless, Routing & Switching,
2
VoIP and Video of Ubiquiti Networks.
3
4
WWW: http://wiki.ubnt.com/UniFi_FAQ

Return to bug 249466