Package: python-psutil
Version: 0.4.1-1
Followup-For: Bug #636526

Dear Maintainer,
   
We have some internal work Python 3 packages that would like to deploy
on Wheezy, and we depend on your package.

The attached patch also closes Bug #637382, as dh_python2 and 
dhpython3 are required to effect the Python3 build.  In doing the guides on the 
Debian wiki:

http://wiki.debian.org/Python/TransitionToDHPython2

and

http://wiki.debian.org/Python/LibraryStyleGuide

were followed.

debian/rules was carefully merged with the example in the LibraryStyleGuide,
debian/control updated. 

Please note that your test code in debian rules was very carefully moved 
and made compatible  with the LibraryStyleGuide, and has had the filter 
'nocheck ' for DEB BUILD OPTIONS added.  In the default build, all the tests
still run.  The print statement you used to get the python $LIB has had
parenthesis added for Python3, and I checked the LIB statement was backwards
compatible on python2.6 and python2.7

I did note the test_get_io_counters failure on all 3 versions of Python,
and this maybe due to moving to the 3.2 kernel.  The Python3.2 test test_name
failed due to the underlying python binary being 'python3.2mu' instead of 
'python3.2' but these are definitely seperate bugs to the build bugs.

This also creates a python-psutil-doc package, and Recommends it to the
different library package.  Lintian was giving issues about clashes in the 
docs and this seems to be the best way of resolving it. There are two lintian
warnings:

W: python-psutil: hardening-no-relro 
usr/lib/python2.6/dist-packages/_psutil_linux.so
W: python-psutil: hardening-no-relro 
usr/lib/python2.6/dist-packages/_psutil_posix.so

but these look like they were already there before this patch.  I can 

Please look this over and get back to me. Could we collaborate on this please?

This patch contains almost all the work that needs to be done.  If you like, 
I can branch the svn archive, and you can edit this work so that you are 
happy with it.

It would be good to get it in for wheezy.

Cheers,

Matthew Grant, DD since before 2005

