Switch to pybuild
diff --git a/debian/clean b/debian/clean
deleted file mode 100644
index 45149aa16d6..00000000000
--- a/debian/clean
+++ /dev/null
@@ -1 +0,0 @@
-*.egg-info/*
diff --git a/debian/control b/debian/control
index c140eccb5a0..c795b8eb9e5 100644
--- a/debian/control
+++ b/debian/control
@@ -3,14 +3,13 @@ Section: python
 Priority: optional
 Maintainer: Debian letsencrypt <letsencrypt-devel@lists.alioth.debian.org>
 Uploaders: Francois Marier <francois@debian.org>
-Build-Depends: debhelper (>= 9), python-all (>= 2.5), python-setuptools, dh-python
+Build-Depends: debhelper (>= 9), python-all, dh-python
 Standards-Version: 3.9.6
-XS-Python-Version: >= 2.6
 Homepage: https://www.letsencrypt.org/
 
 Package: letsencrypt
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-setuptools, apache2, openssl, hashcash
+Depends: ${misc:Depends}, ${python:Depends}, apache2, openssl, hashcash
 Description: Let's Encrypt client that can update Apache configurations
  The objective of Let’s Encrypt and the ACME (Automated Certificate Management
  Environment) protocol is to make it possible to set up an HTTPS server and have
diff --git a/debian/rules b/debian/rules
index 2546968eee2..f9bfc617322 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,19 +3,13 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-PYVERS :=  $(shell pyversions -r)
+export PYBUILD_NAME=letsencrypt
 
 %:
-	dh $@ --with python2
-
-.PHONY: override_dh_auto_clean
-override_dh_auto_clean:
-	set -e; \
-	for py in $(PYVERS); do \
-		$$py -B setup.py clean; \
-		rm -rf build; \
-	done
+	dh $@ --with python2 --buildsystem=pybuild
 
 override_dh_auto_install:
 	dh_auto_install
+	 
+	# Don't install the tests 
 	rm -rf $(CURDIR)/debian/letsencrypt/usr/lib/python2.7/dist-packages/letsencrypt/client/tests/

This is the more modern way of packaging Python applications:

  https://wiki.debian.org/Python/Pybuild
