aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/flow-tools/Makefile
blob: 36e3333a3d7b56571a447fbaf2fa5753a4e1694f (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
59
60
61
62
63
64
65
# Created by: @BABOLO <.@babolo.ru>

PORTNAME=	flow-tools
PORTVERSION=	0.68.6
DISTVERSIONPREFIX=	v
PORTREVISION=	4
CATEGORIES=	net-mgmt

MAINTAINER=	bofh@FreeBSD.org
COMMENT=	Suite of tools and library to work with netflow data

LICENSE=	BSD2CLAUSE
LICENSE_FILE=	${WRKSRC}/COPYING

USES=		autoreconf libtool:keepla python:patch shebangfix
USE_GITHUB=	yes
USE_LDCONFIG=	yes
USE_RC_SUBR=	flow_capture flow_fanout

GH_ACCOUNT=	5u623l20
GH_TAGNAME=	2ca53f5

SHEBANG_FILES=	bin/flow-*
GNU_CONFIGURE=	yes

SUB_LIST=	FLOW_CAPTURE_PIDDIR="${FLOW_CAPTURE_PIDDIR}" \
		FLOW_CAPTURE_SPOOL="${FLOW_CAPTURE_SPOOL}"

USERS=		flowtools
GROUPS=		flowtools

VARDIR?=		/var
FLOW_CAPTURE_SPOOL=	${VARDIR}/db/flows
FLOW_CAPTURE_PIDDIR=	${VARDIR}/run/flow-capture

OPTIONS_DEFINE=	MYSQL OPENSSL PGSQL

PY2TO3_CMD=	${LOCALBASE}/bin/2to3-${PYTHON_VER}
PY2TO3_ARGS=	--fix=all --no-diffs --nobackups --verbose --write

MYSQL_USES=		mysql
MYSQL_CONFIGURE_ON=	--with-mysql="${LOCALBASE}"
OPENSSL_USES=		ssl
OPENSSL_CONFIGURE_ON=	--with-openssl="${OPENSSLBASE}"
PGSQL_USES=		pgsql
PGSQL_CONFIGURE_ON=	--with-postgresql
PGSQL_CONFIGURE_OFF=	--with-postgresql=no

.include <bsd.port.pre.mk>

post-patch:
.if ${PYTHON_MAJOR_VER} >= 3
	${PY2TO3_CMD} ${PY2TO3_ARGS} ${WRKSRC}/bin/flow-*
.endif

post-install:
	${STRIP_CMD} ${STAGEDIR}/${PREFIX}/lib/libft.so.0.0.0

post-stage:
.for f in asn.sym filter.cfg ip-prot.sym ip-type.sym map.cfg mask.cfg stat.cfg \
	tag.cfg tag.sym tcp-port.sym xlate.cfg
	@${MV} ${STAGEDIR}${ETCDIR}/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor

.include <bsd.port.post.mk>