Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package transfig for openSUSE:Factory 
checked in at 2023-03-11 18:23:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/transfig (Old)
 and      /work/SRC/openSUSE:Factory/.transfig.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "transfig"

Sat Mar 11 18:23:21 2023 rev:54 rq:1070627 version:3.2.8b

Changes:
--------
--- /work/SRC/openSUSE:Factory/transfig/transfig.changes        2021-10-26 
21:03:11.163459478 +0200
+++ /work/SRC/openSUSE:Factory/.transfig.new.31432/transfig.changes     
2023-03-11 18:23:24.382682482 +0100
@@ -1,0 +2,17 @@
+Thu Mar  9 19:39:39 UTC 2023 - Stefan Brüns <[email protected]>
+
+- Make PDF output via ghostscript (for large parts) reproducible,
+  add 0001-Make-ModDate-and-CreationDate-in-PDF-reproducible.patch
+
+-------------------------------------------------------------------
+Thu Mar  9 17:02:41 UTC 2023 - Stefan Brüns <[email protected]>
+
+- Fix fig2mpdf documentation:
+  * rerun latex to get references right.
+  * uudecode images for html documentation.
+- Clean up spec file, remove parts for EOLed SLE 11.
+- Depend on texlive-epstopdf only if texlive is installed.
+- Use weak dependency on ghostscript, vector output formats
+  like EPS, PS and SVG do not depend on it.
+
+-------------------------------------------------------------------

New:
----
  0001-Make-ModDate-and-CreationDate-in-PDF-reproducible.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ transfig.spec ++++++
--- /var/tmp/diff_new_pack.XZOPWI/_old  2023-03-11 18:23:24.806684691 +0100
+++ /var/tmp/diff_new_pack.XZOPWI/_new  2023-03-11 18:23:24.810684712 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package transfig
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,59 +17,52 @@
 
 
 Name:           transfig
+Version:        3.2.8b
+Release:        0
+Summary:        Graphic Converter
+#  www.xfig.org is dead
+URL:            https://mcj.sourceforge.net/
+License:        MIT
+Group:          Productivity/Graphics/Convertors
+#Source:        
http://sourceforge.net/projects/mcj/files/fig2dev-%%{version}.tar.xz/download#/fig2dev-%%{version}.tar.xz
+Source:         fig2dev-%{version}.tar.xz
+Patch0:         transfig-3.2.8.dif
+Patch1:         1b09a8.patch
+Patch4:         transfig-fix-afl.patch
+Patch43:        fig2dev-3.2.6-fig2mpdf.patch
+Patch44:        fig2dev-3.2.6-fig2mpdf-doc.patch
+Patch45:        fig2dev-3.2.6a-RGBFILE.patch
+Patch46:        0001-Make-ModDate-and-CreationDate-in-PDF-reproducible.patch
 BuildRequires:  fdupes
 BuildRequires:  libjpeg-devel
+BuildRequires:  libpng-devel
 BuildRequires:  netpbm
-BuildRequires:  texlive-latex
-%if %suse_version > 1220
-BuildRequires:  texlive-amsfonts
-BuildRequires:  texlive-cm-super
+BuildRequires:  sharutils
+#!BuildIgnore:  texlive-tex4ht
 BuildRequires:  texlive-courier
-BuildRequires:  texlive-dvips
+BuildRequires:  texlive-latex
 %if 0%{?suse_version} > 1315
 BuildRequires:  texlive-epstopdf
 %endif
 BuildRequires:  texlive-pdftex
 BuildRequires:  texlive-times
+BuildRequires:  tex(8r.enc)
 BuildRequires:  tex(beamer.cls)
 %if 0%{?suse_version} > 1315
 BuildRequires:  tex(german.sty)
 %endif
+BuildRequires:  pkgconfig(xpm)
 BuildRequires:  tex(multimedia.sty)
 BuildRequires:  tex(times.sty)
 BuildRequires:  tex(xmpmulti.sty)
-%endif
-BuildRequires:  libpng-devel
-%if 0%{?suse_version} > 1310
-BuildRequires:  pkgconfig(xpm)
-%else
-BuildRequires:  xorg-x11-libXpm-devel
-BuildRequires:  xz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-%endif
-#  www.xfig.org is dead
-URL:            http://mcj.sourceforge.net/
 Provides:       fig2dev
-Provides:       transfig.3.2.3d
-Requires:       ghostscript-fonts-std
-Requires:       ghostscript-library
+Recommends:     ghostscript-fonts-std
+Recommends:     ghostscript-library
 Requires:       netpbm
