diff -pruN 0.13~~git20200326.g8e8b63c-1/bin/bbstoreaccounts/bbstoreaccounts.cpp 0.13~~git20220405.g7703ac8-1/bin/bbstoreaccounts/bbstoreaccounts.cpp
--- 0.13~~git20200326.g8e8b63c-1/bin/bbstoreaccounts/bbstoreaccounts.cpp	2020-03-26 20:07:58.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/bin/bbstoreaccounts/bbstoreaccounts.cpp	2022-04-05 20:43:42.000000000 +0000
@@ -130,19 +130,35 @@ int main(int argc, const char *argv[])
 
 	// Read in the configuration file
 	std::string errs;
-	std::auto_ptr<Configuration> config(
+	std::auto_ptr<Configuration> apConfig(
 		Configuration::LoadAndVerify
 			(configFilename, &BackupConfigFileVerify, errs));
 
-	if(config.get() == 0 || !errs.empty())
+	if(apConfig.get() == 0 || !errs.empty())
 	{
 		BOX_ERROR("Invalid configuration file " << configFilename <<
 			":" << errs);
 	}
 
+#ifndef WIN32
+	// Handle changing to a different user, to match bbstored, to ensure that files don't end up
+	// owned by the wrong user.
+	const Configuration &serverConfig(
+		apConfig->GetSubConfiguration("Server"));
+
+	if(serverConfig.KeyExists("User"))
+	{
+		// Config file specifies an user -- look up
+		UnixUser daemonUser(serverConfig.GetKeyValue("User").c_str());
+
+		// Change the process ID
+		daemonUser.ChangeProcessUser(); // temporary=false
+	}
+#endif
+
 	// Initialise the raid file controller
 	RaidFileController &rcontroller(RaidFileController::GetController());
-	rcontroller.Initialise(config->GetKeyValue("RaidFileConf").c_str());
+	rcontroller.Initialise(apConfig->GetKeyValue("RaidFileConf").c_str());
 
 	// Then... check we have two arguments
 	if(argc < 2)
@@ -158,7 +174,7 @@ int main(int argc, const char *argv[])
 	}
 	
 	std::string command = argv[0];
-	BackupStoreAccountsControl control(*config, machineReadableOutput);
+	BackupStoreAccountsControl control(*apConfig, machineReadableOutput);
 	
 	// Now do the command.
 	if(command == "create")
diff -pruN 0.13~~git20200326.g8e8b63c-1/.cirrus.yml 0.13~~git20220405.g7703ac8-1/.cirrus.yml
--- 0.13~~git20200326.g8e8b63c-1/.cirrus.yml	2020-03-26 20:07:58.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/.cirrus.yml	2022-04-05 20:43:42.000000000 +0000
@@ -27,7 +27,7 @@ task:
     image_project: centos-cloud
     image_name: centos-7-v20190619
   setup_script:
-    - yum install -y git autoconf automake gcc gcc-c++ zlib-devel openssl-devel libdb-devel readline-devel make libxslt perl-libwww-perl boost-devel
+    - yum install -y --disablerepo=google-cloud-sdk --disablerepo=google-compute-engine git autoconf automake gcc gcc-c++ zlib-devel openssl-devel libdb-devel readline-devel make libxslt perl-libwww-perl boost-devel
     - useradd -m build
     - chown -R build: .
   <<: *standard_build
@@ -44,6 +44,7 @@ task:
         - schroot --begin-session --session-name stretch-build --chroot stretch
       env:
         CHROOT: schroot --run-session --chroot stretch-build --directory /tmp/cirrus-ci-build --
+
     - name: Debian 9 amd64
       gce_instance:
         <<: *standard_gce_instance
@@ -57,14 +58,33 @@ task:
     - ${CHROOT} chown -R build: .
   <<: *standard_build
 
+freebsd_gce_instance: &freebsd_gce_instance
+  <<: *standard_gce_instance
+  platform: FreeBSD
+  image_project: freebsd-org-cloud-dev
+  # Need to use image_name for now: https://github.com/cirruslabs/cirrus-ci-docs/issues/422
+  disk: 30  # Image is 29GB, VM can't be smaller
+
 task:
