dpkg-gencontrol -ldebian/changelog -isp -p$(PKG) -P$(TMP)
cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
xargs -r0 md5sum > DEBIAN/md5sums
+ # Make build reproducible:
+ # Hardcode permissions for files created by output redirection
+ chmod 644 $(TMP)/DEBIAN/md5sums $(TMP)/DEBIAN/templates
+ # Set timestamp of all files to timestamp in debian/changelog entry
find $(TMP) -depth -newermt '$(BUILD_DATE)' -print0 | \
xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
dpkg --build $(TMP) ..