Package: python-tz
Version: 2010b-1
Severity: wishlist
Tags: patch

2011b includes Python3 support.

It isn't trivial to build python2 + python3 packages with debhelper yet,
but it's easy enough.

Here's an example approach using dh_python3 (and dh_python2, which
replaces the need for van.pydeb and the deprecated pycentral).

SR

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

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_ZA.UTF-8, LC_CTYPE=en_ZA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-tz depends on:
ii  python                  2.6.6-3+squeeze5 interactive high-level object-orie
ii  python-central          0.6.16+nmu1      register and build utility for Pyt
ii  tzdata                  2011b-2          time zone and daylight-saving time

python-tz recommends no packages.

python-tz suggests no packages.

-- no debconf information
Index: debian/control
===================================================================
--- debian/control	(revision 2156)
+++ debian/control	(working copy)
@@ -2,23 +2,42 @@
 Section: python
 Priority: optional
 Maintainer: Debian/Ubuntu Zope Team <pkg-zope-develop...@lists.alioth.debian.org>
-Uploaders: Brian Sutherland <br...@vanguardistas.net>, Fabio Tranchitella <kob...@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6), python-setuptools (>= 0.6b3), python-van.pydeb (>= 1.3.0-4), quilt (>= 0.46-7)
+Uploaders:
+ Brian Sutherland <br...@vanguardistas.net>,
+ Fabio Tranchitella <kob...@debian.org>
+Build-Depends:
+ debhelper (>= 7.0.50~),
+ python-all (>= 2.6.6-3~),
+ python-setuptools (>= 0.6b3),
+ python3-all,
+ python3-setuptools,
+ quilt (>= 0.46-7)
 Standards-Version: 3.8.3
 Homepage: http://pypi.python.org/pypi/pytz/
-XS-Python-Version: all
-XS-Vcs-Svn: svn://svn.debian.org/svn/pkg-zope/python-tz/trunk
+X-Python-Version: >= 2.3
+X-Python3-Version: >= 3.1
+Vcs-Svn: svn://svn.debian.org/svn/pkg-zope/python-tz/trunk
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-zope/python-tz/trunk
 
 Package: python-tz
 Architecture: all
-Depends: tzdata, ${pydeb:Depends}, ${python:Depends}, ${misc:Depends}
-Recommends: ${pydeb:Recommends}
-Provides: ${pydeb:Provides}, ${python:Provides}
-Suggests: ${pydeb:Suggests}
-XB-Python-Version: ${python:Versions}
+Depends: tzdata, ${misc:Depends}, ${python:Depends}
+Breaks: ${python:Breaks}
 Description: Python version of the Olson timezone database
  python-tz brings the Olson tz database into Python. This library allows
  accurate and cross platform timezone calculations using Python 2.3 or higher.
  It also solves the issue of ambiguous times at the end of daylight savings,
  which you can read more about in the Python Library Reference
  (datetime.tzinfo).
+
+Package: python3-tz
+Architecture: all
+Depends: tzdata, ${misc:Depends}, ${python3:Depends}
+Description: Python3 version of the Olson timezone database
+ python-tz brings the Olson tz database into Python. This library allows
+ accurate and cross platform timezone calculations using Python 2.3 or higher.
+ It also solves the issue of ambiguous times at the end of daylight savings,
+ which you can read more about in the Python Library Reference
+ (datetime.tzinfo).
+ .
+ This package contains the Python 3 version of the library.
Index: debian/test-pytz
===================================================================
--- debian/test-pytz	(revision 2156)
+++ debian/test-pytz	(working copy)
@@ -13,5 +13,5 @@
     tests += mod_tests
 
 if not errors:
-    print "Ran %s tests successfully." % tests
+    print("Ran %s tests successfully." % tests)
 sys.exit(errors)
Index: debian/watch
===================================================================
--- debian/watch	(revision 2156)
+++ debian/watch	(working copy)
@@ -1,2 +1,2 @@
 version=3
-http://pypi.python.org/pypi/pytz http://pypi.python.org/packages/source/p/pytz/pytz-(.*).tar.gz#md5=.*
+http://pypi.python.org/packages/source/p/pytz/pytz-(.+).zip
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 2156)
+++ debian/changelog	(working copy)
@@ -1,3 +1,10 @@
+python-tz (2011b-1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Python3 support.
+
+ -- Stefano Rivera <stefa...@debian.org>  Sun, 06 Mar 2011 11:25:51 +0200
+
 python-tz (2010b-1) unstable; urgency=low
 
   * New upstream release.
Index: debian/copyright
===================================================================
--- debian/copyright	(revision 2156)
+++ debian/copyright	(working copy)
@@ -39,7 +39,7 @@
 
 And the automatic generation code license is:
 
-Copyright (c) 2003-2008 Stuart Bishop <stu...@stuartbishop.net>
+Copyright (c) 2003-2009 Stuart Bishop <stu...@stuartbishop.net>
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
Index: debian/rules
===================================================================
--- debian/rules	(revision 2156)
+++ debian/rules	(working copy)
@@ -1,11 +1,43 @@
 #!/usr/bin/make -f
 
+PYVERS :=  $(shell pyversions -r)
+PY3VERS := $(shell py3versions -r)
+
 %:
-	dh --with pydeb --with python-central --with quilt $@
+	dh $@ --with python2,python3,quilt
 
+override_dh_auto_build:
+	set -e; \
+	for py in $(PYVERS) $(PY3VERS); do \
+		$$py setup.py build; \
+	done
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	set -e; \
+	for py in $(PYVERS) $(PY3VERS); do \
+		PYTHONPATH=. $$py debian/test-pytz; \
+	done
+endif
+
+override_dh_auto_install:
+	set -e; \
+	for py in $(PYVERS); do \
+		$$py setup.py install --skip-build --root debian/python-tz --install-layout=deb; \
+	done
+	set -e; \
+	for py in $(PY3VERS); do \
+		$$py setup.py install --skip-build --root debian/python3-tz --install-layout=deb; \
+	done
+
+override_dh_clean:
+	dh_clean
+	rm -rf build
+	rm -f *.egg-info/*
+
 override_dh_install:
 	dh_install
 	# install our testing package
 	install -D debian/test-pytz debian/python-tz/usr/lib/python-tz/test-pytz.py
 	# remove zoneinfo, our patch to pytz makes it use the one from tzdata
-	rm -rf debian/python-tz/usr/lib/python*/*-packages/pytz/zoneinfo
+	rm -rf debian/python*-tz/usr/lib/python*/*-packages/pytz/zoneinfo

Reply via email to