ports/136283: [update] net/py-libnet : Update to 1.1

Sofian Brabez sbrabez at gmail.com
Fri Jul 3 13:50:08 UTC 2009


>Number:         136283
>Category:       ports
>Synopsis:       [update] net/py-libnet : Update to 1.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 03 13:50:06 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Sofian Brabez
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
>Environment:
FreeBSD freebsd.ifr.lan 7.2-STABLE FreeBSD 7.2-STABLE #0: Thu Jul  2 23:42:18 CEST 2009     root at freebsd.ifr.lan:/usr/obj/usr/src/sys/FREEBSD  i386
>Description:
- Update to 1.1
- Add pkg-plist
- Add NOPORTEXAMPLES knob
- Take over maintainership
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN py-libnet.orig/Makefile py-libnet/Makefile
--- py-libnet.orig/Makefile	2009-07-03 14:25:56.000000000 +0200
+++ py-libnet/Makefile	2009-07-03 15:15:15.000000000 +0200
@@ -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 at FreeBSD.org
+MAINTAINER=	sbrabez at gmail.com
 COMMENT=	Python module for the libnet packet construction library
 
 BUILD_DEPENDS=	${LOCALBASE}/bin/swig1.3:${PORTSDIR}/devel/swig13 \
@@ -23,6 +22,7 @@
 
 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 @@
 		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 @@
 .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 -urN py-libnet.orig/distinfo py-libnet/distinfo
--- py-libnet.orig/distinfo	2009-07-03 14:25:56.000000000 +0200
+++ py-libnet/distinfo	2009-07-03 12:08:54.000000000 +0200
@@ -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 -urN py-libnet.orig/files/patch-libnet.i py-libnet/files/patch-libnet.i
--- py-libnet.orig/files/patch-libnet.i	2009-07-03 14:25:56.000000000 +0200
+++ py-libnet/files/patch-libnet.i	1970-01-01 01:00:00.000000000 +0100
@@ -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 -urN py-libnet.orig/pkg-plist py-libnet/pkg-plist
--- py-libnet.orig/pkg-plist	1970-01-01 01:00:00.000000000 +0100
+++ py-libnet/pkg-plist	2009-07-03 15:21:20.000000000 +0200
@@ -0,0 +1,7 @@
+ at 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
+ at dirrm %%EXAMPLESDIR%%


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list