Package: python-dateutil
Version: 1.4.1-3
Tags: patch

attached is a patch to build a python3-dateutil package; I have no interest in python-dateutil itself, just took it as an example for a package using cdbs.

The required changes are:

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

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

 - 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.

 - Add new targets for build/python3-dateutil::, +install/python3-dateutil::,
   clean::.

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 -u python-dateutil-1.4.1/debian/changelog 
python-dateutil-1.4.1/debian/changelog
--- python-dateutil-1.4.1/debian/changelog
+++ python-dateutil-1.4.1/debian/changelog
@@ -1,3 +1,9 @@
+python-dateutil (1.4.1-3.1) experimental; urgency=low
+
+  * Build a python3-dateutil package.
+
+ -- Matthias Klose <[email protected]>  Wed, 15 Sep 2010 19:44:13 +0200
+
 python-dateutil (1.4.1-3) unstable; urgency=low
 
   * [95a66ef] depend on tzdata and update description
diff -u python-dateutil-1.4.1/debian/control 
python-dateutil-1.4.1/debian/control
--- python-dateutil-1.4.1/debian/control
+++ python-dateutil-1.4.1/debian/control
@@ -2,7 +2,7 @@
 Section: python
 Priority: optional
 Maintainer: Guido Guenther <[email protected]>
-Build-Depends: cdbs, debhelper (>= 5), quilt, python-all-dev, python-support 
(>= 0.3), python-setuptools
+Build-Depends: cdbs, debhelper (>= 5), quilt, python-all-dev, python3-all-dev 
(>= 3.1.2-10~), python-support (>= 0.3), python-setuptools, python3-setuptools
 Standards-Version: 3.8.0
 XS-Vcs-Git: git://git.debian.org/git/calendarserver/python-dateutil.git
 XS-Vcs-Browser: http://git.debian.org/?p=calendarserver/python-dateutil.git
@@ -30,0 +31,20 @@
+Package: python3-dateutil
+Architecture: all
+Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, tzdata
+Description: powerful extensions to the standard datetime module (python3)
+ It features:
+ .
+  * computing of relative deltas (next month, next year, next monday, last week
+    of month, etc);
+  * computing of relative deltas between two given date and/or datetime objects
+  * computing of dates based on very flexible recurrence rules, using a 
superset
+    of the iCalendar specification. Parsing of RFC strings is supported as 
well.
+  * generic parsing of dates in almost any string format
+  * timezone (tzinfo) implementations for tzfile(5) format files
+    (/etc/localtime, /usr/share/zoneinfo, etc), TZ environment string (in all
+    known formats), iCalendar format files, given ranges (with help from
+    relative deltas), local machine timezone, fixed offset timezone, UTC
+    timezone
+  * computing of Easter Sunday dates for any given year, using Western, 
Orthodox
+    or Julian algorithms
+
diff -u python-dateutil-1.4.1/debian/rules python-dateutil-1.4.1/debian/rules
--- python-dateutil-1.4.1/debian/rules
+++ python-dateutil-1.4.1/debian/rules
@@ -13,2 +13,14 @@
+build/python3-dateutil::
+       python3 setup.py build
+       rm -f debian/python-dateutil/usr/lib/`pyversions 
-d`/site-packages/dateutil/zoneinfo/zoneinfo-*.tar.gz
+
+install/python3-dateutil::
+       python3 setup.py install --root=$(CURDIR)/debian/python3-dateutil 
--install-layout=deb
+       rm -f 
debian/python3-dateutil/usr/lib/python3/dist-packages/dateutil/zoneinfo/zoneinfo-*.tar.gz
+       dh_python3 -ppython3-dateutil
+
 install/python-dateutil::
        rm -f debian/python-dateutil/usr/lib/`pyversions 
-d`/site-packages/dateutil/zoneinfo/zoneinfo-*.tar.gz
+
+clean::
+       rm -rf build
diff -u python-dateutil-1.4.1/debian/patches/series 
python-dateutil-1.4.1/debian/patches/series
--- python-dateutil-1.4.1/debian/patches/series
+++ python-dateutil-1.4.1/debian/patches/series
@@ -1,0 +2 @@
+setup_2to3.diff
only in patch2:
unchanged:
--- python-dateutil-1.4.1.orig/debian/python-dateutil.install
+++ python-dateutil-1.4.1/debian/python-dateutil.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/python2* /usr/lib
only in patch2:
unchanged:
--- python-dateutil-1.4.1.orig/debian/patches/setup_2to3.diff
+++ python-dateutil-1.4.1/debian/patches/setup_2to3.diff
@@ -0,0 +1,16 @@
+--- a/setup.py
++++ b/setup.py
+@@ -3,6 +3,7 @@
+ import glob
+ import os
+ import re
++import sys
+ 
+ from setuptools import setup
+ 
+@@ -31,4 +32,5 @@
+       package_data={"": ["*.tar.gz"]},
+       include_package_data=True,
+       zip_safe=False,
++      use_2to3=sys.version_info >= (3, 0),
+       )

Reply via email to