diff options
author | Reiner Herrmann <reiner@reiner-h.de> | 2015-11-28 23:49:00 +0100 |
---|---|---|
committer | Andrew Shadura <andrewsh@debian.org> | 2015-11-30 10:01:50 +0100 |
commit | 72d970ac76e11a8e6cd2764dd14388d1cad1a86d (patch) | |
tree | 469396e925a09f36f92c94e17a3a2673d90367b7 /debian | |
parent | 61c1a106bd81794f48e4cd85bae129f9270279e8 (diff) |
Make the build reproducible
Adds support for SOURCE_DATE_EPOCH, which sets the timestamp
in the manpage to the date from the last changelog entry.
This makes it possible to have binaries built reproducibly.
Diffstat (limited to 'debian')
-rw-r--r-- | debian/patches/03-reproducible-build.patch | 17 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/debian/patches/03-reproducible-build.patch b/debian/patches/03-reproducible-build.patch new file mode 100644 index 0000000..2800959 --- /dev/null +++ b/debian/patches/03-reproducible-build.patch @@ -0,0 +1,17 @@ +Index: libdigidoc-3.10.1.1208/cmake/modules/VersionInfo.cmake +=================================================================== +--- libdigidoc-3.10.1.1208.orig/cmake/modules/VersionInfo.cmake ++++ libdigidoc-3.10.1.1208/cmake/modules/VersionInfo.cmake +@@ -10,7 +10,11 @@ if( WIN32 ) + execute_process( COMMAND "cmd.exe" "/C date /T" OUTPUT_VARIABLE BUILD_DATE ) + string( REGEX REPLACE ".*([0-3][0-9]).([0-1][0-9]).([0-9][0-9][0-9][0-9]).*" "\\1.\\2.\\3" BUILD_DATE ${BUILD_DATE} ) + elseif( UNIX ) +- execute_process( COMMAND "date" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) ++ if (DEFINED ENV{SOURCE_DATE_EPOCH}) ++ execute_process( COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) ++ else() ++ execute_process( COMMAND "date" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE ) ++ endif() + else() + message( SEND_ERROR "date not implemented") + set( BUILD_DATE "00.00.0000" ) diff --git a/debian/patches/series b/debian/patches/series index b8d86dd..4c2d8d1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 01-manpage.patch 02-no-rpath.patch +03-reproducible-build.patch |