Source: python-pypcap
Version: 1.1.5-1

We have a Python 3 project which uses pypcap
(https://github.com/pynetwork/pypcap)
Debian currently only provides packages for Python 2
(i.e. python-pypcap)

Is there a possibility to build this package for Python 3 too?



** Version 1.1.6 **

I wrote a patch which applies to 1.1.6-1 on Git:
https://anonscm.debian.org/git/pkg-netmeasure/python-pypcap.git/tag/?h=
debian/1.1.6-1
(see attachment)

It should follow the policy / style guide:
https://wiki.debian.org/Python/LibraryStyleGuide?action=show&redirect=P
ython%2FPackaging



** Version 1.1.5 **

I also have a similar fix for building 1.1.5 for Python 3
(based on http://httpredir.debian.org/debian/pool/main/p/python-pypcap/
python-pypcap_1.1.5-1.dsc)
Please note that this requires an extra patch to make setup.py work
with python3 too.

(see patches in 1.1.5-1.tar.gz)

It should follow the policy / style guide:
https://wiki.debian.org/Python/LibraryStyleGuide?action=show&redirect=P
ython%2FPackaging



Thank you in advance!


With best regards,
Tom.

-- 
Tom Ghyselinck
Senior Engineer
tom.ghyseli...@excentis.com
Excentis
Gildestraat 8 – 9000 Gent – Belgium
Tel +32 9 269 22 91
www.excentis.com
diff -Naur python-pypcap-1.1.6.orig/debian/compat python-pypcap-1.1.6/debian/compat
--- python-pypcap-1.1.6.orig/debian/compat	2017-11-15 07:52:09.469301112 +0100
+++ python-pypcap-1.1.6/debian/compat	2017-11-15 08:18:55.808938207 +0100
@@ -1 +1 @@
-9
+10
diff -Naur python-pypcap-1.1.6.orig/debian/control python-pypcap-1.1.6/debian/control
--- python-pypcap-1.1.6.orig/debian/control	2017-11-15 07:52:09.469301112 +0100
+++ python-pypcap-1.1.6/debian/control	2017-11-15 08:20:47.812413720 +0100
@@ -3,14 +3,24 @@
 Uploaders: Iain R. Learmonth <i...@debian.org>
 Section: python
 Priority: optional
-Build-Depends: debhelper (>= 9),
-               python-all-dev,
-               python-pyrex,
+Build-Depends: debhelper (>= 10),
                libpcap0.8-dev,
                quilt,
+               python-all-dev,
+               cython,
                python-setuptools,
+               python3-all-dev,
+               cython3,
+               python3-setuptools,
                dh-python
 Standards-Version: 4.1.0
+# Define versions for Python 2:
+X-Python-Version: >= 2.6
+# Define versions for Python 3:
+# In the rules file, you can loop over `py3versions -vr` to select the Python versions to build for.
+# See also:
+#     man dh_python3
+X-Python3-Version: >= 3.2
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-netmeasure/python-pypcap.git
 Vcs-Git: https://anonscm.debian.org/git/pkg-netmeasure/python-pypcap.git
 Homepage: https://github.com/pynetwork/pypcap
@@ -22,6 +32,21 @@
          ${misc:Depends}
 Conflicts: python-libpcap
 Provides: ${python:Provides}
-Description: object-oriented Python interface for libpcap
+Description: object-oriented Python interface for libpcap (Python 2)
+ pypcap is an objected-oriented Python interface for libpcap which
+ supports packet injection and user callback functions.
+ .
+ This package installs the library for Python 2.
+
+Package: python3-pypcap
+Architecture: any
+Depends: ${python3:Depends},
+         ${shlibs:Depends},
+         ${misc:Depends}
+Conflicts: python-libpcap
+Provides: ${python3:Provides}
+Description: object-oriented Python interface for libpcap (Python 3)
  pypcap is an objected-oriented Python interface for libpcap which
  supports packet injection and user callback functions.
+ .
+ This package installs the library for Python 3.
diff -Naur python-pypcap-1.1.6.orig/debian/copyright python-pypcap-1.1.6/debian/copyright
--- python-pypcap-1.1.6.orig/debian/copyright	2017-11-15 07:52:09.469301112 +0100
+++ python-pypcap-1.1.6/debian/copyright	2017-11-15 08:18:55.809938238 +0100
@@ -1,5 +1,7 @@
 This package was debianized by Robert S. Edmonds <edmo...@debian.org> on
-Tue, 07 Aug 2007 23:47:14 -0400.
+Tue, 07 Aug 2007 23:47:14 -0400 and updated to support Python 3 by
+XRA-31 Development Team <support.xr...@excentis.com> on
+Tue, 14 Nov 2017 17:10:00 +0100.
 
 It was downloaded from
     https://pypi.python.org/pypi/pypcap
diff -Naur python-pypcap-1.1.6.orig/debian/docs python-pypcap-1.1.6/debian/docs
--- python-pypcap-1.1.6.orig/debian/docs	2017-11-15 07:52:09.469301112 +0100
+++ python-pypcap-1.1.6/debian/docs	2017-11-15 09:01:51.595154956 +0100
@@ -1 +1 @@
-README
+README.rst
diff -Naur python-pypcap-1.1.6.orig/debian/rules python-pypcap-1.1.6/debian/rules
--- python-pypcap-1.1.6.orig/debian/rules	2017-11-15 07:52:09.469301112 +0100
+++ python-pypcap-1.1.6/debian/rules	2017-11-15 08:18:55.810938269 +0100
@@ -1,8 +1,11 @@
 #!/usr/bin/make -f
 
+#export DH_VERBOSE = 1
+export PYBUILD_NAME = pypcap
+
 %:
-	dh $@ --with=python2
+	dh $@ --with=python2,python3 --buildsystem=pybuild
 
 override_dh_auto_build:
-	pyrexc pcap.pyx
+	cython3 pcap.pyx
 	dh_auto_build
diff -Naur python-pypcap-1.1.6.orig/debian/source/format python-pypcap-1.1.6/debian/source/format
--- python-pypcap-1.1.6.orig/debian/source/format	1970-01-01 01:00:00.000000000 +0100
+++ python-pypcap-1.1.6/debian/source/format	2017-11-15 08:39:00.064285046 +0100
@@ -0,0 +1 @@
+3.0 (quilt)

Attachment: 1.1.5-1.tar.gz
Description: 1.1.5-1.tar.gz

Reply via email to