diff --git a/debian/changelog b/debian/changelog
index cceb8a3..7308032 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+hplip (3.10.5-3.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Remove the need of Python as pre-dependency of hplip.
+  * Call dh_pysupport for arch:any packages (Closes: #585627)
+  * Use /usr/share/python/python.mk:   
+    Instead of hard-coding PYTHONPATH, use the proper path depending on the
+    default Python version. 
+
+ -- Bernd Zeimetz <bzed@debian.org>  Sun, 20 Jun 2010 22:10:09 +0200
+
 hplip (3.10.5-3) unstable; urgency=high
 
   * Switch Depends: hplip:source:Version (Closes: #586385) fixes binNMU
diff --git a/debian/control b/debian/control
index 1ec9062..f3a9f39 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,6 @@ Vcs-Browser: http://svn.debian.org/wsvn/pkg-hpijs/hplip/?op=log
 
 Package: hplip
 Architecture: any
-Pre-Depends: python (>= 2.4.4~c1)
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libhpmud0 (= ${hplip:binary:Version}), hplip-data (= ${hplip:source:Version}), hplip-cups (= ${hplip:binary:Version}), 
  ${python:Depends}, python-dbus (>= 0.80), python-imaging, python-pexpect, python-notify,
diff --git a/debian/hplip.preinst b/debian/hplip.preinst
index 16ad8b3..4ea35fd 100644
--- a/debian/hplip.preinst
+++ b/debian/hplip.preinst
@@ -36,9 +36,10 @@ case "$1" in
 
 	# Stop and remove any daemon from old HPLIP installations
 	if [ -x /etc/init.d/hplip ]; then
-		invoke-rc.d hplip stop || true
-		if test -n "`ps auxwww | grep hpiod | grep -v grep`"; then
-		    echo 'Old HPLIP daemon (hpiod) should of stopped, but did not.  Please kill manually before hplip can proceed'
+		pkill hpiod || true
+		if pgrep hpiod >/dev/null; then sleep 3; pkill -9 hpiod || true; fi
+		if pgrep hpiod >/dev/null; then
+		    echo 'Old HPLIP daemon (hpiod) should have been stopped, but did not.  Please kill manually before hplip can proceed'
 		    exit 1
 		fi
 		rm -fR /etc/init.d/hplip
diff --git a/debian/rules b/debian/rules
index 5a04bfb..e7c6a49 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,17 @@ include /usr/share/dpatch/dpatch.make
 export DH_ALWAYS_EXCLUDE=CVS:.cvsignore
 #export DH_VERBOSE=1
 
+-include /usr/share/python/python.mk
+ ifeq (,$(py_sitename))
+   py_sitename = site-packages
+   py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
+   py_sitename_sh = $(py_sitename)
+   py_libdir_sh = $(py_libdir)
+endif
+PYTHON_DEFAULT_VERSION:=$(shell pyversions -dv)
+PYTHON_SITENAME:=$(call py_sitename, $(PYTHON_DEFAULT_VERSION))
+
+
 DBGPKG:=$(BASEPKG)-dbg
 PKGTMP:=$(CURDIR)/debian/tmp
 PPDDIR:=$(PKGTMP)/usr/share/ppd
@@ -230,7 +241,8 @@ install-stamp: build-stamp
 		    dest=hp-$${file%.py}; \
 		    ln -s /usr/share/hplip/$$file \
 			../../bin/$$dest 2>/dev/null || :; \
-		    PYTHONPATH=../../lib/python2.5/site-packages/:../../lib/python2.6/dist-packages/  LD_LIBRARY_PATH=../../lib/ ../../bin/$$dest --help-man > $(CURDIR)/$$dest.1 ; \
+	            PYTHONPATH=../../lib/python$(PYTHON_DEFAULT_VERSION)/$(PYTHON_SITENAME)/ \
+		        LD_LIBRARY_PATH=../../lib/ ../../bin/$$dest --help-man > $(CURDIR)/$$dest.1 ; \
 		fi; \
 	    done \
 	)
@@ -367,6 +379,7 @@ binary-arch: install-arch
 	dh_fixperms -a
 	dh_makeshlibs -a
 	dh_installdeb -a
+	dh_pysupport -a /usr/share/hplip
 	dh_shlibdeps -a --dpkg-shlibdeps-params=--ignore-missing-info
 	dh_gencontrol -a -- \
 		-V"hplip:source:Version=$(HPLIP_VERSION)" \
