diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..b334026 --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,34 @@ +https://github.com/apache/xmlgraphics-fop/pull/65 +partial fix for +https://issues.apache.org/jira/browse/FOP-2854 +https://github.com/openSUSE/daps/issues/482 + +commit 0d3f0f9a473aad6f315fd60cc6ed1447afb791ef +Author: Bernhard M. Wiedemann +Date: Wed Dec 23 13:53:56 2020 +0100 + + FOP-2854: Allow to override CreationDate + + Allow to override build date with SOURCE_DATE_EPOCH + in order to make builds reproducible. + See https://reproducible-builds.org/ for why this is good + and https://reproducible-builds.org/specs/source-date-epoch/ + for the definition of this variable. + + This patch was done while working on reproducible builds for openSUSE. + +diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java +index 3af9af606..ff708e371 100644 +--- a/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java ++++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java +@@ -134,7 +134,9 @@ public class PDFMetadata extends PDFStream { + + //Set creation date if not available, yet + if (info.getCreationDate() == null) { +- Date d = new Date(); ++ Date d = System.getenv("SOURCE_DATE_EPOCH") == null ? ++ new Date() : ++ new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))); + info.setCreationDate(d); + } + diff --git a/xmlgraphics-fop.changes b/xmlgraphics-fop.changes index 76f0edd..84280cd 100644 --- a/xmlgraphics-fop.changes +++ b/xmlgraphics-fop.changes @@ -5,6 +5,11 @@ Sun Jan 24 18:01:22 UTC 2021 - Fridrich Strba * Support OTF/TTF SVG fonts * Allow overpaint of PDF border +------------------------------------------------------------------- +Sat Jan 23 18:39:32 UTC 2021 - Bernhard Wiedemann + +- Add reproducible.patch to override build date (boo#1047218) + ------------------------------------------------------------------- Thu Jun 4 05:13:44 UTC 2020 - Fridrich Strba diff --git a/xmlgraphics-fop.spec b/xmlgraphics-fop.spec index f51ad72..a78332f 100644 --- a/xmlgraphics-fop.spec +++ b/xmlgraphics-fop.spec @@ -42,6 +42,7 @@ Patch4: java8-compatibility.patch # PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- boo#1110024 Patch5: reproducible-build-manifest.patch Patch6: fop-2.5-QDox-2.0.patch +Patch7: reproducible.patch BuildRequires: ant >= 1.8.4 BuildRequires: apache-pdfbox >= 2.0 BuildRequires: commons-io >= 2.4 @@ -93,6 +94,7 @@ find -name "*.jar" | xargs -t rm %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # Replace keyword "VERSION" in XML files with the real one: for x in %{SOURCE10} %{SOURCE11} %{SOURCE12}; do