Package: python-ethtool
Severity: important
Tags: patch

Hi,

Please add support for Python 3 in this package. I have attached a patch to do
exactly that. If you don't have time, please allow me to NMU.

Note that the patch was made against the Git in Alioth, though it doesn't take
into account the NMU version currently in Sid. So it would have to be fixed
for that.

Last, this is important for me, because I've switched all of OpenStack to
Python 3, and this is on my way to finish the work (and this would fix the
RC bug: #892882).

Cheers,

Thomas Goirand (zigo)
From e5a221f6a0be7b6d12f1809cd8d84e25f440745a Mon Sep 17 00:00:00 2001
From: Thomas Goirand <z...@debian.org>
Date: Tue, 20 Mar 2018 22:40:03 +0000
Subject: [PATCH]   * ran wrap-and-sort -bast.   * Add Python 3 support.   *
 Standards-Version is now 4.1.3.

---
 debian/changelog |  9 +++++++++
 debian/control   | 42 +++++++++++++++++++++++++++++++++++++-----
 debian/copyright |  4 +---
 debian/rules     | 15 +++++++++++++--
 4 files changed, 60 insertions(+), 10 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 26c0b76..be8bc43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+python-ethtool (0.12-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * ran wrap-and-sort -bast.
+  * Add Python 3 support.
+  * Standards-Version is now 4.1.3.
+
+ -- Thomas Goirand <z...@debian.org>  Tue, 20 Mar 2018 22:35:22 +0000
+
 python-ethtool (0.12-1) unstable; urgency=medium
 
   * [ea5192b] Fix some other gcc5 warnings.
diff --git a/debian/control b/debian/control
index c346c13..5201912 100644
--- a/debian/control
+++ b/debian/control
@@ -1,17 +1,49 @@
 Source: python-ethtool
 Section: python
 Priority: extra
-Uploaders: Miroslav Suchý <miros...@suchy.cz>
+Uploaders:
+ Miroslav Suchý <miros...@suchy.cz>,
 Maintainer: Bernd Zeimetz <b...@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), python-all-dev (>= 2.6.6-3~), 
libnl-route-3-dev, asciidoc, pkg-config, libxml2-utils, docbook-xml, xsltproc, 
sgml-data, libxml2, docbook-xsl, docbook-xml
-Standards-Version: 3.9.3
+Build-Depends:
+ asciidoc,
+ debhelper,
+ docbook-xml,
+ docbook-xsl,
+ libnl-route-3-dev,
+ libxml2,
+ libxml2-utils,
+ pkg-config,
+ python-all-dev,
+ python-setuptools,
+ python3-all-dev,
+ python3-setuptools,
+ sgml-data,
+ xsltproc,
+Standards-Version: 4.1.3
 Homepage: https://fedorapeople.org/cgit/dsommers/public_git/python-ethtool.git/
 Vcs-Browser: 
http://anonscm.debian.org/gitweb/?p=collab-maint/spacewalk/python-ethtool.git
 Vcs-Git: git://anonscm.debian.org/collab-maint/spacewalk/python-ethtool.git
 
 Package: python-ethtool
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
-Description: Python bindings for the ethtool kernel interface
+Depends:
+ ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+Description: Python bindings for the ethtool kernel interface - Python 2.7
  Allows querying and changing of ethernet card settings, such as speed,
  port, autonegotiation, and PCI locations.
+ .
+ This package provides the Python 2.7 module.
+
+Package: python3-ethtool
+Architecture: any
+Depends:
+ ${misc:Depends},
+ ${python3:Depends},
+ ${shlibs:Depends},
+Description: Python bindings for the ethtool kernel interface - Python 3.x
+ Allows querying and changing of ethernet card settings, such as speed,
+ port, autonegotiation, and PCI locations.
+ .
+ This package provides the Python 3.x module.
diff --git a/debian/copyright b/debian/copyright
index 421fd55..dd6b229 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -33,7 +33,7 @@ On Debian systems, the complete text of the GNU General
 Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
 
 The Debian packaging is
-    Copyright 2009, Lukáš Ďurfina <lukas.durf...@gmail.com> 
+    Copyright 2009, Lukáš Ďurfina <lukas.durf...@gmail.com>
     Copyright 2012 Miroslav Suchý <miros...@suchy.cz>
     Copyright 2012 Bernd Zeimetz <b...@debian.org>
 and is licensed under the GPL 2, see above.
@@ -47,5 +47,3 @@ and is licenced under GPLv2.
  * Portions Copyright 2002 Intel (eli.kuperm...@intel.com,
  *                                christopher.le...@intel.com,
  *                                scott.feld...@intel.com)
-
-
diff --git a/debian/rules b/debian/rules
index 6e52b60..4e2bb16 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,19 +2,30 @@
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
+PYTHONS:=$(shell pyversions -vr)
+PYTHON3S:=$(shell py3versions -vr)
 
 override_dh_auto_build:
+       set -e ; set -x ; for i in $(PYTHONs) $(PYTHON3S) ; do \
+               PYTHON=python$$i python$$i setup.py build --force ; \
+       done
        dh_auto_build --buildsystem python_distutils
        cp -p pethtool.py pethtool
        cp -p pifconfig.py pifconfig
        a2x -d manpage -f manpage man/pethtool.8.asciidoc
        a2x -d manpage -f manpage man/pifconfig.8.asciidoc
 
+override_dh_auto_install:
+       python2.7 setup.py install --install-layout=deb --root 
$(CURDIR)/debian/python-ethtool
+       set -e ; set -x ; for i in $(PYTHON3S) ; do \
+               python$$i setup.py install --install-layout=deb --root 
$(CURDIR)/debian/python3-ethtool ; \
+       done
+
 clean:
-       if [ -f setup.py ]; then dh $@ --buildsystem python_distutils --with 
python2; fi
+       if [ -f setup.py ]; then dh $@ --buildsystem python_distutils --with 
python2,python3; fi
        #rm -f setup.py
        rm -f setup.cfg pethtool pifconfig man/pethtool.8 man/pifconfig.8
        rm -rf build
 
 %:
-       dh $@ --buildsystem python_distutils --with python2
+       dh $@ --buildsystem python_distutils --with python2,python3
-- 
2.16.2

Reply via email to