+Recommends:     texlive-epstopdf
 %if 0%{?suse_version} > 1315
-Requires:       texlive-epstopdf
+Requires:       (texlive-epstopdf if texlive-latex)
 %endif
-Version:        3.2.8b
-Release:        0
-Summary:        Graphic Converter
-#Source:        
http://sourceforge.net/projects/mcj/files/fig2dev-%{version}.tar.xz/download#/fig2dev-%{version}.tar.xz
-License:        MIT
-Group:          Productivity/Graphics/Convertors
-Source:         fig2dev-%{version}.tar.xz
-Patch0:         transfig-3.2.8.dif
-Patch1:         1b09a8.patch
-Patch4:         transfig-fix-afl.patch
-Patch43:        fig2dev-3.2.6-fig2mpdf.patch
-Patch44:        fig2dev-3.2.6-fig2mpdf-doc.patch
-Patch45:        fig2dev-3.2.6a-RGBFILE.patch
 
 %description
 TransFig is a set of tools for creating TeX documents with graphics
@@ -81,27 +74,16 @@
 graphics description languages using the fig2dev program.  In previous
 releases, this command was implemented as a shell script.
 
-Documentation: man transfig
-
-
-
-Authors:
---------
-    Anthony Starks     <[email protected]>
-    George Ferguson    <[email protected]>
-    Herbert Bauer      <[email protected]>
-    Micah Beck         <[email protected]>
-    Supoj Sutantavibul <[email protected]>
-
 %prep
 %setup -q -n fig2dev-%{version}
-find -type f | xargs -r chmod a-x,go-w
+find -type f -exec chmod a-x,go-w '{}' \;
 %patch0 -p0 -b .0
 %patch1 -p0 -b .1
 %patch4 -p1 -b .afl
 %patch43 -p1 -b .mpdf
 %patch44 -p1 -b .mpdfdoc
 %patch45 -p1 -b .p45
+%patch46 -p1 -b .pdfmark
 
 %build
 ulimit -v unlimited || :
@@ -155,32 +137,44 @@
     --docdir=%{_defaultdocdir}/%{name} \
     --enable-transfig \
     --enable-scale-pic2t2e
-make %{?_smp_mflags} CCOPTIONS="$CFLAGS"
+%make_build CCOPTIONS="$CFLAGS"
+
+pushd transfig/doc
+    ../../fig2dev/fig2dev -L latex trans.fig > trans.tex
+    pdflatex -draft manual.tex
+    pdflatex -draft manual.tex
+    pdflatex manual.tex
+popd
+
+pushd  fig2mpdf/doc
+%if 0%{?suse_version} > 1315
+    make
+    while $(grep -q -i 'rerunfilecheck.*warning' sample-presentation.log); do
+        pdflatex sample-presentation
+    done
+%endif
+    mkdir htmlimg
+    (cd htmlimg; uudecode ../*.uue)
+popd
 
 %install
-find -name '*.mpdfdoc' -o -name '*.mpdf' | xargs -r rm -vf
-make DESTDIR=%{buildroot} install
+#find -name '*.mpdfdoc' -o -name '*.mpdf' | xargs -r rm -vf
+%make_install
 install -m 0755 fig2mpdf/fig2mpdf %{buildroot}%{_bindir}
 install -m 0644 fig2mpdf/fig2mpdf.1 %{buildroot}%{_mandir}/man1/
-gzip -9 %{buildroot}%{_mandir}/man1/fig2mpdf.1
 
 mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
 install -m 0644 [CLNR]* %{buildroot}%{_defaultdocdir}/%{name}
-%if 0%{?suse_version} > 1315
+install -m 0644 transfig/doc/manual.pdf 
%{buildroot}%{_defaultdocdir}/%{name}/transfig.pdf
+
 pushd fig2mpdf/doc
-    make
     mkdir %{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf
-    rm -f overlay-sample-?.pdf
-    rm -f *.aux *.log *.nav *.out *.snm *.toc
-    install -m 0644 * %{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf/
-popd
+    install -m 0644 *.{html,css,lfig} 
%{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf/
+    install -m 0644 htmlimg/*.{jpg,gif,pdf} 
%{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf/
+    install -m 0644 sample-presentation.tex Makefile 
%{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf/
+%if 0%{?suse_version} > 1315
+    install -m 0644 sample-presentation.pdf 
%{buildroot}%{_defaultdocdir}/%{name}/fig2mpdf/
 %endif
-pushd transfig/doc
-    ../../fig2dev/fig2dev -L latex trans.fig > trans.tex
-    pdflatex manual.tex
-    pdflatex manual.tex
-    pdflatex manual.tex
-    install -m 0644 manual.pdf 
%{buildroot}%{_defaultdocdir}/%{name}/transfig.pdf
 popd
 
 %fdupes %{buildroot}

++++++ 0001-Make-ModDate-and-CreationDate-in-PDF-reproducible.patch ++++++
>From e72a9d017742366cba636d783ea121279bfb7d6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]>
Date: Thu, 9 Mar 2023 19:19:51 +0100
Subject: [PATCH] Make ModDate and CreationDate in PDF reproducible

Ghostscript ignores the date in the preamble and uses the current
time instead. This notably breaks the SOURCE_DATE_EPOCH support
for reproducible builds.

Passing the creation time as DOCINFO pdfmark forces gs to use the
specified date/time. Although ghostscript still adds the unreproducible
DocumentUUID and trailer ID, it is sufficient when including the PDF
figure with pdflatex.

Reuse the SOURCE_DATE_EPOCH code from creation_date for determining
the wanted timestamp, and return the formatted time via the new
`creation_date_pdfmark` function.
---
 fig2dev/creationdate.c | 38 +++++++++++++++++++++++++++++++++-----
 fig2dev/creationdate.h |  1 +
 fig2dev/dev/genps.c    |  8 ++++++++
 3 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/fig2dev/creationdate.c b/fig2dev/creationdate.c
index a51bfd4..de914a5 100644
--- a/fig2dev/creationdate.c
+++ b/fig2dev/creationdate.c
@@ -36,8 +36,8 @@
 #include "creationdate.h"
 
 
-int
-creation_date(char *buf)
+static struct tm*
+parse_time()
 {
     time_t now;
 
@@ -70,15 +70,43 @@ creation_date(char *buf)
        } else {
            /* no errors, epoch is valid */
            now = epoch;
-           strftime(buf, CREATION_TIME_LEN, "%F %H:%M:%S", gmtime(&now));
-           return true;
+           return gmtime(&now);
        }
     }
 #endif
 
     /* fall trough on errors or !source_date_epoch */
     time(&now);
