From 3015b57fcf79406d4db343afc95edfc0ac8d2586ab56fa6091e0ba94a5805f25 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sat, 6 May 2017 16:37:30 +0000 Subject: [PATCH] Accepting request 493207 from home:bmwiedemann:reproducible Add 03_add_build-date_param.patch from Debian to allow overriding build date of output html files OBS-URL: https://build.opensuse.org/request/show/493207 OBS-URL: https://build.opensuse.org/package/show/Publishing/texi2html?expand=0&rev=18 --- 03_add_build-date_param.patch | 93 +++++++++++++++++++++++++++++++++++ texi2html.changes | 6 +++ texi2html.spec | 2 + 3 files changed, 101 insertions(+) create mode 100644 03_add_build-date_param.patch diff --git a/03_add_build-date_param.patch b/03_add_build-date_param.patch new file mode 100644 index 0000000..4953b85 --- /dev/null +++ b/03_add_build-date_param.patch @@ -0,0 +1,93 @@ +Description: Add --build-date command line flag. + Allow create reproducible documentation passing a unix time in the command + line. +Author: Juan Picca +Last-Update: 2015-05-16 +Index: texi2html-5.0/T2h_i18n.pm +=================================================================== +--- texi2html-5.0.orig/T2h_i18n.pm ++++ texi2html-5.0/T2h_i18n.pm +@@ -315,7 +315,14 @@ sub pretty_date($) + my $lang = shift; + my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst); + +- ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); ++ if (defined $Texi2HTML::Config::BUILD_DATE) ++ { ++ ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime($Texi2HTML::Config::BUILD_DATE); ++ } ++ else ++ { ++ ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); ++ } + $year += ($year < 70) ? 2000 : 1900; + return main::gdt('{month} {day}, {year}', { 'month' => main::gdt($MONTH_NAMES[$mon]), + 'day' => $mday, 'year' => $year }); +Index: texi2html-5.0/texi2html.init +=================================================================== +--- texi2html-5.0.orig/texi2html.init ++++ texi2html-5.0/texi2html.init +@@ -296,6 +296,10 @@ $L2H = ''; + # output only one file including ToC. It only makes sense when not split + $MONOLITHIC = 1; + ++# -build-date ++# Use the given unix time as build date showing UTC timezone when it is used ++$BUILD_DATE = $ENV{'SOURCE_DATE_EPOCH'}; ++ + ###################### + # The following options are only relevant if $L2H is set + # +Index: texi2html-5.0/texi2html.pl +=================================================================== +--- texi2html-5.0.orig/texi2html.pl ++++ texi2html-5.0/texi2html.pl +@@ -333,6 +333,7 @@ $EXTERNAL_DIR + $IGNORE_PREAMBLE_TEXT + @CSS_FILES + @CSS_REFS ++$BUILD_DATE + $INLINE_CONTENTS + $INLINE_INSERTCOPYING + $PARAGRAPHINDENT +@@ -3264,6 +3265,13 @@ $T2H_OPTIONS -> {'css-ref'} = + verbose => 'generate reference to the CSS URL $s' + }; + ++$T2H_OPTIONS -> {'build-date'} = ++{ ++ type => '=i', ++ linkage => \$Texi2HTML::Config::BUILD_DATE, ++ verbose => 'use the given unix time as build date showing UTC timezone when it is used' ++}; ++ + $T2H_OPTIONS -> {'transliterate-file-names'} = + { + type => '!', +Index: texi2html-5.0/doc/texi2html.texi +=================================================================== +--- texi2html-5.0.orig/doc/texi2html.texi ++++ texi2html-5.0/doc/texi2html.texi +@@ -529,6 +529,8 @@ Display a short help and exit. + Be verbose. + @item @longopt{version} + Display version information and exit. ++@item @longopt{build-date=@var{unixtime}} ++Use the given unix time as build date showing UTC timezone when it is used. + @end table + + @c -------------------------------------------------------- +Index: texi2html-5.0/doc/texi2html.info +=================================================================== +--- texi2html-5.0.orig/doc/texi2html.info ++++ texi2html-5.0/doc/texi2html.info +@@ -439,6 +439,9 @@ Miscellaneous general options: + + Display version information and exit. + ++`--build-date=UNIXTIME' ++ Use the given unix time as build date showing UTC timezone when it is used. ++ +  + File: texi2html.info, Node: Splitting output, Next: Output files, Prev: General options, Up: Invoking texi2html + diff --git a/texi2html.changes b/texi2html.changes index b4cf6e7..35ddbcc 100644 --- a/texi2html.changes +++ b/texi2html.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat May 6 13:51:15 UTC 2017 - bwiedemann@suse.com + +- Add 03_add_build-date_param.patch from Debian to allow overriding + build date of output html files + ------------------------------------------------------------------- Fri Feb 6 16:24:25 UTC 2015 - werner@suse.de diff --git a/texi2html.spec b/texi2html.spec index 0e34dcf..d04eab4 100644 --- a/texi2html.spec +++ b/texi2html.spec @@ -26,6 +26,7 @@ Url: http://www.nongnu.org/texi2html/ Source0: http://download.savannah.nongnu.org/releases/texi2html/texi2html-%{version}.tar.bz2 Patch1: texi2html-1.78.dif Patch2: texi2html-5584.patch +Patch3: 03_add_build-date_param.patch BuildRequires: perl BuildRequires: perl-Text-Unidecode BuildRequires: perl-gettext @@ -51,6 +52,7 @@ output not specified in the Texinfo input file to be specified. %setup -q %patch1 %patch2 -p0 -b .random +%patch3 -p1 # Avoid regenerated translations.pl as this becomes broken mkdir i18n