]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: support reproducible builds with consistent man pages
authorPádraig Brady <P@draigBrady.com>
Fri, 27 Nov 2015 12:26:00 +0000 (12:26 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 28 Nov 2015 00:11:06 +0000 (00:11 +0000)
Use a consistent date in the generated man pages
even if SOURCE_DATE_EPOCH is not set.

* Makefile.am: Generate .timestamp 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
man/dummy-man
man/local.mk

index cc4fde7aa2f683619b78b500f4dc0b71f62521dc..d1004e1a80ecf8d0b72acd95b0b6674780e43154 100644 (file)
@@ -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
index bf31912b2eae0a0cdf11242b8cc27d597d5cb92d..f05ce2ab4fc0241bead5202d9b04db7f379087ce 100755 (executable)
@@ -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
index d1117606f1a27c75f0048c60acfc45884be605a1..56eda6b8d09941d03e188c29b62e207a229fe8df 100644 (file)
@@ -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                              \