-    if (strftime(buf, CREATION_TIME_LEN, "%F %H:%M:%S", localtime(&now)))
+    return localtime(&now);
+}
+
+static struct tm*
+get_time()
+{
+    static struct tm time = { 0 };
+    static int initialized = 0;
+    if (!initialized) {
+      time = *parse_time();
+      initialized = 1;
+    }
+    return &time;
+}
+
+int
+creation_date(char *buf)
+{
+    if (strftime(buf, CREATION_TIME_LEN, "%F %H:%M:%S", get_time()))
+       return true;
+    else
+       return false;
+}
+
+int
+creation_date_pdfmark(char *buf)
+{
+    // Pdfmark format should be D:YYYYMMDDHHmmSSOHH’mm’.
+    // Timezone offset (O...) may be omitted
+    if (strftime(buf, CREATION_TIME_LEN, "D:%Y%m%d%H%M%S", get_time()))
        return true;
     else
        return false;
diff --git a/fig2dev/creationdate.h b/fig2dev/creationdate.h
index 048508a..199d985 100644
--- a/fig2dev/creationdate.h
+++ b/fig2dev/creationdate.h
@@ -21,3 +21,4 @@
 
 #define        CREATION_TIME_LEN       36
 extern int     creation_date(char *buf);
+extern int     creation_date_pdfmark(char *buf);
diff --git a/fig2dev/dev/genps.c b/fig2dev/dev/genps.c
index 5bea35c..48e05a6 100644
--- a/fig2dev/dev/genps.c
+++ b/fig2dev/dev/genps.c
@@ -1181,6 +1181,7 @@ genps_end(void)
        const int       h = pageheight, w = pagewidth;
        int             epslen, tiflen;
        struct stat     fstat;
+       char            date_buf[CREATION_TIME_LEN];
 
        /* for multipage, translate and output objects for each page */
        if (multi_page) {
@@ -1368,6 +1369,13 @@ genps_end(void)
        /* final DSC comment for eps output (EOF = end of document) */
        fputs("%EOF\n", tfp);
 
+       if (pdfflag) {
+               if (creation_date_pdfmark(date_buf))
+                       fprintf(tfp,
+                               "[ /ModDate (%s)\n /CreationDate (%s)\n 
/DOCINFO pdfmark\n",
+                               date_buf, date_buf);
+       }
+
        /* all ok */
        return 0;
 }
-- 
2.39.2

Reply via email to