diff options
author | Bruce M Simpson <bms@FreeBSD.org> | 2010-02-10 16:27:01 +0000 |
---|---|---|
committer | Bruce M Simpson <bms@FreeBSD.org> | 2010-02-10 16:27:01 +0000 |
commit | 7813f10632bedf47e6bac2a8107bfcf6bfadd89d (patch) | |
tree | dda985fee3b11a9c027171871b6393352827ea42 /net/jpcap | |
parent | Update to 1.2.6, this is a security update that addresses a buffer overflow (diff) |
Add new port jpcap, a Java JNI wrapper for libpcap.
Note: The Sourceforge version is bit-rotted. This has been tested
on amd64; there are no docs installed (yet).
Notes
Notes:
svn path=/head/; revision=249551
Diffstat (limited to 'net/jpcap')
-rw-r--r-- | net/jpcap/Makefile | 61 | ||||
-rw-r--r-- | net/jpcap/distinfo | 3 | ||||
-rw-r--r-- | net/jpcap/files/patch-src__c__Makefile | 40 | ||||
-rw-r--r-- | net/jpcap/files/pkg-message.in | 5 | ||||
-rw-r--r-- | net/jpcap/pkg-descr | 10 |
5 files changed, 119 insertions, 0 deletions
diff --git a/net/jpcap/Makefile b/net/jpcap/Makefile new file mode 100644 index 000000000000..1698fe486aab --- /dev/null +++ b/net/jpcap/Makefile @@ -0,0 +1,61 @@ +# New ports collection makefile for: jpcap +# Date created: 10 February 2010 +# Whom: bms +# +# $FreeBSD$ +# + +PORTNAME= jpcap +PORTVERSION= 0.7 +CATEGORIES= net devel java +MASTER_SITES= http://netresearch.ics.uci.edu/kfujii/jpcap/ + +MAINTAINER= bms@FreeBSD.org +COMMENT= JNI wrapper around libpcap + +LIB_DEPENDS= pcap.3:${PORTSDIR}/net/libpcap + +USE_GMAKE= yes +USE_JAVA= yes +USE_LDCONFIG= yes +MAKE_JOBS_UNSAFE= yes + +PKGMESSAGE= ${WRKDIR}/pkg-message + +SUB_FILES+= pkg-message #pkg-install +SUB_LIST+= JAVAJARDIR="${JAVAJARDIR}" + +MAKE_ENV= JAVA_HOME="${JAVA_HOME}" JAVA="${JAVA}" JAVAC="${JAVAC}" \ + JAVAH="${JAVAH}" JAR_="${JAR}" + +PLIST_FILES= %%JAVAJARDIR%%/jpcap.jar lib/libjpcap.so + +# Build JNI .so only; install pre-compiled jar. +BUILD_WRKSRC= ${WRKSRC}/src/c +ALL_TARGET= # empty + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "amd64" || ${ARCH} =="ia64" || ${ARCH} == "sparc64" +CFLAGS+= -fPIC +.else +CFLAGS+= -fpic +.endif +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib + +MAKE_ARGS+= CFLAGS="${CFLAGS}" \ + CPPFLAGS="${CPPFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + PLATFORM="FreeBSD" + +do-install: + ${INSTALL_DATA} ${WRKSRC}/src/c/libjpcap.so ${PREFIX}/lib + ${INSTALL_DATA} ${WRKSRC}/lib/jpcap.jar ${JAVAJARDIR} + +# TODO: Install docs. + +post-install: + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.post.mk> diff --git a/net/jpcap/distinfo b/net/jpcap/distinfo new file mode 100644 index 000000000000..199a3731ad48 --- /dev/null +++ b/net/jpcap/distinfo @@ -0,0 +1,3 @@ +MD5 (jpcap-0.7.tar.gz) = faa3c4be407ce3419cad90150db391a5 +SHA256 (jpcap-0.7.tar.gz) = 6dcb4de1cb0071e43746eba70dfba8098250815de30aa68305eb737e072fff6b +SIZE (jpcap-0.7.tar.gz) = 716370 diff --git a/net/jpcap/files/patch-src__c__Makefile b/net/jpcap/files/patch-src__c__Makefile new file mode 100644 index 000000000000..e95a94684e0b --- /dev/null +++ b/net/jpcap/files/patch-src__c__Makefile @@ -0,0 +1,40 @@ +--- src/c/Makefile.orig 2007-06-08 23:42:09.000000000 +0100 ++++ src/c/Makefile 2010-02-10 16:13:37.000000000 +0000 +@@ -8,7 +8,7 @@ + JNI_INCLUDE = $(JAVA_DIR)/include + + # try to detect your OS using 'uname' +-PLATFORM = $(shell "uname") ++#PLATFORM = $(shell "uname") + + ifeq ($(PLATFORM), Linux) + JNI_INCLUDE2 = $(JAVA_DIR)/include/linux +@@ -35,22 +35,23 @@ + endif + + # Specify where pcap.h is +-PCAP_INCLUDE = /usr/include ++#PCAP_INCLUDE = ++#PCAP_INCLUDE = /usr/include + #PCAP_INCLUDE = /usr/include/pcap + + #CC = cl +-CC = gcc ++#CC = gcc + + all: libjpcap.so + + libjpcap.so: JpcapCaptor.c JpcapSender.c JpcapWriter.c\ + packet_arp.c packet_datalink.c packet_icmp.c packet_ip.c\ + packet_ipv6.c packet_tcp.c packet_udp.c +- $(CC) $(COMPILE_OPTION) -I$(JNI_INCLUDE) -I$(JNI_INCLUDE2)\ +- -I$(PCAP_INCLUDE)\ ++ $(CC) $(CFLAGS) $(COMPILE_OPTION) \ ++ -I$(JNI_INCLUDE) -I$(JNI_INCLUDE2) \ + JpcapCaptor.c JpcapSender.c JpcapWriter.c\ + packet_arp.c packet_datalink.c packet_icmp.c packet_ip.c\ + packet_ipv6.c packet_tcp.c packet_udp.c\ +- -o libjpcap$(SUFFIX) -lpcap ++ -o libjpcap$(SUFFIX) $(LDFLAGS) -lpcap + clean: + -rm libjpcap$(SUFFIX) diff --git a/net/jpcap/files/pkg-message.in b/net/jpcap/files/pkg-message.in new file mode 100644 index 000000000000..a82519938be2 --- /dev/null +++ b/net/jpcap/files/pkg-message.in @@ -0,0 +1,5 @@ +================================================================== +To use jpcap, add the file +%%JAVAJARDIR%%/jpcap.jar +to your CLASSPATH. +================================================================== diff --git a/net/jpcap/pkg-descr b/net/jpcap/pkg-descr new file mode 100644 index 000000000000..ac152aab0fd0 --- /dev/null +++ b/net/jpcap/pkg-descr @@ -0,0 +1,10 @@ +Jpcap is a Java library for capturing and sending network packets. + +Using Jpcap, you can develop applications to capture packets from +a network interface and visualize/analyze them in Java. You can +also develop Java applications to send arbitrary packets through a +network interface. + +# Note: the jpcap at SourceForge is a bit outdated. + +WWW: http://netresearch.ics.uci.edu/kfujii/jpcap/doc/index.html |