Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2014 14:08:44 +0000 (UTC)
From:      Sofian Brabez <sbz@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r355842 - in head/net/py-libnet: . files
Message-ID:  <201405301408.s4UE8ifa081552@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbz
Date: Fri May 30 14:08:43 2014
New Revision: 355842
URL: http://svnweb.freebsd.org/changeset/ports/355842
QAT: https://qat.redports.org/buildarchive/r355842/

Log:
  - Support STAGEDIR
  - Add LICENSE
  - Fix build for amd64

Added:
  head/net/py-libnet/files/
  head/net/py-libnet/files/patch-setup.py   (contents, props changed)
  head/net/py-libnet/files/patch-src__builders.c   (contents, props changed)
Modified:
  head/net/py-libnet/Makefile
  head/net/py-libnet/distinfo
  head/net/py-libnet/pkg-plist

Modified: head/net/py-libnet/Makefile
==============================================================================
--- head/net/py-libnet/Makefile	Fri May 30 14:06:38 2014	(r355841)
+++ head/net/py-libnet/Makefile	Fri May 30 14:08:43 2014	(r355842)
@@ -5,55 +5,40 @@ PORTNAME=	libnet
 PORTVERSION=	1.1
 PORTREVISION=	1
 CATEGORIES=	net python
-MASTER_SITES=	SF/py${PORTNAME}/py${PORTNAME}/py${PORTNAME}-${PORTVERSION}
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-DISTNAME=	pylibnet-${PORTVERSION}
 
 MAINTAINER=	sbz@FreeBSD.org
 COMMENT=	Python module for the libnet packet construction library
 
-BUILD_DEPENDS=	${LOCALBASE}/bin/swig1.3:${PORTSDIR}/devel/swig13 \
-		${LIBNET_CONFIG}:${PORTSDIR}/net/libnet10
+LICENSE=	GPLv3
 
-USE_PYTHON=	yes
-WRKSRC=		${WRKDIR}/${DISTNAME}/src
-WRKEXAMPLE=	${WRKDIR}/${DISTNAME}/samples
+LIB_DEPENDS=	libnet.so:${PORTSDIR}/net/libnet
 
-MAKE_ARGS=	SWIG=${LOCALBASE}/bin/swig1.3 \
-		LIBNET_INCLUDES=-I${LOCALBASE}/include \
-		PYTHON_INCLUDES=-I${PYTHON_INCLUDEDIR} \
-		CFLAGS="${CFLAGS} `${LIBNET_CONFIG} --defines` `${LIBNET_CONFIG} --cflags` -fPIC" \
-		LIBNET_LIB="`${LIBNET_CONFIG} --libs`" \
-		CC=${CC}
+USE_PYTHON=	yes
+USE_PYTHON_PREFIX=	yes
+USE_PYDISTUTILS=	yes
 
-LIBNET_CONFIG?=	${LOCALBASE}/bin/libnet10-config
+USE_GITHUB=	yes
+GH_ACCOUNT=	allfro
+GH_PROJECT=	pylibnet
+GH_TAGNAME=	${GH_COMMIT}
+GH_COMMIT=	b2fa552
 
-EXAMPLESFILES=	test-libnet-icmp-echo-req.py test-libnet-tcp-syn.py test-libnet-arp-req.py
 EXAMPLESDIR=	${PREFIX}/share/examples/py-${PORTNAME}
 
-NO_STAGE=	yes
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "amd64"
-BROKEN=		Does not compile on amd64 (tries to link non-PIC libnet.a into PIC shared library)
-.endif
-
-post-patch:
-	${REINPLACE_CMD} -e 's,^const ,%constant ,' ${WRKSRC}/constants.i
+OPTIONS_DEFINE=	EXAMPLES
+OSVER=		uname -r
 
-post-build:
-	${PYTHON_CMD} -m compileall ${WRKSRC}
-	${PYTHON_CMD} -O -m compileall ${WRKSRC}
+.include <bsd.port.options.mk>
 
 do-install:
