aboutsummaryrefslogtreecommitdiffstats
path: root/net/libnet/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'net/libnet/Makefile')
-rw-r--r--net/libnet/Makefile77
1 files changed, 61 insertions, 16 deletions
diff --git a/net/libnet/Makefile b/net/libnet/Makefile
index e880c1a8ea07..9de58b1f71bd 100644
--- a/net/libnet/Makefile
+++ b/net/libnet/Makefile
@@ -2,39 +2,84 @@
# $FreeBSD$
PORTNAME= libnet
-PORTVERSION= 1.1.2.1
-PORTREVISION= 4
+PORTVERSION= 1.1.6
PORTEPOCH= 1
CATEGORIES= net
-MASTER_SITES= http://www.packetfactory.net/libnet/dist/ \
- ${MASTER_SITE_GENTOO}
+MASTER_SITES= SF/libnet-dev
MASTER_SITE_SUBDIR= distfiles
-PKGNAMESUFFIX= 11
+PKGNAMESUFFIX= 11${PKGNAMESUFFIX2}
MAINTAINER= dinoex@FreeBSD.org
COMMENT= A C library for creating IP packets
+LATEST_LINK= ${PORTNAME}${SHORT_VER}
+
+USE_AUTOTOOLS= libtool
+USE_LDCONFIG= yes
GNU_CONFIGURE= yes
-CFLAGS+= -fPIC
-USE_CSTD= gnu89
+#CFLAGS+= -fPIC
+#USE_CSTD= gnu89
+CONFIGURE_ARGS= --with-link-layer=${LIBNET_LINK}
-WRKSRC= ${WRKDIR}/${PORTNAME}
-DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
-EXAMPLESDIR= ${PREFIX}/share/examples/${PORTNAME}${PKGNAMESUFFIX}
+SHORT_VER= 11
+SHORT_NAME= ${PORTNAME}${SHORT_VER}
+DOCSDIR= ${PREFIX}/share/doc/${SHORT_NAME}
+EXAMPLESDIR= ${PREFIX}/share/examples/${SHORT_NAME}
+USE_LDCONFIG= ${PREFIX}/lib/${SHORT_NAME}
+PLIST_SUB= SVER=${SHORT_VER} SNAME=${SHORT_NAME} VERSION=${PORTVERSION}
-DOCS= README doc/BUGS doc/CHANGELOG doc/CONTRIB doc/COPYING \
+MAN3= libnet-functions.h.3 libnet-macros.h.3 libnet.h.3
+DOCS= README doc/CHANGELOG doc/CONTRIB doc/COPYING \
doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING doc/PORTED \
- doc/RAWSOCKET_NON_SEQUITUR doc/TODO doc/html/*
+ doc/RAWSOCKET_NON_SEQUITUR doc/TODO
EXAMPLES= sample/*.c
+OPTIONS_DEFINE= EXAMPLES DOCS
+OPTIONS_RADIO= LINK
+OPTIONS_RADIO_LINK= SNOOP PF BPF
+OPTIONS_DEFAULT= BPF
+SNOOP_DESC= link layer (snoop.h)
+PF_DESC= link layer pf
+BPF_DESC= link layer bpf
+
+.include <bsd.port.options.mk>
+
+LIBNET_LINK= none
+
+.if ${PORT_OPTIONS:MSNOOP}
+LIBNET_LINK= snoop
+.endif
+
+.if ${PORT_OPTIONS:MPF}
+LIBNET_LINK= pf
+.endif
+
+.if ${PORT_OPTIONS:MBPF}
+LIBNET_LINK= bpf
+.endif
+
+post-patch:
+ ${REINPLACE_CMD} \
+ -e 's|@LIBNET_CONFIG_LIBS@|@LIBNET_CONFIG_LIBS@ -L@prefix@/lib/${SHORT_NAME}|' \
+ -e 's|@LIBNET_CONFIG_CFLAGS@|@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include/${SHORT_NAME}|' \
+ ${WRKSRC}/libnet-config.in
+ ${REINPLACE_CMD} -e 's|^includedir =.*|includedir = @includedir@/${SHORT_NAME}|' \
+ ${WRKSRC}/include/Makefile.in \
+ ${WRKSRC}/include/libnet/Makefile.in
+ ${REINPLACE_CMD} -e 's|^libdir =.*|libdir = @libdir@/${SHORT_NAME}|' \
+ -e 's|^libnet_la_LDFLAGS =\(.*\)|libnet_la_LDFLAGS =\1 -soname=libnet-${SHORT_NAME}.so.1|' \
+ ${WRKSRC}/src/Makefile.in
+
post-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/libnet-config \
- ${PREFIX}/bin/libnet${PKGNAMESUFFIX}-config
-.if !defined(NOPORTEXAMPLES)
+ ${INSTALL_SCRIPT} ${WRKSRC}/libnet-config ${PREFIX}/bin/${SHORT_NAME}-config
+ @cd ${PREFIX}/lib && \
+ ${LN} -sf ${SHORT_NAME}/libnet.so libnet-${PORTVERSION}.so.8 && \
+ ${LN} -sf libnet-${PORTVERSION}.so.8 libnet-${PORTVERSION}.so
+.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
.endif
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif