Package: pyxdg
Version: 0.19-2
Tags: patch

attached is a patch to build a python3-xdg package; I have no interest in pyxdg itself, just took it as an example for a package using debhelper v7.

The required changes are:

 - Build-depend on the python3-* packages corresponding to the
   existing python-* dependencies.

 - python3-* binary package entry in the control file.

 - Use of distribute/setuptools instead of distutils to automagically
   call 2to3 for the source code conversion.  Please check the
   converted code before uploading a package.

 - Add .install files, now necessary, because two binary packages
   are built.

 - Call dh with the option `--with python3'.  The python-xdg package
   could be built using dh_python2 too. In that case call dh with
   `--with python2,python3' and remove the build dependency on
   python-support.

 - Provide override targets for dh_auto_clean, dh_auto_build and
   dh_auto_install.


Required build dependencies can be found in experimental. Please consider uploading the package to experimental, and/or later to sid. The release team will consider freeze exceptions for python3-* packages. See
http://lists.debian.org/debian-python/2010/09/msg00021.html

diff -Nru pyxdg-0.19/debian/changelog pyxdg-0.19/debian/changelog
--- pyxdg-0.19/debian/changelog 2010-06-23 16:55:34.000000000 +0200
+++ pyxdg-0.19/debian/changelog 2010-09-15 18:50:19.000000000 +0200
@@ -1,3 +1,9 @@
+pyxdg (0.19-2.1) experimental; urgency=low
+
+  * Build a python3-xdg package.
+
+ -- Matthias Klose <d...@debian.org>  Wed, 15 Sep 2010 18:49:43 +0200
+
 pyxdg (0.19-2) unstable; urgency=low
 
   * Fix case when $XDG_*_HOME is empty (fix-BaseDirectory-cornercase.patch)
diff -Nru pyxdg-0.19/debian/control pyxdg-0.19/debian/control
--- pyxdg-0.19/debian/control   2010-01-28 11:47:59.000000000 +0100
+++ pyxdg-0.19/debian/control   2010-09-16 16:55:04.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Python Modules Team 
<python-modules-team@lists.alioth.debian.org>
 Uploaders: Piotr Lewandowski <piotr.lewandow...@gmail.com>
-Build-Depends: debhelper (>= 7), python-support
+Build-Depends: debhelper (>= 7), python-support, python3-all (>= 3.1.2-10~), 
python-setuptools, python3-setuptools
 Standards-Version: 3.8.4
 Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/pyxdg/trunk/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/pyxdg/trunk/
@@ -21,3 +21,16 @@
   * Icon Theme Specification Version 0.8
   * Recent File Spec 0.2
   * Shared-MIME-Database Specification 0.13 
+
+Package: python3-xdg
+Architecture: all
+Depends: ${misc:Depends}, ${python3:Depends}
+Description: Python3 library to access freedesktop.org standards
+ PyXDG contains implementations of freedesktop.org standards in Python:
+ .
+  * Base Directory Specification Version 0.6
+  * Menu Specification Version 1.0-draft1
+  * Desktop Entry Specification Version 1.0
+  * Icon Theme Specification Version 0.8
+  * Recent File Spec 0.2
+  * Shared-MIME-Database Specification 0.13 
diff -Nru pyxdg-0.19/debian/patches/series pyxdg-0.19/debian/patches/series
--- pyxdg-0.19/debian/patches/series    2010-06-22 16:40:52.000000000 +0200
+++ pyxdg-0.19/debian/patches/series    2010-09-16 16:57:22.000000000 +0200
@@ -4,3 +4,4 @@
 fix-BaseDirectory-empty-vars.patch
 fix-583497.patch
 fix-string-exceptions.patch
+setup-2to3.patch
diff -Nru pyxdg-0.19/debian/patches/setup-2to3.patch 
pyxdg-0.19/debian/patches/setup-2to3.patch
--- pyxdg-0.19/debian/patches/setup-2to3.patch  1970-01-01 01:00:00.000000000 
+0100
+++ pyxdg-0.19/debian/patches/setup-2to3.patch  2010-09-16 16:54:24.000000000 
+0200
@@ -0,0 +1,18 @@
+--- pyxdg-0.19.orig/setup.py
++++ pyxdg-0.19/setup.py
+@@ -1,6 +1,7 @@
+ #!/usr/bin/python
+ 
+-from distutils.core import setup
++import sys
++from setuptools import setup
+ 
+ setup( name = "pyxdg",
+        version = "0.19",
+@@ -9,5 +10,5 @@ setup( name = "pyxdg",
+        maintainer_email = "h_wen...@cojobo.net",
+        url = "http://cvs.freedesktop.org/cgi-bin/viewcvs.cgi/pyxdg/";,
+        packages = ['xdg'],
+-       license = "LGPL-2")
++       license = "LGPL-2", use_2to3=sys.version_info >= (3, 0))
+ 
diff -Nru pyxdg-0.19/debian/python3-xdg.install 
pyxdg-0.19/debian/python3-xdg.install
--- pyxdg-0.19/debian/python3-xdg.install       1970-01-01 01:00:00.000000000 
+0100
+++ pyxdg-0.19/debian/python3-xdg.install       2010-09-15 18:55:22.000000000 
+0200
@@ -0,0 +1 @@
+usr/lib/python3
diff -Nru pyxdg-0.19/debian/python-xdg.install 
pyxdg-0.19/debian/python-xdg.install
--- pyxdg-0.19/debian/python-xdg.install        1970-01-01 01:00:00.000000000 
+0100
+++ pyxdg-0.19/debian/python-xdg.install        2010-09-15 18:55:01.000000000 
+0200
@@ -0,0 +1 @@
+usr/lib/python2*
diff -Nru pyxdg-0.19/debian/rules pyxdg-0.19/debian/rules
--- pyxdg-0.19/debian/rules     2009-12-09 21:11:54.000000000 +0100
+++ pyxdg-0.19/debian/rules     2010-09-16 16:57:45.000000000 +0200
@@ -1,4 +1,20 @@
 #!/usr/bin/make -f
 
 %:
-       dh $@
+       dh $@ --with python3
+
+override_dh_auto_clean:
+       dh_auto_clean
+       rm -rf build pyxdg.egg-info
+
+override_dh_auto_build:
+       dh_auto_build
+       set -ex; for python in $(shell py3versions -r); do \
+               $$python setup.py build; \
+       done
+
+override_dh_auto_install:
+       dh_auto_install
+       set -ex; for python in $(shell py3versions -r); do \
+               $$python setup.py install --root=$(CURDIR)/debian/tmp 
--install-layout=deb; \
+       done
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/python-modules-team

Reply via email to