-  name: FreeBSD 12.0 amd64
-  gce_instance:
-    <<: *standard_gce_instance
-    image_project: freebsd-org-cloud-dev
-    image_name: freebsd-12-0-release-amd64
-    disk: 30  # Image is 29GB, VM can't be smaller
-    platform: FreeBSD
+  matrix:
+    - name: FreeBSD 14.0 (pre) amd64
+      gce_instance:
+        <<: *freebsd_gce_instance
+        image_family: freebsd-14-0-snap
+    - name: FreeBSD 13.0 amd64
+      gce_instance:
+        <<: *freebsd_gce_instance
+        image_name: freebsd-13-0-current-amd64-v20190829
+        image_family: freebsd-13-0
+    - name: FreeBSD 12.3 amd64
+      gce_instance:
+        <<: *freebsd_gce_instance
+        image_family: freebsd-12-3
+    - name: FreeBSD 11.4 amd64
+      gce_instance:
+        <<: *freebsd_gce_instance
+        image_family: freebsd-11-4
+
   setup_script:
     - pkg install -y git autoconf automake libxslt p5-libwww boost-libs
     - pw useradd build -m -w none
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/boxbackup-client.config 0.13~~git20220405.g7703ac8-1/debian/boxbackup-client.config
--- 0.13~~git20200326.g8e8b63c-1/debian/boxbackup-client.config	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/boxbackup-client.config	2022-04-07 14:33:33.000000000 +0000
@@ -1,5 +1,7 @@
 #!/bin/bash -e
 
+set -e
+
 # Source debconf library
 . /usr/share/debconf/confmodule
 
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/boxbackup-server.config 0.13~~git20220405.g7703ac8-1/debian/boxbackup-server.config
--- 0.13~~git20200326.g8e8b63c-1/debian/boxbackup-server.config	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/boxbackup-server.config	2022-04-07 14:33:33.000000000 +0000
@@ -1,5 +1,7 @@
 #!/bin/bash -e
 
