summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCreateVersionFile.py10
-rw-r--r--debian/changelog6
-rw-r--r--debian/patches/reproducible_build.patch31
-rw-r--r--debian/patches/series1
4 files changed, 43 insertions, 5 deletions
diff --git a/CreateVersionFile.py b/CreateVersionFile.py
index 59063ad..7c562b1 100755
--- a/CreateVersionFile.py
+++ b/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, micro):
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)
diff --git a/debian/changelog b/debian/changelog
index caa9dde..3fbcde7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libavg (1.8.1-2) unstable; urgency=medium
+
+ * Apply patch from Reiner Herrmann for reproducible builds. (Closes: #797440)
+
+ -- Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com> Sun, 30 Aug 2015 23:15:42 +0100
+
libavg (1.8.1-1) unstable; urgency=medium
* New upstream release (Closes: #739664)
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)
diff --git a/debian/patches/series b/debian/patches/series
index d3b650a..abe4148 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
foreign.patch
+reproducible_build.patch