coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] build: support reproducible builds with consistant man pages


From: Pádraig Brady
Subject: [PATCH 2/2] build: support reproducible builds with consistant man pages
Date: Fri, 27 Nov 2015 13:49:12 +0000

Use a consistant date in the generated man pages
even if SOURCE_DATE_EPOCH is not set.

* Makefile.am: Generate .timetamp in the tarball.
* man/local.mk: Pass .timestamp if available to help2man.
* man/dummy-man: Don't bother with the year in the stub.

Reported in http://bugs.debian.org/806321
---
 Makefile.am   | 1 +
 man/dummy-man | 3 +--
 man/local.mk  | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index cc4fde7..d1004e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -105,6 +105,7 @@ BUILT_SOURCES = .version
 # See the rm_subst comment for details.
 dist-hook: gen-ChangeLog
        $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
+       $(AM_V_GEN)date +%s > $(distdir)/.timestamp
        $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
 
 gen_start_date = 2008-02-08
diff --git a/man/dummy-man b/man/dummy-man
index bf31912..f05ce2a 100755
--- a/man/dummy-man
+++ b/man/dummy-man
@@ -48,11 +48,10 @@ inadequate on this system.  Creating a stub man page 
instead.
 END
 
 progname=`basename_ "$1"`
-year=`LC_ALL=C date +%Y`
 bs='\'
 
 cat >"$output" <<END
-.TH "$progname" 1 "$year" "$source" "User Commands"
+.TH "$progname" 1 "$source" "User Commands"
 .SH NAME
 $progname $bs- a $source program
 .SH DESCRIPTION
diff --git a/man/local.mk b/man/local.mk
index d111760..56eda6b 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -184,7 +184,8 @@ endif
          && $(MKDIR_P) $$t                                             \
          && (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
                                $$argv$(EXEEXT))                        \
-         && $(run_help2man)                                            \
+       && : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \
+       && export SOURCE_DATE_EPOCH && $(run_help2man)                  \
                     --source='$(PACKAGE_STRING)'                       \
                     --include=$(srcdir)/man/$$name.x                   \
                     --output=$$t/$$name.1                              \
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]