-.for f in libnet.py libnet.pyc libnet.pyo _libnet.so
-	${INSTALL_DATA} ${WRKSRC}/${f} ${PYTHON_SITELIBDIR}
-.endfor
-.if !defined(NOPORTEXAMPLES)
-	${MKDIR} ${EXAMPLESDIR}
-.for f in ${EXAMPLESFILES}
-	${INSTALL_DATA} ${WRKEXAMPLE}/${f} ${EXAMPLESDIR}
-.endfor
+	${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
+	${INSTALL_DATA} \
+	${WRKSRC}/build/lib.${OPSYS:tl}-$$(${OSVER})-${ARCH}-${PYTHON_VER}/${PORTNAME}.so \
+	${STAGEDIR}${PYTHON_SITELIBDIR}
+.if ${PORT_OPTIONS:MEXAMPLES}
+	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Modified: head/net/py-libnet/distinfo
==============================================================================
--- head/net/py-libnet/distinfo	Fri May 30 14:06:38 2014	(r355841)
+++ head/net/py-libnet/distinfo	Fri May 30 14:08:43 2014	(r355842)
@@ -1,2 +1,2 @@
-SHA256 (pylibnet-1.1.tar.gz) = 8675e50cd8b3aaf111044e69a1428994d902af619a1770e040caa279ef5b5a77
-SIZE (pylibnet-1.1.tar.gz) = 16957
+SHA256 (libnet-1.1.tar.gz) = c15d52f3782b92e799b6cc24d4999a0ee276afe5f9e8d596f08c59debdabc1d2
+SIZE (libnet-1.1.tar.gz) = 73785

Added: head/net/py-libnet/files/patch-setup.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/py-libnet/files/patch-setup.py	Fri May 30 14:08:43 2014	(r355842)
@@ -0,0 +1,13 @@
+--- ./setup.py.orig	2011-08-02 17:53:25.000000000 +0200
++++ ./setup.py	2014-05-30 12:55:01.000000000 +0200
+@@ -5,8 +5,8 @@
+ import os
+ import sys
+ 
+-include_dir = None
+-lib_dir = None
++include_dir = '/usr/local/include/libnet11/'
++lib_dir = '/usr/local/lib/libnet11'
+ 
+ 
+ package_version = '3.0-beta-rc1'

Added: head/net/py-libnet/files/patch-src__builders.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/py-libnet/files/patch-src__builders.c	Fri May 30 14:08:43 2014	(r355842)
@@ -0,0 +1,15 @@
+--- ./src/builders.c.orig	2014-05-30 12:55:10.000000000 +0200
++++ ./src/builders.c	2014-05-30 13:00:15.000000000 +0200
+@@ -722,9 +722,9 @@
+ 	u_int16_t sum = 0;
+ 	u_int16_t id = PYLIBNET_RANDOM_U16;
+ 	u_int16_t seq = PYLIBNET_RANDOM_U16;
+-	n_time otime = PYLIBNET_RANDOM_U32;
+-	n_time rtime = PYLIBNET_RANDOM_U32;
+-	n_time ttime = PYLIBNET_RANDOM_U32;
++	u_int32_t otime = PYLIBNET_RANDOM_U32;
++	u_int32_t rtime = PYLIBNET_RANDOM_U32;
++	u_int32_t ttime = PYLIBNET_RANDOM_U32;
+ 	u_int8_t *payload = NULL;
+ 	u_int32_t payload_s = 0;
+ 	libnet_ptag_t ptag = 0;

Modified: head/net/py-libnet/pkg-plist
==============================================================================
--- head/net/py-libnet/pkg-plist	Fri May 30 14:06:38 2014	(r355841)
+++ head/net/py-libnet/pkg-plist	Fri May 30 14:08:43 2014	(r355842)
@@ -1,8 +1,9 @@
-%%PYTHON_SITELIBDIR%%/_libnet.so
-%%PYTHON_SITELIBDIR%%/libnet.py
-%%PYTHON_SITELIBDIR%%/libnet.pyc
-%%PYTHON_SITELIBDIR%%/libnet.pyo
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-arp-req.py
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-icmp-echo-req.py
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test-libnet-tcp-syn.py
-%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
+%%PYTHON_SITELIBDIR%%/libnet.so
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dnsv4.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/icmp4echo.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lnsh/dnsv4.libnet
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lnsh/tcpsyn.libnet
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lnsh/tcpxmas.libnet
+%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/lnsh
+%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405301408.s4UE8ifa081552>