summaryrefslogtreecommitdiffstats
path: root/net-mgmt/flowd/Makefile
blob: 41f4ece17cae4315b234c36675353b0dfc74665b (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# New ports collection makefile for:   flowd
# Date created:        9 October 2004
# Whom:                Janos Mohacsi <janos.mohacsi@bsd.hu>
#
# $FreeBSD$
#

PORTNAME=	flowd
PORTVERSION=	0.8.5
CATEGORIES=	net-mgmt ipv6
MASTER_SITES=	http://www2.mindrot.org/files/flowd/

MAINTAINER=	janos.mohacsi@bsd.hu
COMMENT=	The flowd is a small, fast and secure NetFlow collector

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--localstatedir=/var
USE_GMAKE=	yes
USE_REINPLACE=	yes
MAN8=		flowd.8 flowd-reader.8
MAN5=		flowd.conf.5
PORTDOCS=	README INSTALL
FLOWD_USER?=	_flowd
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall

.if defined(WITH_PERL)
USE_PERL5=	yes
PLIST_SUB+=	WITH_PERL=""
#MAN3PREFIX=	${PREFIX}/lib/perl5/${PERL_VERSION}
#MAN3=		Flowd.3
.else
PLIST_SUB+=	WITH_PERL="@comment "
.endif

.if defined(WITH_PYTHON)
USE_PYTHON=	yes
PLIST_SUB+=	WITH_PYTHON=""
.else
PLIST_SUB+=	WITH_PYTHON="@comment "
.endif

pre-extract:
	@${ECHO_MSG} ""
.if defined(WITH_PERL)
	@${ECHO_MSG} "Build with perl bindings."
.else
	@${ECHO_MSG} "You can enable perl bindings by defining WITH_PERL"
.endif
	@${ECHO_MSG} ""
.if defined(WITH_PYTHON)
	@${ECHO_MSG} "Build with Python bindings."
.else
	@${ECHO_MSG} "You can enable Python bindings by defining WITH_PYTHON."
.endif

post-patch:
	@${SED} -e "s;%%FLOWD_USER%%;${FLOWD_USER};g" \
		${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
	@${REINPLACE_CMD} -e "s;%%FLOWD_USER%%;${FLOWD_USER};g" \
		${WRKSRC}/flowd.h

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif

.if defined(WITH_PERL)
	cd ${WRKSRC}/Flowd-perl && \
	${PERL} Makefile.PL  && \
	${GMAKE} && \
	${GMAKE} install
.endif

.if defined(WITH_PYTHON)
	cd ${WRKSRC} && \
	${PYTHON_CMD} setup.py build && \
	${PYTHON_CMD} setup.py install
.endif

	FLOWD_USER=${FLOWD_USER} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.mk>
OpenPOWER on IntegriCloud