aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2010-02-11 00:27:01 +0800
committerbms <bms@FreeBSD.org>2010-02-11 00:27:01 +0800
commitc6e42adae433f340634d6d062a61d56034ec390a (patch)
tree545e20d1ba7a310e2a7473d1e3b546268a54d505 /net
parentfa9ad74009de7e7fa8083adb56cf893075e54835 (diff)
downloadfreebsd-ports-gnome-c6e42adae433f340634d6d062a61d56034ec390a.tar.gz
freebsd-ports-gnome-c6e42adae433f340634d6d062a61d56034ec390a.tar.zst
freebsd-ports-gnome-c6e42adae433f340634d6d062a61d56034ec390a.zip
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).
Diffstat (limited to 'net')
-rw-r--r--net/Makefile1
-rw-r--r--net/jpcap/Makefile61
-rw-r--r--net/jpcap/distinfo3
-rw-r--r--net/jpcap/files/patch-src__c__Makefile40
-rw-r--r--net/jpcap/files/pkg-message.in5
-rw-r--r--net/jpcap/pkg-descr10
6 files changed, 120 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index 1f0776ab8136..5d187a77e74f 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -266,6 +266,7 @@
SUBDIR += java-beepcore
SUBDIR += jcifs
SUBDIR += jicmp
+ SUBDIR += jpcap
SUBDIR += jrdesktop
SUBDIR += jsch
SUBDIR += jumpgate
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