aboutsummaryrefslogtreecommitdiff
path: root/net/py-libnet
diff options
context:
space:
mode:
authorWesley Shields <wxs@FreeBSD.org>2009-07-03 15:17:42 +0000
committerWesley Shields <wxs@FreeBSD.org>2009-07-03 15:17:42 +0000
commit40d76e1ac2a3e890e40a08276f24cd0c6eae2404 (patch)
treec1c8aa335d54bc145a3f7e97dc646d1cd5188dc2 /net/py-libnet
parent11792b5ca9d32ecb24595a7a5f77509ba4d95070 (diff)
downloadports-40d76e1ac2a3e890e40a08276f24cd0c6eae2404.tar.gz
ports-40d76e1ac2a3e890e40a08276f24cd0c6eae2404.zip
Notes
Diffstat (limited to 'net/py-libnet')
-rw-r--r--net/py-libnet/Makefile26
-rw-r--r--net/py-libnet/distinfo6
-rw-r--r--net/py-libnet/files/patch-libnet.i66
-rw-r--r--net/py-libnet/pkg-plist7
4 files changed, 25 insertions, 80 deletions
diff --git a/net/py-libnet/Makefile b/net/py-libnet/Makefile
index f3767288b724..1c2b76e52890 100644
--- a/net/py-libnet/Makefile
+++ b/net/py-libnet/Makefile
@@ -7,15 +7,14 @@
#
PORTNAME= libnet
-PORTVERSION= 1.0
-PORTREVISION= 4
+PORTVERSION= 1.1
CATEGORIES= net python
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITES= SF
MASTER_SITE_SUBDIR= pylibnet
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTNAME= pylibnet-${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= sbrabez@gmail.com
COMMENT= Python module for the libnet packet construction library
BUILD_DEPENDS= ${LOCALBASE}/bin/swig1.3:${PORTSDIR}/devel/swig13 \
@@ -23,6 +22,7 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/swig1.3:${PORTSDIR}/devel/swig13 \
USE_PYTHON= yes
WRKSRC= ${WRKDIR}/${DISTNAME}/src
+WRKEXAMPLE= ${WRKDIR}/${DISTNAME}/samples
MAKE_ARGS= SWIG=${LOCALBASE}/bin/swig1.3 \
LIBNET_INCLUDES=-I${LOCALBASE}/include \
@@ -31,11 +31,11 @@ MAKE_ARGS= SWIG=${LOCALBASE}/bin/swig1.3 \
LIBNET_LIB="`${LIBNET_CONFIG} --libs`" \
CC=${CC}
-PLIST_FILES= lib/%%PYTHON_VERSION%%/site-packages/libnet.py \
- lib/%%PYTHON_VERSION%%/site-packages/_libnetc.so
-
LIBNET_CONFIG?= ${LOCALBASE}/bin/libnet10-config
+EXAMPLESFILES= test-libnet-icmp-echo-req.py test-libnet-tcp-syn.py test-libnet-arp-req.py
+EXAMPLESDIR= ${PREFIX}/share/examples/py-${PORTNAME}
+
.include <bsd.port.pre.mk>
.if ${ARCH} == "amd64"
@@ -43,13 +43,17 @@ BROKEN= Does not compile on amd64 (tries to link non-PIC libnet.a into PIC shar
.endif
post-patch:
- ${REINPLACE_CMD} -e 's,libnetcmodule.so,_libnetc.so,g' ${WRKSRC}/Makefile
${REINPLACE_CMD} -e 's,^const ,%constant ,' ${WRKSRC}/constants.i
- ${REINPLACE_CMD} -e '/^[^#]/s,libnet,_libnet,' ${WRKSRC}/libnet.py
do-install:
-.for file in libnet.py _libnetc.so
- ${INSTALL_DATA} ${WRKSRC}/${file} ${PYTHON_SITELIBDIR}
+.for f in libnet.py _libnet.so
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${PYTHON_SITELIBDIR}
.endfor
+.if !defined(NOPORTEXAMPLES)
+ ${MKDIR} ${EXAMPLESDIR}
+.for f in ${EXAMPLESFILES}
+ ${INSTALL_DATA} ${WRKEXAMPLE}/${f} ${EXAMPLESDIR}
+.endfor
+.endif
.include <bsd.port.post.mk>
diff --git a/net/py-libnet/distinfo b/net/py-libnet/distinfo
index 47c5ba5f80c8..dd25ff395d62 100644
--- a/net/py-libnet/distinfo
+++ b/net/py-libnet/distinfo
@@ -1,3 +1,3 @@
-MD5 (pylibnet-1.0.tar.gz) = 1c1556a7a9fa5c72edd118c492bac135
-SHA256 (pylibnet-1.0.tar.gz) = 6bdb8b69d957857b55bd5ea4b062698db1a5f5c96b7c57109da54b920f425cd3
-SIZE (pylibnet-1.0.tar.gz) = 16797
+MD5 (pylibnet-1.1.tar.gz) = b64252defa8acd25683cf777d33764a0
+SHA256 (pylibnet-1.1.tar.gz) = 8675e50cd8b3aaf111044e69a1428994d902af619a1770e040caa279ef5b5a77
+SIZE (pylibnet-1.1.tar.gz) = 16957
diff --git a/net/py-libnet/files/patch-libnet.i b/net/py-libnet/files/patch-libnet.i
deleted file mode 100644
index f84200981f1a..000000000000
--- a/net/py-libnet/files/patch-libnet.i
+++ /dev/null
@@ -1,66 +0,0 @@
---- ./libnet.i.orig 2008-05-01 18:08:06.000000000 +0800
-+++ ./libnet.i 2008-05-01 18:08:30.000000000 +0800
-@@ -41,7 +41,7 @@
-
- %}
-
--%except (python) {
-+%exception {
- int err;
- clear_exception();
- PyErr_Clear();
-@@ -58,41 +58,41 @@
-
- /* typemaps */
-
--%typemap(python, in) u_char *{
-- if (!($target=PyString_AsString($source))) {
-+%typemap(in) u_char *{
-+ if (!($1=PyString_AsString($input))) {
- PyErr_SetString(PyExc_TypeError,"expected a string");
- return NULL;
- }
- }
-
--%typemap(python, out) u_char *{
-- $target=PyString_FromString($source);
-+%typemap(out) u_char *{
-+ $result=PyString_FromString($1);
- }
-
--%typemap(python, in) u_long {
-- $target=PyLong_AsUnsignedLong($source);
-+%typemap(in) u_long {
-+ $1=PyLong_AsUnsignedLong($input);
- }
-
--%typemap(python, out) u_long {
-- $target=PyLong_FromUnsignedLong($source);
-+%typemap(out) u_long {
-+ $result=PyLong_FromUnsignedLong($1);
- }
-
-
- /* let functions return raw python objects */
--%typemap(python, out) PyObject * {
-- $target = $source;
-+%typemap(out) PyObject * {
-+ $result = $1;
- }
-
- /* let functions take raw python objects */
--%typemap(python, in) PyObject * {
-- $target = $source;
-+%typemap(in) PyObject * {
-+ $1 = $input;
- }
-
- typedef struct {
- struct libnet_link_int *link;
- int fd;
- char *device;
-- %addmethods {
-+ %extend {
- interface();
- ~interface();
- void open_link(char *device);
diff --git a/net/py-libnet/pkg-plist b/net/py-libnet/pkg-plist
new file mode 100644
index 000000000000..d9fbad2ef0c0
--- /dev/null
+++ b/net/py-libnet/pkg-plist
@@ -0,0 +1,7 @@
+@comment $FreeBSD$
+%%PYTHON_SITELIBDIR%%/libnet.py
+%%PYTHON_SITELIBDIR%%/_libnet.so
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-arp-req.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-icmp-echo-req.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-tcp-syn.py
+@dirrm %%EXAMPLESDIR%%