aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/fastnetmon/Makefile
blob: 1e5c60e04ff815c4e905de3b90f2abaa4130eb3c (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
66
# Created by: Babak Farrokhi <farrokhi@FreeBSD.org>
# $FreeBSD$

PORTNAME=   fastnetmon
PORTVERSION=    1.1.3
DISTVERSIONPREFIX=  v
PORTREVISION=   8
CATEGORIES= net-mgmt security

MAINTAINER= farrokhi@FreeBSD.org
COMMENT=    Very fast DDoS analyzer with sflow/netflow/mirror support

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

LIB_DEPENDS=    libboost_regex.so:devel/boost-libs \
        liblog4cpp.so:devel/log4cpp \
        libluajit-5.1.so:lang/luajit \
        libmongoc-1.0.so:devel/mongo-c-driver \
        libjson-c.so:devel/json-c \
        libbson-1.0.so:devel/libbson

USE_GITHUB= yes
GH_ACCOUNT= pavel-odintsov

USERS=  ${PORTNAME}
GROUPS= ${PORTNAME}

USES=   cmake
CMAKE_SOURCE_PATH=  ${WRKSRC}/src

CMAKE_ARGS+=    -DDISABLE_PF_RING_SUPPORT=ON
CMAKE_INSTALL_PREFIX=   ${PREFIX}

BROKEN_armv6=       Does not build: invokes x86 assembler
BROKEN_armv7=       Does not build: invokes x86 assembler
BROKEN_powerpc64=   Does not build

USE_RC_SUBR=    ${PORTNAME}

OPTIONS_DEFINE= DOCS REDIS

REDIS_LIB_DEPENDS=  libhiredis.so:databases/hiredis

PORTDOCS=   *

CFLAGS_i386=    -march=i586

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/src/CMakeLists.txt
    @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \
        s|/var/run|&/fastnetmon|g; s|/var/log|&/fastnetmon|g; \
        s|"/etc/|"${PREFIX}/etc/|g; s|/root/fastnetmon|${DATADIR}|g' \
        ${WRKSRC}/src/fastnetmon.conf ${WRKSRC}/src/fastnetmon.cpp

post-install:
    ${MV} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf \
        ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
    ${MKDIR} ${STAGEDIR}/var/run/fastnetmon ${STAGEDIR}/var/log/fastnetmon
    ${INSTALL_MAN} ${WRKSRC}/src/man/fastnetmon.1 ${STAGEDIR}${MANPREFIX}/man/man1
    ${INSTALL_MAN} ${WRKSRC}/src/man/fastnetmon_client.1 ${STAGEDIR}${MANPREFIX}/man/man1

post-install-DOCS-on:
    cd ${WRKSRC} && ${COPYTREE_SHARE} "README.md docs" ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>