From c9be0604cf10da3fbda6bec1b87f2905c80dcf7a Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Tue, 18 Oct 2016 03:54:21 +0200
Subject: [PATCH 1/2] debrepro: Use dpkg-buildpackage instead of ad-hoc code

Part of the reproducible machinery is handled already by
dpkg-buildpackage, so there's no need to duplicate it. We can also
pass faketime+fakeroot as a normal gain-root-command.
---
 scripts/debrepro.sh | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/scripts/debrepro.sh b/scripts/debrepro.sh
index 38dd14f..e1444fb 100755
--- a/scripts/debrepro.sh
+++ b/scripts/debrepro.sh
@@ -56,8 +56,6 @@ create_build_script() {
   echo "# package"
   echo
 
-  echo 'export SOURCE_DATE_EPOCH=$(date -d "$(dpkg-parsechangelog -SDate)" +%s)'
-
   variation PATH
   vary '' 'export PATH="$PATH":/i/capture/the/path'
 
@@ -83,13 +81,9 @@ create_build_script() {
     echo 'cd ../disorderfs'
   fi
 
-  echo
-  echo 'dpkg-source --before-build .'
-  echo 'fakeroot debian/rules clean'
-
   variation date
-  vary 'fakeroot debian/rules binary' \
-    'faketime "+213days +7hours +13minutes" fakeroot debian/rules binary'
+  vary 'dpkg-buildpackage -b -us -uc' \
+    'dpkg-buildpackage -b -us -uc -r"faketime +213days+7hours+13minutes fakeroot"'
 }
 
 
-- 
2.9.3

