summaryrefslogtreecommitdiff
path: root/net/libnids/Makefile
blob: fd3b4bcc917a3b86dd0fd589fb199c8b0690c768 (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
67
68
69
70
71
# New ports collection makefile for:	libnids
# Date created:		08 Jan 2000
# Whom:			kris@FreeBSD.org
#
# $FreeBSD$
#

PORTNAME=	libnids
PORTVERSION=	1.21
PORTREVISION=	3
CATEGORIES=	net security
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	${PORTNAME}

MAINTAINER=	roam@FreeBSD.org
COMMENT=	Network monitoring library with TCP/IP reassembly

OPTIONS=	LIBNET "Include code requiring libnet" ON \
		LIBNET10 "Use the old libnet-1.0.x version" ON \
		GLIB2 "Use GLIB2 for multiprocessing support" ON

WANT_GNOME=	yes
GNU_CONFIGURE=	yes
CONFIGURE_TARGET=	--build=${ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ENV=	CFLAGS="-I${LOCALBASE}/include ${PTHREAD_CFLAGS}" \
		LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"

MAKE_ENV=	LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"

MAN3=		libnids.3

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_LIBNET)
.if !defined(WITHOUT_LIBNET10)
BUILD_DEPENDS+=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
.else
BUILD_DEPENDS+=	${LIBNET_CONFIG}:${PORTSDIR}/net/libnet
LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet11-config
.endif
.else
CONFIGURE_ARGS+=	--disable-libnet
.endif

.if !defined(WITHOUT_GLIB2)
USE_GNOME+=	glib20
.else
CONFIGURE_ARGS+=	--disable-libglib
.endif

post-patch:
	@${REINPLACE_CMD} -Ee \
		's|(LNET_CFLAGS=).*|\1"`${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags`"|; \
		 s|(LNETLIB=).*|\1"`${LIBNET_CONFIG} --libs`"|' \
		 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}

do-install:
		${INSTALL_DATA} ${WRKSRC}/src/nids.h ${PREFIX}/include
		${INSTALL_DATA} ${WRKSRC}/src/libnids.a ${PREFIX}/lib
		${INSTALL_MAN} ${WRKSRC}/src/libnids.3 ${PREFIX}/man/man3

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for i in README doc/*
	${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR}/
.endfor
.endif

.include <bsd.port.post.mk>