Index: debian/control
===================================================================
--- debian/control	(revision 22826)
+++ debian/control	(working copy)
@@ -4,10 +4,15 @@
 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
 Uploaders: Ondrej Certik <ondrej@certik.cz>,
  Georges Khaznadar <georgesk@ofset.org>
-Build-Depends: debhelper (>= 7.0.50~), python-all (>=2.6.6-3), python-setuptools (>= 0.6b3)
+Build-Depends: debhelper (>= 8),
+               python-all (>=2.6.6-3),
+               python-setuptools (>= 0.6b3),
+               python3-all,
+               python3-setuptools
 X-Python-Version: >=2.5
-Standards-Version: 3.9.2
-Homepage: http://code.google.com/p/sympy/
+X-Python3-Version: >=3.2
+Standards-Version: 3.9.3
+Homepage: http://sympy.org/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/sympy/trunk
 Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/sympy/trunk/
 XS-DM-Upload-Allowed: yes
@@ -23,3 +28,18 @@
  simple as possible in order to be comprehensible and easily extensible. SymPy
  is written entirely in Python and does not require any external libraries,
  except optionally for plotting support.
+ .
+ This is the Python 2 version of the package.
+
+Package: python3-sympy
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}
+Recommends: ipython3, python3-numpy, texlive-fonts-extra, dvipng
+Description: Computer Algebra System (CAS) in Python
+ SymPy is a Python library for symbolic mathematics (manipulation). It aims to
+ become a full-featured computer algebra system (CAS) while keeping the code as
+ simple as possible in order to be comprehensible and easily extensible. SymPy
+ is written entirely in Python and does not require any external libraries,
+ except optionally for plotting support.
+ .
+ This is the Python 3 version of the package.
Index: debian/compat
===================================================================
--- debian/compat	(revision 22826)
+++ debian/compat	(working copy)
@@ -1 +1 @@
-5
+8
Index: debian/python-sympy.docs
===================================================================
--- debian/python-sympy.docs	(revision 0)
+++ debian/python-sympy.docs	(revision 0)
@@ -0,0 +1 @@
+README.rst
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 0)
+++ debian/patches/series	(revision 0)
@@ -0,0 +1 @@
+use2to3-nogit.patch
Index: debian/patches/use2to3-nogit.patch
===================================================================
--- debian/patches/use2to3-nogit.patch	(revision 0)
+++ debian/patches/use2to3-nogit.patch	(revision 0)
@@ -0,0 +1,18 @@
+--- a/bin/use2to3
++++ b/bin/use2to3
+@@ -69,9 +69,12 @@
+ 
+ # ask git for a list of tracked files
+ try:
+-    files = check_output(['git', 'ls-files'])
+-    filenames = files.decode('utf-8').split('\n')
+-    filenames.pop() # the last element is an empty string, delete it
++    filenames = []
++    for dirpath, dirnames, files in os.walk("."):
++        if 'debian' in dirpath:
++            continue
++        # [2:] to remove the leading './'
++        filenames.extend(os.path.join(dirpath, f)[2:] for f in files)
+ 
+     for filename in skip_files:
+         filenames.remove(filename)
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 22826)
+++ debian/changelog	(working copy)
@@ -1,3 +1,10 @@
+sympy (0.7.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Added Python 3 support.
+
+ -- Thomas Kluyver <thomas@kluyver.me.uk>  Thu, 25 Oct 2012 14:48:07 +0100
+
 sympy (0.7.1.rc1-2) unstable; urgency=low
 
   * added packages texlive-fonts-extra and dvipng to Recommends:
Index: debian/python3-sympy.install
===================================================================
--- debian/python3-sympy.install	(revision 0)
+++ debian/python3-sympy.install	(revision 0)
@@ -0,0 +1 @@
+usr/lib/python3
Index: debian/docs
===================================================================
--- debian/docs	(revision 22826)
+++ debian/docs	(working copy)
@@ -1 +0,0 @@
-README
Index: debian/rules
===================================================================
--- debian/rules	(revision 22826)
+++ debian/rules	(working copy)
@@ -9,13 +9,33 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+PYTHON2=$(shell pyversions -vr)
+PYTHON3=$(shell py3versions -vr)
+
 %:
-	dh  $@ --with python2
+	dh  $@ --with python2,python3
 
+use2to3:
+	bin/use2to3
+
+build-py3-%:
+	cd py3k-sympy && python$* build.py build_ext --inplace
+
+override_dh_auto_build: use2to3 $(PYTHON3:%=build-py3-%)
+	dh_auto_build
+
+install-py3-%:
+	cd py3k-sympy && python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
+
+install-py2-%:
+	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
+
+override_dh_auto_install: $(PYTHON3:%=install-py3-%) $(PYTHON2:%=install-py2-%)
+
 MPMATHDIR = sympy/mpmath
 override_dh_clean:
 	dh_clean
 	for f in torture.py extratest_gamma.py; do \
 	  rm -f $(MPMATHDIR)/tests/$$f; \
 	done
-	rm -f $(MPMATHDIR)/libmp/exec_py3.py
+	rm -rf py3k-sympy
Index: debian/python-sympy.install
===================================================================
--- debian/python-sympy.install	(revision 22826)
+++ debian/python-sympy.install	(working copy)
@@ -1,2 +1,4 @@
 doc/logo/*.png usr/share/pixmaps
 debian/isympy.xpm usr/share/pixmaps
+usr/lib/python2*
+usr/bin/isympy
Index: debian/watch
===================================================================
--- debian/watch	(revision 22827)
+++ debian/watch	(working copy)
@@ -1,2 +1,2 @@
 version=3
-http://code.google.com/p/sympy/downloads/list?can=1 .*/sympy-(\d[\d.]*)\.tar\.gz
+http://githubredir.debian.net/github/sympy/sympy .*/sympy-(\d[\d\.]+)\.tar\.gz
Index: debian/python3-sympy.docs
===================================================================
--- debian/python3-sympy.docs	(revision 0)
+++ debian/python3-sympy.docs	(revision 0)
@@ -0,0 +1 @@
+README.rst
