Hello community, here is the log from the commit of package groff for openSUSE:Factory checked in at 2018-11-09 07:50:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/groff (Old) and /work/SRC/openSUSE:Factory/.groff.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "groff" Fri Nov 9 07:50:19 2018 rev:56 rq:646007 version:1.22.3 Changes: -------- --- /work/SRC/openSUSE:Factory/groff/groff-full.changes 2018-03-26 11:54:10.638051077 +0200 +++ /work/SRC/openSUSE:Factory/.groff.new/groff-full.changes 2018-11-09 07:50:24.583987915 +0100 @@ -1,0 +2,6 @@ +Wed Oct 30 23:50:14 UTC 2018 - Bernhard Wiedemann <[email protected]> + +- add groff-reproducible-mdate.patch and groff-use-SDE.patch to allow + to override build time to make package build reproducible (boo#1047218) + +------------------------------------------------------------------- groff.changes: same change New: ---- groff-reproducible-mdate.patch groff-use-SDE.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ groff-full.spec ++++++ --- /var/tmp/diff_new_pack.WL3kaX/_old 2018-11-09 07:50:26.079986187 +0100 +++ /var/tmp/diff_new_pack.WL3kaX/_new 2018-11-09 07:50:26.083986182 +0100 @@ -58,6 +58,10 @@ Patch10: groff-force-locale-usage.patch # PATCH-FIX-UPSTREAM fix build with multiple threads ; taken from upstream Patch11: groff-multi-thread.patch +# PATCH-FIX-UPSTREAM e4290210f2c1db5292d97678197a986d6822d044 +Patch12: groff-use-SDE.patch +# PATCH-FIX-UPSTREAM 677274dafc5dd5f79f2a6d16270b21d2f5a16c5b +Patch13: groff-reproducible-mdate.patch BuildRequires: bison BuildRequires: fdupes BuildRequires: gcc-c++ @@ -156,6 +160,8 @@ %patch9 -p1 -b .locale2 %patch10 -p1 -b .force-locale %patch11 -b .multithread +%patch12 -p1 +%patch13 -p1 %build PATH=$PWD/src/roff/troff:$PWD/src/preproc/pic:$PWD/src/preproc/eqn:$PWD/src/preproc/tbl:$PWDsrc/preproc/refer:$PWD/src/preproc/soelim:$PATH ++++++ groff.spec ++++++ --- /var/tmp/diff_new_pack.WL3kaX/_old 2018-11-09 07:50:26.127986131 +0100 +++ /var/tmp/diff_new_pack.WL3kaX/_new 2018-11-09 07:50:26.127986131 +0100 @@ -57,6 +57,10 @@ Patch10: groff-force-locale-usage.patch # PATCH-FIX-UPSTREAM fix build with multiple threads ; taken from upstream Patch11: groff-multi-thread.patch +# PATCH-FIX-UPSTREAM e4290210f2c1db5292d97678197a986d6822d044 +Patch12: groff-use-SDE.patch +# PATCH-FIX-UPSTREAM 677274dafc5dd5f79f2a6d16270b21d2f5a16c5b +Patch13: groff-reproducible-mdate.patch BuildRequires: bison BuildRequires: fdupes BuildRequires: gcc-c++ @@ -155,6 +159,8 @@ %patch9 -p1 -b .locale2 %patch10 -p1 -b .force-locale %patch11 -b .multithread +%patch12 -p1 +%patch13 -p1 %build PATH=$PWD/src/roff/troff:$PWD/src/preproc/pic:$PWD/src/preproc/eqn:$PWD/src/preproc/tbl:$PWDsrc/preproc/refer:$PWD/src/preproc/soelim:$PATH ++++++ groff-reproducible-mdate.patch ++++++ Author: Bernhard M. Wiedemann <bwiedemann suse de> Date: 2018-11-01 Subject: make package build reproducible sometimes our patches touch .man input files and mdate picks up their mtime for use in man-page headers so we clamp the mtime to SOURCE_DATE_EPOCH if set similar to https://www.fabiankeil.de/sourcecode/electrobsd/ElectroBSD-r312620-6cfa243f1516/0079-contrib-groff-mdate.sh-Use-EPOCH_DATE-when-set.diff upstream commit 677274dafc5dd5f79f2a6d16270b21d2f5a16c5b rewrote it to similar perl, too Index: groff-1.22.3/mdate.sh =================================================================== --- groff-1.22.3.orig/mdate.sh +++ groff-1.22.3/mdate.sh @@ -19,4 +19,7 @@ # # Print the modification date of $1 `nicely'. -perl -MPOSIX -le 'print strftime("%d %B %Y", localtime((stat $ARGV[0])[9]))' $1 +perl -MPOSIX -le ' +$t=((stat $ARGV[0])[9]); +$t=$ENV{SOURCE_DATE_EPOCH} if($ENV{SOURCE_DATE_EPOCH} && $t > $ENV{SOURCE_DATE_EPOCH}); +print strftime("%d %B %Y", gmtime($t))' $1 ++++++ groff-use-SDE.patch ++++++ commit e4290210f2c1db5292d97678197a986d6822d044 Author: Colin Watson <[email protected]> Date: Fri Jul 29 03:25:26 2016 +0100 Implement `SOURCE_DATE_EPOCH' for reproducible builds. * src/include/curtime.h: New file. * src/libs/libgroff/curtime.cpp: New file. * src/libs/libgroff/libgroff.am (libgroff_a_SOURCES): Add src/libs/libgroff/curtime.cpp. * src/roff/troff/input.cpp (init_registers): Use `current_time' instead of `time(0)'. * src/devices/grohtml/post-html.cpp (html_printer::do_file_components): Likewise. (html_printer::~html_printer): Likewise. * src/devices/grops/ps.cpp (ps_printer::~ps_printer): Likewise. * src/devices/gropdf/gropdf.pl: Use `$ENV{SOURCE_DATE_EPOCH}` if available in preference to `time`. * doc/groff.texi (Environment): Document `SOURCE_DATE_EPOCH'. * src/devices/grohtml/grohtml.1.man (ENVIRONMENT): Likewise. * src/devices/gropdf/gropdf.1.man (ENVIRONMENT): Likewise. * src/devices/grops/grops.1.man (ENVIRONMENT): Likewise. Index: groff-1.22.3/src/devices/grohtml/post-html.cpp =================================================================== --- groff-1.22.3.orig/src/devices/grohtml/post-html.cpp +++ groff-1.22.3/src/devices/grohtml/post-html.cpp @@ -28,6 +28,7 @@ along with this program. If not, see <ht #include "html.h" #include "html-text.h" #include "html-table.h" +#include "curtime.h" #include <time.h> @@ -5013,7 +5014,7 @@ void html_printer::do_file_components (v .put_string(Version_string) .end_comment(); - t = time(0); + t = current_time(); html.begin_comment("CreationDate: ") .put_string(ctime(&t), strlen(ctime(&t))-1) .end_comment(); @@ -5126,7 +5127,7 @@ html_printer::~html_printer() .put_string(Version_string) .end_comment(); - t = time(0); + t = current_time(); html.begin_comment("CreationDate: ") .put_string(ctime(&t), strlen(ctime(&t))-1) .end_comment(); Index: groff-1.22.3/src/devices/gropdf/gropdf.pl =================================================================== --- groff-1.22.3.orig/src/devices/gropdf/gropdf.pl +++ groff-1.22.3/src/devices/gropdf/gropdf.pl @@ -239,13 +239,14 @@ elsif (exists($ppsz{$papersz})) @defaultmb=@mediabox=(0,0,$ppsz{$papersz}->[0],$ppsz{$papersz}->[1]); } -my (@dt)=localtime(time); +my (@dt)=localtime($ENV{SOURCE_DATE_EPOCH} || time); my $dt=PDFDate(\@dt); my %info=('Creator' => "(groff version $cfg{GROFF_VERSION})", 'Producer' => "(gropdf version $cfg{GROFF_VERSION})", 'ModDate' => "($dt)", 'CreationDate' => "($dt)"); + while (<>) { chomp; Index: groff-1.22.3/src/devices/grops/ps.cpp =================================================================== --- groff-1.22.3.orig/src/devices/grops/ps.cpp +++ groff-1.22.3/src/devices/grops/ps.cpp @@ -28,6 +28,7 @@ along with this program. If not, see <ht #include "cset.h" #include "nonposix.h" #include "paper.h" +#include "curtime.h" #include "ps.h" #include <time.h> @@ -1390,7 +1391,7 @@ ps_printer::~ps_printer() #else time_t #endif - t = time(0); + t = current_time(); fputs(ctime(&t), out.get_file()); } for (font_pointer_list *f = font_list; f; f = f->next) { Index: groff-1.22.3/src/include/curtime.h =================================================================== --- /dev/null +++ groff-1.22.3/src/include/curtime.h @@ -0,0 +1,23 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation, either version 2 of the License, or +(at your option) any later version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +The GNU General Public License version 2 (GPL2) is available in the +internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */ + +#ifdef LONG_FOR_TIME_T +long +#else +time_t +#endif +current_time(); Index: groff-1.22.3/src/libs/libgroff/curtime.cpp =================================================================== --- /dev/null +++ groff-1.22.3/src/libs/libgroff/curtime.cpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation, either version 2 of the License, or +(at your option) any later version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +The GNU General Public License version 2 (GPL2) is available in the +internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */ + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "errarg.h" +#include "error.h" + +#ifdef LONG_FOR_TIME_T +long +#else +time_t +#endif +current_time() +{ + char *source_date_epoch = getenv("SOURCE_DATE_EPOCH"); + + if (source_date_epoch) { + errno = 0; + char *endptr; + long epoch = strtol(source_date_epoch, &endptr, 10); + + if ((errno == ERANGE && (epoch == LONG_MAX || epoch == LONG_MIN)) || + (errno != 0 && epoch == 0)) + fatal("$SOURCE_DATE_EPOCH: strtol: %1", strerror(errno)); + if (endptr == source_date_epoch) + fatal("$SOURCE_DATE_EPOCH: no digits found: %1", endptr); + if (*endptr != '\0') + fatal("$SOURCE_DATE_EPOCH: trailing garbage: %1", endptr); + return epoch; + } else + return time(0); +} Index: groff-1.22.3/src/roff/troff/input.cpp =================================================================== --- groff-1.22.3.orig/src/roff/troff/input.cpp +++ groff-1.22.3/src/roff/troff/input.cpp @@ -36,6 +36,7 @@ along with this program. If not, see <ht #include "input.h" #include "defs.h" #include "unicode.h" +#include "curtime.h" // Needed for getpid() and isatty() #include "posix.h" @@ -8138,7 +8139,7 @@ static void init_registers() #else /* not LONG_FOR_TIME_T */ time_t #endif /* not LONG_FOR_TIME_T */ - t = time(0); + t = current_time(); // Use struct here to work around misfeature in old versions of g++. struct tm *tt = localtime(&t); set_number_reg("seconds", int(tt->tm_sec)); Index: groff-1.22.3/src/libs/libgroff/Makefile.sub =================================================================== --- groff-1.22.3.orig/src/libs/libgroff/Makefile.sub +++ groff-1.22.3/src/libs/libgroff/Makefile.sub @@ -32,6 +32,7 @@ OBJS=\ cmap.$(OBJEXT) \ color.$(OBJEXT) \ cset.$(OBJEXT) \ + curtime.$(OBJEXT) \ device.$(OBJEXT) \ errarg.$(OBJEXT) \ error.$(OBJEXT) \ @@ -82,6 +83,7 @@ CCSRCS=\ $(srcdir)/cmap.cpp \ $(srcdir)/color.cpp \ $(srcdir)/cset.cpp \ + $(srcdir)/curtime.cpp \ $(srcdir)/device.cpp \ $(srcdir)/errarg.cpp \ $(srcdir)/error.cpp \
