mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
- Update to 1.1
- Switch to using SF macro - Pass maintainer to submitter PR: ports/136283 Submitted by: Sofian Brabez <sbrabez@gmail.com>
This commit is contained in:
parent
11792b5ca9
commit
40d76e1ac2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=237011
4 changed files with 25 additions and 80 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
7
net/py-libnet/pkg-plist
Normal file
7
net/py-libnet/pkg-plist
Normal file
|
@ -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%%
|
Loading…
Add table
Reference in a new issue