diff -Nru mpt-status-1.2.0/debian/changelog mpt-status-1.2.0/debian/changelog
--- mpt-status-1.2.0/debian/changelog	2013-12-18 10:09:58.000000000 +0100
+++ mpt-status-1.2.0/debian/changelog	2019-07-03 12:10:23.000000000 +0200
@@ -1,3 +1,14 @@
+mpt-status (1.2.0-8+hwraid1) unstable; urgency=medium
+
+  * Use lsb-release to generate unique distribution tag in pkgs version.
+  * Relax debhelper compat from 9 to 5 to support very old distributions.
+  * Rewrite rules to use regular legacy debhelper.
+  * Re-add dependency on bsd-mail | mailx.
+  * Add pciutils-dev alternative to libpci-dev for old releases.
+  * Switch source/format to 1.0 and introduce dpatch for patch mgmt.
+
+ -- Adam Cecile <acecile@le-vert.net>  Wed, 03 Jul 2019 11:27:15 +0200
+
 mpt-status (1.2.0-8) unstable; urgency=medium
 
   * QA Upload.
diff -Nru mpt-status-1.2.0/debian/compat mpt-status-1.2.0/debian/compat
--- mpt-status-1.2.0/debian/compat	2013-12-17 23:05:43.000000000 +0100
+++ mpt-status-1.2.0/debian/compat	2019-07-03 12:10:23.000000000 +0200
@@ -1 +1 @@
-9
+5
diff -Nru mpt-status-1.2.0/debian/control mpt-status-1.2.0/debian/control
--- mpt-status-1.2.0/debian/control	2013-12-17 22:47:19.000000000 +0100
+++ mpt-status-1.2.0/debian/control	2019-07-03 12:10:23.000000000 +0200
@@ -1,14 +1,13 @@
 Source: mpt-status
 Section: admin
-Priority: extra
+Priority: optional
 Maintainer: Debian QA Group <packages@qa.debian.org>
-Build-Depends: debhelper (>= 9), libpci-dev
+Build-Depends: debhelper (>= 5), libpci-dev | pciutils-dev, lsb-release, dpatch
 Standards-Version: 3.9.5
 
 Package: mpt-status
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, daemon
-Suggests: mailx
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, daemon, bsd-mailx | mailx
 Description: get RAID status out of mpt (and other) HW RAID controllers
  The mpt-status software is a query tool to access the running
  configuration and status of LSI SCSI HBAs.  mpt-status allows you to
diff -Nru mpt-status-1.2.0/debian/patches/0001-include.headers.patch mpt-status-1.2.0/debian/patches/0001-include.headers.patch
--- mpt-status-1.2.0/debian/patches/0001-include.headers.patch	2010-07-28 23:03:35.000000000 +0200
+++ mpt-status-1.2.0/debian/patches/0001-include.headers.patch	2019-07-03 12:10:23.000000000 +0200
@@ -1,5 +1,5 @@
-Include headers
-===================================================================
+#! /bin/sh /usr/share/dpatch/dpatch-run
+
 --- mpt-status-1.2.0.orig/mpt-status.h	2010-06-30 11:46:49.000000000 +0200
 +++ mpt-status-1.2.0/mpt-status.h	2010-06-30 11:48:58.000000000 +0200
 @@ -2,9 +2,6 @@
diff -Nru mpt-status-1.2.0/debian/patches/00list mpt-status-1.2.0/debian/patches/00list
--- mpt-status-1.2.0/debian/patches/00list	1970-01-01 01:00:00.000000000 +0100
+++ mpt-status-1.2.0/debian/patches/00list	2019-07-03 12:10:23.000000000 +0200
@@ -0,0 +1,3 @@
+0001-include.headers.patch
+fix_debug_crash.patch
+use_dpkg-buildflags.patch
diff -Nru mpt-status-1.2.0/debian/patches/fix_debug_crash.patch mpt-status-1.2.0/debian/patches/fix_debug_crash.patch
--- mpt-status-1.2.0/debian/patches/fix_debug_crash.patch	2013-12-17 22:59:13.000000000 +0100
+++ mpt-status-1.2.0/debian/patches/fix_debug_crash.patch	2019-07-03 12:10:23.000000000 +0200
@@ -1,11 +1,14 @@
-Subject: Fix segfault when invoked with --debug
-Author: Apollon Oikonomopoulos <apoikos@gmail.com>
-Last-Update: 2013-12-17
+#! /bin/sh /usr/share/dpatch/dpatch-run
+#
+# DP: Fix segfault when invoked with --debug
+# Author: Apollon Oikonomopoulos <apoikos@gmail.com>
+# Last-Update: 2013-12-17
+# 
+# The short form of -d is marked as requiring an argument, while the long option
+# (--debug) was marked as taking an optional argument. Since the code really
+# doesn't handle the optional argument, we change --debug to require an argument
+# and update the help message accordingly.
 