*** End of the template - remove these lines ***


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 21979)
+++ debian/changelog	(working copy)
@@ -1,3 +1,10 @@
+python-psutil (0.4.1-2~ae123) UNRELEASED; urgency=low
+
+  * Add support for Python 3.x build (Closes: #636526)
+  * Move from python-support to dh_python2 and dh_python3 (Closes: #637382)
+
+ -- Matthew Grant <matthewgra...@gmail.com>  Thu, 31 May 2012 11:40:12 +1200
+
 python-psutil (0.4.1-1) unstable; urgency=low
 
   * New upstream release
Index: debian/python3-psutil.install
===================================================================
--- debian/python3-psutil.install	(revision 0)
+++ debian/python3-psutil.install	(revision 0)
@@ -0,0 +1 @@
+usr/lib/python3
Index: debian/docs
===================================================================
--- debian/docs	(revision 21979)
+++ debian/docs	(working copy)
@@ -1 +0,0 @@
-docs
Index: debian/rules
===================================================================
--- debian/rules	(revision 21979)
+++ debian/rules	(working copy)
@@ -1,23 +1,36 @@
 #!/usr/bin/make -f
+DH_VERBOSE=1
 
-PYVERS:=$(shell pyversions -s)
+PYTHON2:=$(shell pyversions -vr)
+PYTHON3:=$(shell py3versions -vr)
 
 %:
-	dh $@
+	dh $@ --with python2,python3
 
-build:
-	dh build
-
-	# run tests
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+test-python%:
 	-for test in test_memory_leaks.py test_psutil.py ;\
 	do \
-	    for python in $(PYVERS) ; do \
-  	        echo "running "test/$$test" on "$$python ; \
-		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib") ; \
-	        PYTHONPATH=$$LIB $$python test/$$test ; \
-	    done \
+		echo "running "test/$$test" on "python$* ; \
+		LIB=$$(python$* -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print(b.build_platlib)") ; \
+		PYTHONPATH=$$LIB python$* test/$$test ; \
 	done
 
+override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
+endif
+
+build-python%:
+	python$* setup.py build
+
+override_dh_auto_build: $(PYTHON3:%=build-python%)
+	dh_auto_build
+
+install-python%:
+	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
+
+override_dh_auto_install: $(PYTHON3:%=install-python%)
+	dh_auto_install
+
 override_dh_installchangelogs:
 	dh_installchangelogs HISTORY
 
@@ -27,6 +40,11 @@
 override_dh_compress:
 	dh_compress -X.py
 
+override_dh_auto_clean:
+	dh_auto_clean
+	#rm -rf build
+	#rm -rf *.egg-info
+
 PACKAGE = python-psutil
 SRC_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \(.*\)-.*/\1/')
 SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
Index: debian/python3-psutil.examples
===================================================================
--- debian/python3-psutil.examples	(revision 0)
+++ debian/python3-psutil.examples	(revision 0)
@@ -0,0 +1 @@
+examples/*
Index: debian/python-psutil.install
===================================================================
--- debian/python-psutil.install	(revision 0)
+++ debian/python-psutil.install	(revision 0)
@@ -0,0 +1 @@
+usr/lib/python2*
Index: debian/python-psutil.doc-base
===================================================================
--- debian/python-psutil.doc-base	(revision 21979)
+++ debian/python-psutil.doc-base	(working copy)
@@ -1,13 +0,0 @@
-Document: psutil
-Title: Psutil Summary
-Author: Jay Loden, Giampaolo Rodola'
-Abstract: psutil is a module providing an interface for retrieving
- information on running processes and system utilization (CPU, memory)
- in a portable way by using Python, implementing many functionalities
- offered by command line tools like ps, top, kill and Windows task
- manager.
-Section: Programming/Python
-
-Format: HTML
-Index: /usr/share/doc/python-psutil/docs/index.html
-Files: /usr/share/doc/python-psutil/docs/*
Index: debian/python-psutil-doc.doc-base
===================================================================
--- debian/python-psutil-doc.doc-base	(revision 21979)
+++ debian/python-psutil-doc.doc-base	(working copy)
@@ -9,5 +9,5 @@
 Section: Programming/Python
 
 Format: HTML
-Index: /usr/share/doc/python-psutil/docs/index.html
-Files: /usr/share/doc/python-psutil/docs/*
+Index: /usr/share/doc/python-psutil-doc/docs/index.html
+Files: /usr/share/doc/python-psutil-doc/docs/*
Index: debian/control
===================================================================
--- debian/control	(revision 21979)
+++ debian/control	(working copy)
@@ -3,20 +3,55 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-t...@lists.alioth.debian.org>
 Uploaders: Sandro Tosi <mo...@debian.org>
-Build-Depends: debhelper (>= 7.2.18), python-all-dev, python-support (>= 1.0.0), procps
-Standards-Version: 3.9.2
-XS-Python-Version: all
+Build-Depends: debhelper (>= 7.2.18), python-all-dev (>= 2.6.6-3~), python3-all-dev (>= 3.2), procps
+Standards-Version: 3.9.3
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.2
 Homepage: http://code.google.com/p/psutil/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-psutil/trunk/
 Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-psutil/trunk/
 
 Package: python-psutil
 Architecture: any
+Recommends: python-psutil-doc
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
-Description: module providing convenience functions for managing processes
+Description: module of convenience functions for managing processes (Python 2)
  psutil is a module providing an interface for retrieving information on
  running processes and system utilization (CPU, memory) in a portable way
  by using Python, implementing many functionalities offered by tools like
  ps, top and Windows task manager.
  .
  It currently supports Linux, OS X, FreeBSD and Windows.
+ .
+ This is the Python 2 version of the package
+
+Package: python3-psutil
+Architecture: any
+Recommends: python-psutil-doc
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
+Description: module of convenience functions for managing processes (Python 3)
+ psutil is a module providing an interface for retrieving information on
+ running processes and system utilization (CPU, memory) in a portable way
+ by using Python, implementing many functionalities offered by tools like
+ ps, top and Windows task manager.
+ .
+ It currently supports Linux, OS X, FreeBSD and Windows.
+ .
+ This is the Python 3 version of the package
+
+Package: python-psutil-doc
+Architecture: all
+Section: doc
+Suggests: python-psutil|python3-psutil
+Depends: ${misc:Depends}, ${python:Depends}
+Description: Documentation for python-psutil, process management library.
+ psutil is a module providing an interface for retrieving information on
+ running processes and system utilization (CPU, memory) in a portable way
+ by using Python, implementing many functionalities offered by tools like
+ ps, top and Windows task manager.
+ .
+ It currently supports Linux, OS X, FreeBSD and Windows.
+ .
+ This is documentation for the packages.
+
+

Reply via email to