--- twisted-10.1.0.orig/twisted/scripts/tap2deb.py
+++ twisted-10.1.0/twisted/scripts/tap2deb.py
@@ -61,7 +61,7 @@
                                             vars())
     long_description = config['long_description'] or 'Automatically created by tap2deb'
     twistd_option = type_dict[config['type']]
-    date = string.strip(os.popen('822-date').read())
+    date = string.strip(os.popen('date -R').read())
     directory = deb_file + '-' + version
     python_version = '%s.%s' % sys.version_info[:2]
 
@@ -102,7 +102,7 @@
 
 [ -r /etc/default/%(deb_file)s ] && . /etc/default/%(deb_file)s
 
-test -x /usr/bin/twistd%(python_version)s || exit 0
+test -x /usr/bin/twistd || exit 0
 test -r $file || exit 0
 test -r /usr/share/%(deb_file)s/package-installed || exit 0
 
@@ -110,7 +110,7 @@
 case "$1" in
     start)
         echo -n "Starting %(deb_file)s: twistd"
-        start-stop-daemon --start --quiet --exec /usr/bin/twistd%(python_version)s -- \
+        start-stop-daemon --start --quiet --exec /usr/bin/twistd -- \
                           --pidfile=$pidfile \
                           --rundir=$rundir \
                           --%(twistd_option)s=$file \
@@ -150,12 +150,14 @@
 #!/bin/sh
 update-rc.d %(deb_file)s defaults >/dev/null
 invoke-rc.d %(deb_file)s start
+#DEBHELPER#
 ''' % vars())
 
     save_to_file(os.path.join('.build', directory, 'debian', 'prerm'),
     '''\
 #!/bin/sh
 invoke-rc.d %(deb_file)s stop
+#DEBHELPER#
 ''' % vars())
 
     save_to_file(os.path.join('.build', directory, 'debian', 'postrm'),
@@ -182,12 +184,14 @@
 Section: net
 Priority: extra
 Maintainer: %(maintainer)s
-Build-Depends-Indep: debhelper
-Standards-Version: 3.5.6
+Build-Depends-Indep: debhelper, python (>= 2.6.5-7)
+Standards-Version: 3.8.4
+XS-Python-Version: current
 
 Package: %(deb_file)s
 Architecture: all
-Depends: python%(python_version)s-twisted
+Depends: ${python:Depends}, python-twisted-core
+XB-Python-Version: ${python:Versions}
 Description: %(description)s
  %(long_description)s
 ''' % vars())
@@ -220,7 +224,7 @@
     '''\
 #!/usr/bin/make -f
 
-export DH_COMPAT=1
+export DH_COMPAT=5
 
 build: build-stamp
 build-stamp:
@@ -257,9 +261,9 @@
 	dh_strip
 	dh_compress
 	dh_installchangelogs
+	dh_python2
 	dh_fixperms
 	dh_installdeb
-	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
