summaryrefslogtreecommitdiff
path: root/net/flow-tools/Makefile
blob: feb7b2e4edf302e1631739951d4c6b38f9701a96 (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
# $NetBSD: Makefile,v 1.3 2003/02/16 23:50:18 seb Exp $

DISTNAME=	flow-tools-0.63
CATEGORIES=	net
MASTER_SITES=	ftp://ftp.eng.oar.net/pub/flow-tools/

MAINTAINER=	cjs@netbsd.org
HOMEPAGE=	http://www.splintered.net/sw/flow-tools/
COMMENT=	Collect and store NetFlow data

GNU_CONFIGURE=	YES
USE_BUILDLINK2=	YES
USE_PKGINSTALL=	YES

PKG_SYSCONFSUBDIR=	flow-tools
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}

EGDIR=		${PREFIX}/share/examples/flow-tools
MAKE_DIRS+=	${PKG_SYSCONFDIR}/sym
MAKE_DIRS+=	${PKG_SYSCONFDIR}/cfg

# These files are config files that are unlikely to be modified in most cases
# so we install them via SUPPORT_FILES.
_SYM_FILES=	asn ip-prot ip-type tcp-port
.for _f_ in ${_SYM_FILES}
SUPPORT_FILES+=	${EGDIR}/sym/${_f_} ${PKG_SYSCONFDIR}/sym/${_f_}
.endfor

# These files are example config files that we should not blindly install
# so we stuff them in EGDIR and we're done.
# note: filter-acl and flow.acl are nearly the same files
_CFG_FILES=	filter flow.acl map stats # filter-acl

.include "../../mk/bsd.prefs.mk"

# MySQL support
.if defined(FLOW_TOOLS_USE_MYSQL) && ${FLOW_TOOLS_USE_MYSQL} == "YES"
.include "../../databases/mysql-client/buildlink2.mk"
CONFIGURE_ARGS+=	--with-mysql=${BUILDLINK_PREFIX.mysql-client}
LDFLAGS+= -Wl,${_OPSYS_RPATH_NAME}${BUILDLINK_PREFIX.mysql-client}/lib/mysql
.endif

# Touch these or else config.status being touched the manpages
# generated by it will be made twice
AUTOMAKE_POST_PATTERNS+=	*.1

# To avoid providing more patch files we do the following...
# Order is important here or else dependencies requiring docbook-to-man/jade
# will be triggered
post-patch:
	${_PKG_SILENT}${_PKG_DEBUG}					\
	cd ${WRKSRC}/docs &&						\
	for m in flow-*.1.in; do					\
		h=`${BASENAME} $${m} .1.in`.html.in;			\
		s=`${BASENAME} $${m} .1.in`.sgml;			\
		for f in $${s} $${h} $${m}; do				\
			${MV} $${f} $${f}.bak &&			\
			${SED} -e 's,@localstatedir@,@sysconfdir@,g'	\
		   < $${f}.bak > $${f};					\
		done;							\
	done

post-install:
	${INSTALL_DATA_DIR} ${EGDIR}
	${INSTALL_DATA_DIR} ${EGDIR}/sym
	${INSTALL_DATA_DIR} ${EGDIR}/cfg
	${INSTALL_DATA_DIR} ${EGDIR}/bin
.for _f_ in ${_SYM_FILES}
	${INSTALL_DATA} ${WRKSRC}/configs/${_f_} ${EGDIR}/sym/${_f_}
.endfor
.for _f_ in ${_CFG_FILES}
	${INSTALL_DATA} ${WRKSRC}/configs/${_f_} ${EGDIR}/cfg/${_f_}
.endfor
.for _f_ in flow-mirror flow-rsync flow-search
	${INSTALL_DATA} ${WRKSRC}/bin/${_f_} ${EGDIR}/bin/${_f_}
.endfor

.include "../../devel/zlib/buildlink2.mk"
.include "../../security/tcp_wrappers/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"