[Reproducible-builds] Bug#831429: xorp: please make the build reproducible
Chris Lamb
lamby at debian.org
Fri Jul 15 20:35:52 UTC 2016
Source: xorp
Version: 1.8.5-4.1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org
Hi,
Whilst working on the "reproducible builds" effort [0], we noticed
that xorp could not be built reproducibly.
Patch attached.
[0] https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/libxorp/create_buildinfo.sh 2016-07-15 17:56:24.575091115 +0200
--- b/libxorp/create_buildinfo.sh 2016-07-15 21:57:56.723874929 +0200
@@ -45,7 +45,10 @@
fi
cat build_info.prefix > $BINFO
-if uname -mrspn > /dev/null 2>&1
+if [ -n "$SOURCE_DATE_EPOCH" ]
+ then
+ echo "const char* BuildInfo::getBuildMachine() { return \"Reproducible build @ $SOURCE_DATE_EPOCH\"; }" >> $BINFO
+elif uname -mrspn > /dev/null 2>&1
then
echo "const char* BuildInfo::getBuildMachine() { return \"`uname -mrspn`\"; }" >> $BINFO
else
@@ -59,7 +62,7 @@
if date > /dev/null 2>&1
then
- echo "const char* BuildInfo::getBuildDate() { return \"`date`\"; }" >> $BINFO
+ echo "const char* BuildInfo::getBuildDate() { return \"$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)})\"; }" >> $BINFO
else
echo "Warning: 'date' does not function on this system."
echo "const char* BuildInfo::getBuildDate() { return \"Unknown\"; }" >> $BINFO
@@ -68,7 +71,7 @@
if date '+%F %H:%M' > /dev/null 2>&1
then
- echo "const char* BuildInfo::getShortBuildDate() { return \"`date '+%F %H:%M'`\"; }" >> $BINFO
+ echo "const char* BuildInfo::getShortBuildDate() { return \"$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)}) '+%F %H:%M'\"; }" >> $BINFO
else
echo "Warning: date +%F %H:%M does not function on this system."
echo "const char* BuildInfo::getShortBuildDate() { return \"Unknown\"; }" >> $BINFO
More information about the Reproducible-builds
mailing list