-The short form of -d is marked as requiring an argument, while the long option
-(--debug) was marked as taking an optional argument. Since the code really
-doesn't handle the optional argument, we change --debug to require an argument
-and update the help message accordingly.
 --- a/mpt-status.c
 +++ b/mpt-status.c
 @@ -57,7 +57,7 @@
diff -Nru mpt-status-1.2.0/debian/patches/series mpt-status-1.2.0/debian/patches/series
--- mpt-status-1.2.0/debian/patches/series	2013-12-17 22:49:16.000000000 +0100
+++ mpt-status-1.2.0/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-0001-include.headers.patch
-fix_debug_crash.patch
-use_dpkg-buildflags.patch
diff -Nru mpt-status-1.2.0/debian/patches/use_dpkg-buildflags.patch mpt-status-1.2.0/debian/patches/use_dpkg-buildflags.patch
--- mpt-status-1.2.0/debian/patches/use_dpkg-buildflags.patch	2013-12-17 22:57:34.000000000 +0100
+++ mpt-status-1.2.0/debian/patches/use_dpkg-buildflags.patch	2019-07-03 12:10:23.000000000 +0200
@@ -1,6 +1,9 @@
-Subject: Use hardened build flags
-Author: Apollon Oikonomopoulos <apoikos@gmail.com>
-Last-Update: 2013-12-17
+#! /bin/sh /usr/share/dpatch/dpatch-run
+# 
+# DP: Use hardened build flags
+# Author: Apollon Oikonomopoulos <apoikos@gmail.com>
+# Last-Update: 2013-12-17
+
 --- a/Makefile
 +++ b/Makefile
 @@ -3,12 +3,12 @@
diff -Nru mpt-status-1.2.0/debian/rules mpt-status-1.2.0/debian/rules
--- mpt-status-1.2.0/debian/rules	2010-07-28 23:03:35.000000000 +0200
+++ mpt-status-1.2.0/debian/rules	2019-07-03 12:10:23.000000000 +0200
@@ -1,16 +1,61 @@
 #!/usr/bin/make -f
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
+
+include /usr/share/dpatch/dpatch.make
+
 DESTDIR = $(CURDIR)/debian/mpt-status
 
-%:
-	dh  \$@
+# Get version from changelog as well as lsb_release
+# to compute unique build version (useful for repo mirroring systems doing file pooling)
+PKG_VERSION  := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f2 -d' ')
+DIST_NAME    := $(shell lsb_release -si)
+DIST_RELEASE := $(shell lsb_release -sc)
+DIST_VERSION := $(shell lsb_release -sr)
+PKG_VERSION_TAG := $(PKG_VERSION)+$(DIST_NAME).$(DIST_RELEASE).$(DIST_VERSION)
+SUBSTVARS_BINARY_VERSION := -Vbinary:Version="$(PKG_VERSION_TAG)"
+SUBSTVARS_SOURCE_VERSION := -Vsource:Version="$(PKG_VERSION_TAG)"
 
-override_dh_auto_install:
 
-override_dh_installinit:
-	dh_installinit --init-script=mpt-statusd
+build: build-arch build-indep
+build-indep:
+build-arch: build-stamp
+build-stamp: patch-stamp
+	dh_testdir
+	$(MAKE)
+	touch $@
+
+clean: unpatch 
+	dh_testdir
+	dh_testroot
+	dh_clean 
+	rm -f build-stamp
+	rm -f mpt-status
 
-override_dh_installdocs:
+install:
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+binary-indep: build install
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_install
+	dh_installchangelogs
 	dh_installdocs
-	cd $(DESTDIR)/usr/share/doc/mpt-status && mv Changelog changelog
+	mv -v $(DESTDIR)/usr/share/doc/mpt-status/Changelog $(DESTDIR)/usr/share/doc/mpt-status/changelog
+	dh_installinit --init-script=mpt-statusd
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol -- -v"$(PKG_VERSION_TAG)" $(SUBSTVARS_BINARY_VERSION) $(SUBSTVARS_SOURCE_VERSION)
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff -Nru mpt-status-1.2.0/debian/source/format mpt-status-1.2.0/debian/source/format
--- mpt-status-1.2.0/debian/source/format	2010-07-28 23:03:35.000000000 +0200
+++ mpt-status-1.2.0/debian/source/format	2019-07-03 12:10:23.000000000 +0200
@@ -1 +1 @@
-3.0 (quilt)
+1.0
