summaryrefslogtreecommitdiff
path: root/debian/patches/reproducible_build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/reproducible_build.patch')
-rw-r--r--debian/patches/reproducible_build.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..44e1f77
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,31 @@
+Author: Reiner Herrmann <reiner@reiner-h.de>
+Description: Use reproducible values for builder and buildtime
+
+Index: libavg-1.8.1/CreateVersionFile.py
+===================================================================
+--- libavg-1.8.1.orig/CreateVersionFile.py
++++ libavg-1.8.1/CreateVersionFile.py
+@@ -113,10 +113,7 @@ def getSvnBranch():
+ return (url, branch)
+
+ def getBuilder():
+- user = getpass.getuser()
+- hostname = socket.gethostname()
+-
+- return '%s@%s %s' % (user, hostname, platform.platform())
++ return "debian"
+
+ def extractComponentFromM4(text, component):
+ match = re.search(r'%s\s*\].*\[\s*([A-Za-z0-9\.]+)\s*\]' % component, text, re.M)
+@@ -142,7 +139,10 @@ def assembleVersionInfo(major, minor, mi
+ revision = getSvnRevision()
+ branchurl, branch = getSvnBranch()
+ builder = getBuilder()
+- buildtime = datetime.datetime.now().isoformat()
++ try:
++ buildtime = datetime.datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH'])).isoformat()
++ except (KeyError, ValueError):
++ buildtime = datetime.datetime.now().isoformat()
+
+ if revision and branch:
+ fullVersion = '%s-%s/r%s' % (releaseVersion, branch, revision)