aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/unifi4/Makefile
blob: 0697f5c65a25fedc1b17c450b8fcef72359a0f32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Created by: Alban MAIRE <a.maire@s2mi.fr>
# $FreeBSD$

PORTNAME=   unifi4
PORTVERSION=    4.8.14
PORTREVISION=   0
CATEGORIES= net-mgmt java
MASTER_SITES=   https://www.ubnt.com/downloads/unifi/${PORTVERSION}/
DISTNAME=   UniFi.unix
DIST_SUBDIR=    ${PORTNAME}-${PORTVERSION}

MAINTAINER= feld@FreeBSD.org
COMMENT=    UniFi Controller

RUN_DEPENDS=    mongodb>0:${PORTSDIR}/databases/mongodb \
        snappyjava>0:${PORTSDIR}/archivers/snappy-java

BUILD=      7436

SUB_LIST+=  USERS=${USERS} GROUPS=${GROUPS} JAVASHAREDIR=${JAVASHAREDIR}
PLIST_SUB+= BUILDVERSION="${PORTVERSION:S/./_/g}_${BUILD}"

USES=       cpe zip
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

WRKSRC=     ${WRKDIR}/UniFi

RESTRICTED= Redistribution of bundled firmware images is not permitted
CONFLICTS=  unifi2-* unifi3-*

post-patch:
    ${RM} ${WRKSRC}/lib/snappy-java-1.0.5.jar
    (cd ${WRKSRC}/lib && ${LN} -s ${JAVAJARDIR}/snappy-java.jar snappy-java-1.0.5.jar)

do-install:
    ${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/unifi
    (cd ${WRKSRC} && ${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

.include <bsd.port.mk>