+set -e
+
 # Source debconf library
 . /usr/share/debconf/confmodule
 
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/changelog 0.13~~git20220405.g7703ac8-1/debian/changelog
--- 0.13~~git20200326.g8e8b63c-1/debian/changelog	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/changelog	2022-04-07 14:33:33.000000000 +0000
@@ -1,3 +1,27 @@
+boxbackup (0.13~~git20220405.g7703ac8-1) unstable; urgency=medium
+
+  * New upstream version 0.13~~git20220405.g7703ac8
+  * Refreshed patches
+
+ -- Ileana Dumitrescu <ileanadumi95@protonmail.com>  Thu, 07 Apr 2022 17:33:33 +0300
+
+boxbackup (0.13~~git20200326.g8e8b63c-2) unstable; urgency=medium
+
+  [ Ileana Dumitrescu ]
+  * debian/control: debhelper-compat version 13
+                    removed some lintian warnings
+                    updated maintainer (Closes: #817078)
+  * debian/rules: converted to new dh format
+  * debian/copyright: updated to dep5 version 1.0 format
+  * debian/boxbackup-client.config: added set -e
+  * debian/boxbackup-server.config: added set -e
+  * debian/compat: removed for new dh format
+
+  [ Simon Chopin ]
+  * debian/patches: added patch c++17.diff (Closes: #984002)
+
+ -- Ileana Dumitrescu <ileanadumi95@protonmail.com>  Wed, 05 Jan 2022 14:24:10 +0100
+
 boxbackup (0.13~~git20200326.g8e8b63c-1) unstable; urgency=medium
 
   * QA upload.
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/compat 0.13~~git20220405.g7703ac8-1/debian/compat
--- 0.13~~git20200326.g8e8b63c-1/debian/compat	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/compat	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-10
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/control 0.13~~git20220405.g7703ac8-1/debian/control
--- 0.13~~git20200326.g8e8b63c-1/debian/control	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/control	2022-04-07 14:33:33.000000000 +0000
@@ -1,11 +1,11 @@
 Source: boxbackup
 Section: utils
 Priority: optional
-Maintainer: Debian QA Group <packages@qa.debian.org>
+Maintainer: Ileana Dumitrescu <ileanadumi95@protonmail.com>
 Build-Depends:
  autoconf,
  automake,
- debhelper (>> 10),
+ debhelper-compat (= 13),
  docbook-utils,
  docbook-xml,
  docbook-xsl,
@@ -19,6 +19,7 @@ Standards-Version: 4.5.0
 Homepage: http://boxbackup.org
 Vcs-Git: https://salsa.debian.org/debian/boxbackup.git
 Vcs-Browser: https://salsa.debian.org/debian/boxbackup
+Rules-Requires-Root: no
 
 Package: boxbackup-server
 Architecture: any
@@ -32,6 +33,7 @@ Depends:
  ucf,
  ${misc:Depends},
  ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
 Recommends: e2fsprogs
 Description: server for the BoxBackup remote backup system
  BoxBackup is an automatic on-line backup system.
@@ -50,6 +52,7 @@ Depends:
  ucf,
  ${misc:Depends},
  ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
 Description: client for the BoxBackup remote backup system
  BoxBackup is an automatic on-line backup system.
  The client watches for changes on the local file system,
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/copyright 0.13~~git20220405.g7703ac8-1/debian/copyright
--- 0.13~~git20200326.g8e8b63c-1/debian/copyright	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/copyright	2022-04-07 14:33:33.000000000 +0000
@@ -1,48 +1,45 @@
-This package was debianized by Jérôme Schell <jerome@myreseau.org> on
-Tue,  1 Jun 2004 07:51:24 +0000.
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: boxbackup
+Upstream-Contact: Ben Summers <ben@fluffy.co.uk>
+Source: http://boxbackup.org
+
+Files: *
+Copyright: 2003-2004, Ben Summers <ben@fluffy.co.uk>
+License: BSD-4-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. All use of this software and associated advertising materials must
+    display the following acknowledgement:
+        This product includes software developed by Ben Summers.
+ 4. The names of the Authors may not be used to endorse or promote
+    products derived from this software without specific prior written
+    permission.
+ .
+ [Where legally impermissible the Authors do not disclaim liability for
+ direct physical injury or death caused solely by defects in the software
+ unless it is modified by a third party.]
+ .
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ .
+ Commentary
+ .
+ This license is based on a standard BSD license. Some minor changes in wording have been made to fit in with English law.
+ .
+ © Ben Summers, 2003, 2004
 
-It was downloaded from http://boxbackup.org
-
-Upstream Author: Ben Summers <ben@fluffy.co.uk>
-
-Copyright:
-
-Copyright (c) 2003, 2004
-     Ben Summers.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All use of this software and associated advertising materials must
-   display the following acknowledgement:
-       This product includes software developed by Ben Summers.
-4. The names of the Authors may not be used to endorse or promote
-   products derived from this software without specific prior written
-   permission.
-
-[Where legally impermissible the Authors do not disclaim liability for
-direct physical injury or death caused solely by defects in the software
-unless it is modified by a third party.]
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Commentary
-
-This license is based on a standard BSD license. Some minor changes in wording have been made to fit in with English law.
-
-© Ben Summers, 2003, 2004
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/patches/03-adjust-syslog-facility.diff 0.13~~git20220405.g7703ac8-1/debian/patches/03-adjust-syslog-facility.diff
--- 0.13~~git20200326.g8e8b63c-1/debian/patches/03-adjust-syslog-facility.diff	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/patches/03-adjust-syslog-facility.diff	2022-04-07 14:33:33.000000000 +0000
@@ -8,11 +8,9 @@ Subject: change default syslog facility
  lib/common/Logging.cpp             | 6 +++---
  3 files changed, 10 insertions(+), 4 deletions(-)
 
-diff --git a/docs/docbook/adminguide.xml b/docs/docbook/adminguide.xml
-index edb0a58..440c7d4 100644
 --- a/docs/docbook/adminguide.xml
 +++ b/docs/docbook/adminguide.xml
-@@ -286,6 +286,12 @@ local5.info                         /var/log/raidfile</programlisting>
+@@ -286,6 +286,12 @@
          <para><emphasis role="bold">Note:</emphasis> Separators must be tabs,
          otherwise these entries will be ignored.</para>
  
@@ -25,11 +23,9 @@ index edb0a58..440c7d4 100644
          <programlisting>touch /var/log/box
  touch /var/log/raidfile</programlisting>
  
-diff --git a/lib/bbstored/BackupStoreDaemon.cpp b/lib/bbstored/BackupStoreDaemon.cpp
-index 8fddf12..37b0a6f 100644
 --- a/lib/bbstored/BackupStoreDaemon.cpp
 +++ b/lib/bbstored/BackupStoreDaemon.cpp
-@@ -203,7 +203,7 @@ void BackupStoreDaemon::Run()
+@@ -203,7 +203,7 @@
  				SetProcessTitle("housekeeping, idle");
  				whichSocket = 1;
  				// Change the log name
@@ -38,11 +34,9 @@ index 8fddf12..37b0a6f 100644
  				// Log that housekeeping started
  				BOX_INFO("Housekeeping process started");
  				// Ignore term and hup
-diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp
-index 0928a4d..1cff176 100644
 --- a/lib/common/Logging.cpp
 +++ b/lib/common/Logging.cpp
-@@ -411,7 +411,7 @@ bool Syslog::Log(Log::Level level, const std::string& file, int line,
+@@ -411,7 +411,7 @@
  	return true;
  }
  
@@ -51,7 +45,7 @@ index 0928a4d..1cff176 100644
  {
  	::openlog("Box Backup", LOG_PID, mFacility);
  }
-@@ -454,8 +454,8 @@ int Syslog::GetNamedFacility(const std::string& rFacility)
+@@ -454,8 +454,8 @@
  	#undef CASE_RETURN
  
  	BOX_ERROR("Unknown log facility '" << rFacility << "', "
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/patches/05-dont_use_net_for_docs.diff 0.13~~git20220405.g7703ac8-1/debian/patches/05-dont_use_net_for_docs.diff
--- 0.13~~git20200326.g8e8b63c-1/debian/patches/05-dont_use_net_for_docs.diff	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/patches/05-dont_use_net_for_docs.diff	2022-04-07 14:33:33.000000000 +0000
@@ -7,9 +7,9 @@ Forwarded: no
 --- a/docs/Makefile
 +++ b/docs/Makefile
 @@ -10,7 +10,7 @@
-
+ 
  all: docs
-
+ 
 -DBPROC_COMMAND = xsltproc
 +DBPROC_COMMAND = xsltproc --nonet
  MKDIR_COMMAND  = mkdir
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/patches/c++17.diff 0.13~~git20220405.g7703ac8-1/debian/patches/c++17.diff
--- 0.13~~git20200326.g8e8b63c-1/debian/patches/c++17.diff	1970-01-01 00:00:00.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/patches/c++17.diff	2022-04-07 14:33:33.000000000 +0000
@@ -0,0 +1,62 @@
+Description: Mark the comparator object as const callabled
+ This fixes the build when using C++17
+Author: Simon Chopin <simon.chopin@canonical.com>
+--- a/lib/bbackupd/BackupDaemon.cpp
++++ b/lib/bbackupd/BackupDaemon.cpp
+@@ -2339,7 +2339,7 @@
+ 	// by code, rather than the OS.
+ 	typedef struct
+ 	{
+-		bool operator()(const std::string &s1, const std::string &s2)
++		bool operator()(const std::string &s1, const std::string &s2) const
+ 		{
+ 			if(s1.size() == s2.size())
+ 			{
+--- a/lib/backupstore/HousekeepStoreAccount.cpp
++++ b/lib/backupstore/HousekeepStoreAccount.cpp
+@@ -561,7 +561,7 @@
+ //		Created: 11/12/03
+ //
+ // --------------------------------------------------------------------------
+-bool HousekeepStoreAccount::DelEnCompare::operator()(const HousekeepStoreAccount::DelEn &x, const HousekeepStoreAccount::DelEn &y)
++bool HousekeepStoreAccount::DelEnCompare::operator()(const HousekeepStoreAccount::DelEn &x, const HousekeepStoreAccount::DelEn &y) const
+ {
+ 	// STL spec says this:
+ 	// A Strict Weak Ordering is a Binary Predicate that compares two objects, returning true if the first precedes the second.
+--- a/lib/backupstore/HousekeepStoreAccount.h
++++ b/lib/backupstore/HousekeepStoreAccount.h
+@@ -72,7 +72,7 @@
+ 	
+ 	struct DelEnCompare
+ 	{
+-		bool operator()(const DelEn &x, const DelEn &y);
++		bool operator()(const DelEn &x, const DelEn &y) const;
+ 	};
+ 	
+ 	int mAccountID;
+--- a/lib/common/DebugMemLeakFinder.cpp
++++ b/lib/common/DebugMemLeakFinder.cpp
+@@ -703,7 +703,7 @@
+ }
+ */
+ 
+-void *operator new[](size_t size) throw (std::bad_alloc)
++void *operator new[](size_t size) noexcept(false)
+ {
+ 	return internal_new(size, "standard libraries", 0);
+ }
+@@ -717,12 +717,12 @@
+ 	//TRACE1("delete[]() called, %08x\n", ptr);
+ }
+ 
+-void operator delete[](void *ptr) throw ()
++void operator delete[](void *ptr) noexcept
+ {
+ 	internal_delete(ptr);
+ }
+ 
+-void operator delete(void *ptr) throw ()
++void operator delete(void *ptr) noexcept
+ {
+ 	internal_delete(ptr);
+ }
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/patches/series 0.13~~git20220405.g7703ac8-1/debian/patches/series
--- 0.13~~git20200326.g8e8b63c-1/debian/patches/series	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/patches/series	2022-04-07 14:33:33.000000000 +0000
@@ -1,2 +1,3 @@
 03-adjust-syslog-facility.diff
 05-dont_use_net_for_docs.diff
+c++17.diff
diff -pruN 0.13~~git20200326.g8e8b63c-1/debian/rules 0.13~~git20220405.g7703ac8-1/debian/rules
--- 0.13~~git20200326.g8e8b63c-1/debian/rules	2020-05-10 22:55:55.000000000 +0000
+++ 0.13~~git20220405.g7703ac8-1/debian/rules	2022-04-07 14:33:33.000000000 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-# Uncomment this to turn on verbose mode. 
+# Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
 include /usr/share/dpkg/pkg-info.mk
@@ -19,25 +19,31 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_
 	INSTALL_PROGRAM += -s
 endif
 
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
+%:
+	dh $@
+	
+override_dh_autoreconf:
 	echo "$(DEB_VERSION_UPSTREAM_REVISION)" > VERSION.txt
 	echo "boxbackup" >> VERSION.txt
 	sh -x ./bootstrap
-	./configure $(DEB_EXTRA_CONFIG_FLAGS) LDFLAGS="-Wl,--as-needed"
-	touch configure-stamp
-
-build-stamp: configure-stamp
-	dh_testdir
-	$(MAKE) V=1
+	dh_autoreconf
+	
+override_dh_auto_configure:
+	./configure $(DEB_EXTRA_CONFIG_FLAGS)
+	
+override_dh_auto_test:
 # the testsuite is only really maintained on i386 and amd64
 ifneq (,$(filter $(DEB_HOST_ARCH),i386 amd64))
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 	./runtest.pl ALL
 endif
 endif
-	touch build-stamp
+	
+override_dh_auto_install:
+	mkdir -p $(TMP)/etc/logcheck/ignore.d.workstation
+	mkdir -p $(TMP)/etc/logcheck/ignore.d.server
+	install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.workstation/boxbackup-server
+	install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.server/boxbackup-server
 
 docs/docbook/instguide.pdf:
 	$(MAKE) -C docs instguide
@@ -49,57 +55,3 @@ docs/docbook/adminguide.pdf: configure-s
 
 docs: docs/docbook/instguide.pdf docs/docbook/adminguide.pdf
 	$(MAKE) -C docs manpages
-
-build-arch: build-stamp
-build-indep: docs
-
-build: build-arch build-indep
-
-clean:
-	dh_testdir
-	dh_testroot
-	dh_clean build-stamp configure-stamp
-	echo "USE_SVN_VERSION" > VERSION.txt
-	echo "boxbackup" >> VERSION.txt
-	[ ! -f Makefile ] || make clean
-	sh debian/clean.sh
-	dh_clean config.log config.status 
-
-install: DH_OPTIONS=
-install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-
-	mkdir -p $(TMP)/etc/logcheck/ignore.d.workstation
-	mkdir -p $(TMP)/etc/logcheck/ignore.d.server
-	install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.workstation/boxbackup-server
-	install -m 644 debian/boxbackup-server.logcheck.ignore $(TMP)/etc/logcheck/ignore.d.server/boxbackup-server
-
-	dh_install
-
-binary-indep:
-#  no architecture independant packages are being built
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir -a
-	dh_testroot -a
-	dh_installdebconf -a
-	dh_installdocs -a -A ExceptionCodes.txt docs/docbook/instguide.pdf docs/docbook/adminguide.pdf
-	dh_installinit -a
-	dh_installcron -a
-	dh_installman
-	dh_installchangelogs  -a
-	dh_strip -a
-	dh_compress -a
-	dh_fixperms -a
-	dh_installdeb -a
-	dh_shlibdeps -a
-	dh_gencontrol -a
-	dh_md5sums -a
-	dh_builddeb -a
-
-binary: binary-arch
-.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install docs
