Source: camitk
Version: 3.4.0-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that camitk could not be built reproducibly since it uses timestamps in
its manpage output.

The attached patch makes camitk use the environment variable
$SOURCE_DATE_EPOCH [2], which was proposed by the Debian reproducible
builds team as a way to still have timestamps in documentation but make
them be reproducible.

The value of the timestamp will be set to the latest entry in
debian/changelog.


Kind Regards,
akira

[1] https://wiki.debian.org/ReproducibleBuilds/About
[2] https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
diff -Nru camitk-3.4.0/debian/changelog camitk-3.4.0/debian/changelog
--- camitk-3.4.0/debian/changelog       2015-06-20 11:51:04.000000000 +0200
+++ camitk-3.4.0/debian/changelog       2015-08-04 13:20:50.000000000 +0200
@@ -1,3 +1,10 @@
+camitk (3.4.0-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch to use SOURCE_DATE_EPOCH
+
+ -- akira <marival...@gmail.com>  Tue, 04 Aug 2015 13:20:28 +0200
+
 camitk (3.4.0-2) unstable; urgency=low
 
   * Fix cmake missing path to ITKConfig (patch force-path-to-itkconfig)
diff -Nru camitk-3.4.0/debian/patches/series camitk-3.4.0/debian/patches/series
--- camitk-3.4.0/debian/patches/series  2015-06-20 11:51:04.000000000 +0200
+++ camitk-3.4.0/debian/patches/series  2015-08-04 13:20:23.000000000 +0200
@@ -1,2 +1,3 @@
 remove-doxygen-timestamp
 force-path-to-itkconfig
+Use-SOURCE_DATE_EPOCH
diff -Nru camitk-3.4.0/debian/patches/Use-SOURCE_DATE_EPOCH 
camitk-3.4.0/debian/patches/Use-SOURCE_DATE_EPOCH
--- camitk-3.4.0/debian/patches/Use-SOURCE_DATE_EPOCH   1970-01-01 
01:00:00.000000000 +0100
+++ camitk-3.4.0/debian/patches/Use-SOURCE_DATE_EPOCH   2015-08-05 
11:15:42.000000000 +0200
@@ -0,0 +1,26 @@
+Description: Use SOURCE_DATE_EPOCH to produce reproducible timestamps in 
manpages
+
+--- a/sdk/cmake/modules/CamiTKConfig.cmake.in
++++ b/sdk/cmake/modules/CamiTKConfig.cmake.in
+@@ -225,10 +225,17 @@ mark_as_advanced (CAMITK_CORE_LIB CAMITK
+ # additional unix system resources
+ if (UNIX)
+     # only possible on unix
+-    execute_process(COMMAND "date" "+%Y-%m-%d"
+-                    OUTPUT_VARIABLE CURRENT_DATE
+-                    OUTPUT_STRIP_TRAILING_WHITESPACE
+-    )
++    if(DEFINED ENV{SOURCE_DATE_EPOCH})
++        execute_process(COMMAND "date" "-u" "+%Y-%m-%d" 
"--date=@$ENV{SOURCE_DATE_EPOCH}"
++            OUTPUT_VARIABLE CURRENT_DATE
++            OUTPUT_STRIP_TRAILING_WHITESPACE
++            )
++    else()
++        execute_process(COMMAND "date" "+%Y-%m-%d"
++            OUTPUT_VARIABLE CURRENT_DATE
++            OUTPUT_STRIP_TRAILING_WHITESPACE
++            )
++    endif()
+     # Application man pages (always in section 1, this is an application...)
+     set(CAMITK_APPLICATION_MAN_INSTALL_DIR "share/man/man1") 
+     # Desktop file always in share/applications (freedesktop standard)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to