[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    [libvirt] [PATCH 2/2] spec: Make the build reproducible
From:       Jiri Denemark <jdenemar () redhat ! com>
Date:       2017-11-29 13:58:33
Message-ID: 2b4c029316435fa2c1d3c72319250adb079064d6.1511963877.git.jdenemar () redhat ! com
[Download RAW message or body]

If the spec file applies a patch which touches any file in the API XMLs
dependency tree, we need to regenerate the XMLs and consequently
recreate hvsupport.html. The file will contain a time stamp in a comment
which means it will be different every time the package is built. The
commit a54c9622860 which added the time stamp also added support for
SOURCE_DATE_EPOCH environment variable. Let's set it to the time stamp
of the spec file itself to make the build reproducible.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 libvirt.spec.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index b88a977966..7e1b6a27d3 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1300,6 +1300,8 @@ exit 1
 
 # place macros above and build commands below this comment
 
+export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
+
 %if 0%{?enable_autotools}
  autoreconf -if
 %endif
@@ -1372,6 +1374,8 @@ gzip -9 ChangeLog
 %install
 rm -fr %{buildroot}
 
+export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
+
 # Avoid using makeinstall macro as it changes prefixes rather than setting
 # DESTDIR. Newer make_install macro would be better but it's not available
 # on RHEL 5, thus we need to expand it here.
-- 
2.15.1

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic