From ebc847003a483c32f6007cc60dff4ab0141b0c3c Mon Sep 17 00:00:00 2001 From: xzl Date: Tue, 7 May 2024 16:42:58 +0800 Subject: [PATCH] feat: update libapache-poi-java to 4.0.1 Apache POI - Java API for Microsoft Documents Issue: https://github.com/linuxdeepin/developer-center/issues/3965 Log: update repo --- .gitignore | 1 - debian/ant.properties | 3 + debian/changelog | 62 ++++++++-- debian/control | 13 +- debian/copyright | 2 +- debian/libapache-poi-java.classpath | 10 +- debian/patches/13_rhino-script-engine.patch | 49 ++++++++ debian/patches/14_language-level.patch | 117 ++++++++++++++++++ .../patches/15_xmlbeans-compatibility.patch | 100 +++++++++++++++ debian/patches/16_bouncycastle-1.77.patch | 21 ++++ .../patches/17_commons-compress-upgrade.patch | 33 +++++ debian/patches/series | 5 + debian/rules | 3 +- debian/watch | 2 +- 14 files changed, 399 insertions(+), 22 deletions(-) delete mode 100644 .gitignore create mode 100644 debian/patches/13_rhino-script-engine.patch create mode 100644 debian/patches/14_language-level.patch create mode 100644 debian/patches/15_xmlbeans-compatibility.patch create mode 100644 debian/patches/16_bouncycastle-1.77.patch create mode 100644 debian/patches/17_commons-compress-upgrade.patch diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 224e7f0..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pc/ diff --git a/debian/ant.properties b/debian/ant.properties index eb1f2c3..e4eacf4 100644 --- a/debian/ant.properties +++ b/debian/ant.properties @@ -1,3 +1,6 @@ +jdk.version.source = 8 +jdk.version.target = 8 + disconnected=true dsig.bouncycastle-prov.jar=/usr/share/java/bcprov.jar dsig.bouncycastle-pkix.jar=/usr/share/java/bcpkix.jar diff --git a/debian/changelog b/debian/changelog index 7d4346c..13842f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,47 @@ +libapache-poi-java (4.0.1-6) unstable; urgency=medium + + * Team upload + + [ Vladimir Petko ] + * d/p/17_commons-compress-upgrade.patch: apply upstream patch to resolve ftbfs + (Closes: #1065455). + + -- Vladimir Petko Thu, 07 Mar 2024 15:21:27 +1300 + +libapache-poi-java (4.0.1-5) unstable; urgency=medium + + [ Pierre Gruet ] + * Team upload + * Providing classpaths of build jars in debian/libapache-poi-java.classpath + (Closes: #1012079) + * Raising Standards version to 4.6.1 (Rules-Requires-Root: no) + * Removing unneeded versioned dependencies in debian/control + * Replacing obsolete X-Comment field with Comment in d/copyright + * Trim trailing whitespace. + * Raising debian/watch format from 3 to 4. + * Adding missing dependencies to the binary package + * Apply multi-arch hints. + libapache-poi-java-doc: Add Multi-Arch: foreign. + + [ tony mancill ] + * Add patch for BouncyCastle 1.77 (Closes: #1057167) + * Use UTC for build timestamp (Closes: #1039741) + + -- tony mancill Wed, 13 Dec 2023 13:42:30 -0800 + +libapache-poi-java (4.0.1-4) unstable; urgency=medium + + * Compatibility with XMLBeans 4.0 + + -- Emmanuel Bourg Mon, 16 May 2022 23:21:14 +0200 + +libapache-poi-java (4.0.1-3) unstable; urgency=medium + + * Fixed the build failure with Java 17 (Closes: #981973) + * Tightened the dependency on libcommons-compress-java (Closes: #923540) + * Preserve the compatibility with Java 8 when building with recent JDKs + + -- Emmanuel Bourg Mon, 14 Feb 2022 17:00:55 +0100 + libapache-poi-java (4.0.1-2) unstable; urgency=medium * Team upload. @@ -73,7 +117,7 @@ libapache-poi-java (3.10.1-4) unstable; urgency=medium -- Emmanuel Bourg Tue, 24 Jul 2018 13:55:38 +0200 libapache-poi-java (3.10.1-3) unstable; urgency=medium - + * Team upload. [ Emmanuel Bourg ] @@ -146,7 +190,7 @@ libapache-poi-java (3.9-1) unstable; urgency=low * Updated the debian/README.* files [ tony mancill ] - * Update debian/copyright to DEP5 format; clarify license of + * Update debian/copyright to DEP5 format; clarify license of chunks_parse_cmds.tbl. (Closes: #659067) -- Emmanuel Bourg Tue, 09 Jul 2013 23:10:21 +0200 @@ -262,7 +306,7 @@ libjakarta-poi-java (3.0.1-1) unstable; urgency=low * New upstream release (closes: #436974) * add myself to Uploaders - * add watch file + * add watch file -- Rene Engelhard Wed, 05 Sep 2007 00:27:43 +0200 @@ -279,7 +323,7 @@ libjakarta-poi-java (2.5.1-3) unstable; urgency=low libjakarta-poi-java (2.5.1-2) unstable; urgency=low - * Upload to unstable + * Upload to unstable -- Wolfgang Baer Thu, 2 Feb 2006 15:37:06 +0100 @@ -288,13 +332,13 @@ libjakarta-poi-java (2.5.1-1) experimental; urgency=low * New upstream release * Move to main - build with kaffe * Apache 2.0 License, adjusted debian/copyright - * Move package to pkg-java-maintainers for comaintenance, + * Move package to pkg-java-maintainers for comaintenance, added Christian Bayle and myself as uploaders - * New build dependencies (some are also dependencies) + * New build dependencies (some are also dependencies) libcommons-logging-java, liblog4j1.2-java, ant-optional, junit, cdbs, libxalan2-java, libcommons-beanutils-java, libcommons-lang-java * Added compat file for debhelper 4 compatibility - * Updated README.Debian with information about different classpaths + * Updated README.Debian with information about different classpaths dependend on used jakarta-poi jar files (main, scratchpad, contrib) * Enabled and run unit tests * Register manual and api with doc-base @@ -311,13 +355,13 @@ libjakarta-poi-java (1.10.0-4) unstable; urgency=high libjakarta-poi-java (1.10.0-3) unstable; urgency=low * Missing comma in Build-Depends-Indep line of control file - (Closes: bug#254881) + (Closes: bug#254881) -- Christian Bayle Thu, 24 Jun 2004 22:33:36 +0200 libjakarta-poi-java (1.10.0-2) unstable; urgency=low - * Removed depends on doc package (Closes: #202399) + * Removed depends on doc package (Closes: #202399) -- Christian Bayle Tue, 22 Jul 2003 22:03:01 +0200 diff --git a/debian/control b/debian/control index cae7ad2..ccb15dc 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Build-Depends: default-jdk, javahelper, junit4, - libbcpkix-java (>= 1.54), + libbcpkix-java, libcommons-codec-java, libcommons-collections4-java, libcommons-compress-java, @@ -23,18 +23,21 @@ Build-Depends: libdom4j-java, libjaxb-java, liblog4j1.2-java, - libxmlbeans-java (>= 3.0.2), - libxml-security-java (>= 2.0), + librhino-java (>= 1.7.7.2-3~), + libxmlbeans-java (>= 4.0.0), + libxml-security-java, maven-repo-helper, xmltooling-schemas -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Vcs-Git: https://salsa.debian.org/java-team/libapache-poi-java.git Vcs-Browser: https://salsa.debian.org/java-team/libapache-poi-java Homepage: https://poi.apache.org +Rules-Requires-Root: no Package: libapache-poi-java Architecture: all Depends: + libbcpkix-java, libcommons-codec-java, libcommons-collections4-java, libcommons-compress-java, @@ -45,6 +48,7 @@ Depends: libjaxb-java, liblog4j1.2-java, libxmlbeans-java, + libxml-security-java, ${misc:Depends} Suggests: libapache-poi-java-doc, ant Conflicts: libjakarta-poi-java @@ -72,6 +76,7 @@ Suggests: libapache-poi-java Conflicts: libjakarta-poi-java-doc Replaces: libjakarta-poi-java-doc Provides: libjakarta-poi-java-doc +Multi-Arch: foreign Description: Apache POI - Java API for Microsoft Documents (Documentation) Apache POI provides a Java API for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document diff --git a/debian/copyright b/debian/copyright index 5d7a581..79a0b39 100644 --- a/debian/copyright +++ b/debian/copyright @@ -36,7 +36,7 @@ Copyright: 2003, Christian Bayle 2012, tony mancill 2013, Emmanuel Bourg License: Apache-2.0 -X-Comment: It is assumed that package maintainers have licensed their work +Comment: It is assumed that package maintainers have licensed their work under terms compatible with upstream licensing terms. License: Apache-2.0 diff --git a/debian/libapache-poi-java.classpath b/debian/libapache-poi-java.classpath index 9659c81..155f880 100644 --- a/debian/libapache-poi-java.classpath +++ b/debian/libapache-poi-java.classpath @@ -1,5 +1,5 @@ -/usr/share/java/poi.jar commons-logging.jar log4-1.2.jar -/usr/share/java/poi-ooxml.jar poi.jar poi-ooxml-schemas.jar dom4j.jar -/usr/share/java/poi-ooxml-schemas.jar xmlbeans.jar -/usr/share/java/poi-scratchpad.jar poi.jar -/usr/share/java/poi-excelant.jar poi.jar poi-ooxml.jar ant.jar +usr/share/java/poi.jar /usr/share/java/commons-codec.jar /usr/share/java/commons-collections4.jar /usr/share/java/commons-logging.jar /usr/share/java/commons-math3.jar +usr/share/java/poi-ooxml.jar /usr/share/java/bcpkix.jar /usr/share/java/commons-collections4.jar /usr/share/java/commons-compress.jar /usr/share/java/curvesapi.jar /usr/share/java/poi.jar /usr/share/java/poi-ooxml-schemas.jar /usr/share/java/xmlbeans.jar /usr/share/java/xmlsec.jar +usr/share/java/poi-ooxml-schemas.jar /usr/share/java/xmlbeans.jar +usr/share/java/poi-scratchpad.jar /usr/share/java/poi.jar /usr/share/java/poi-ooxml.jar +usr/share/java/poi-excelant.jar /usr/share/java/poi.jar /usr/share/java/poi-ooxml.jar /usr/share/java/ant.jar diff --git a/debian/patches/13_rhino-script-engine.patch b/debian/patches/13_rhino-script-engine.patch new file mode 100644 index 0000000..a8b0f4f --- /dev/null +++ b/debian/patches/13_rhino-script-engine.patch @@ -0,0 +1,49 @@ +Description: Run the script snippets in the Ant file with Rhino to fix the build failure with Java 17 +Author: Emmanuel Bourg +Forwarded: no +Bug-Debian: https://bugs.debian.org/981973 +--- a/build.xml ++++ b/build.xml +@@ -70,6 +70,7 @@ + + + + + +@@ -578,7 +579,7 @@ + + + +- ++ + var rel = ("REL_"+project.getProperty("version.id")).toUpperCase().replace(/\W/g,"_"); + project.setProperty("RELEASE_TAG", rel); + +@@ -2556,7 +2557,7 @@ + + + +- ++ + var relCurr = new String(project.getProperty("version.id")); + var relNext = relCurr.replace(/[0-9]+$/, function(lastNum){ return new String(new Number(lastNum)+1); }); + project.setProperty("rel_next", relNext); +@@ -2684,7 +2685,7 @@ + + + +- ++ + var relPrev = new String(project.getProperty("version.id")) + .replace(/([0-9]+)[^0-9]*$/, function(all,lastNum){ return new String(new Number(lastNum)-1); }); + project.setProperty("rel_prev", relPrev); +@@ -2760,6 +2761,7 @@ + + + + + diff --git a/debian/patches/14_language-level.patch b/debian/patches/14_language-level.patch new file mode 100644 index 0000000..e8ed1f5 --- /dev/null +++ b/debian/patches/14_language-level.patch @@ -0,0 +1,117 @@ +Description: Preserves Java 8 compatibility when building with recent JDKs +Author: Emmanuel Bourg +Forwarded: not-needed +--- a/build.xml ++++ b/build.xml +@@ -973,6 +973,7 @@ + + + + + + + + + + + + + + + diff --git a/debian/patches/15_xmlbeans-compatibility.patch b/debian/patches/15_xmlbeans-compatibility.patch new file mode 100644 index 0000000..3a172ed --- /dev/null +++ b/debian/patches/15_xmlbeans-compatibility.patch @@ -0,0 +1,100 @@ +From 345d17c36ee3f5433cd61061728e62ad44812ffe Mon Sep 17 00:00:00 2001 +From: Andreas Beeker +Date: Tue, 23 Jun 2020 22:16:03 +0000 +Subject: [PATCH] XmlBeans now generates the beans including the modifications + which were applied by the POI build (r1879130) ... so those modifications are + now obsolete + +git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879131 13f79535-47bb-0310-9956-ffa450edef68 + +From 9f91309b28fbeca6522d2f72633564762d94f87d Mon Sep 17 00:00:00 2001 +From: Andreas Beeker +Date: Tue, 1 Sep 2020 22:28:31 +0000 +Subject: [PATCH] Adapt to new XmlBeans changes of r1881383 + +git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1881384 13f79535-47bb-0310-9956-ffa450edef68 + +From 997b95a4f831c9cdc74073804ce5986981187c2a Mon Sep 17 00:00:00 2001 +From: Andreas Beeker +Date: Sat, 19 Sep 2020 02:40:10 +0000 +Subject: [PATCH] adapt to XmlBeans changes + +git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1881835 13f79535-47bb-0310-9956-ffa450edef68 + +--- a/build.xml ++++ b/build.xml +@@ -939,36 +939,6 @@ + + + +- +- typeLoader; +- +- private static synchronized org.apache.xmlbeans.SchemaTypeLoader getTypeLoader() { +- org.apache.xmlbeans.SchemaTypeLoader stl = (typeLoader == null) ? null : typeLoader.get(); +- if (stl == null) { +- stl = org.apache.xmlbeans.XmlBeans.typeLoaderForClassLoader(\2.class.getClassLoader()); +- typeLoader = new java.lang.ref.SoftReference(stl); +- } +- return stl; +- } +- +- public static \2 newInstance\(\) \{]]> +- +- +- +- +- +- +- org.apache.xmlbeans.XmlBeans.getContextTypeLoader +- getTypeLoader +- +- +- +- +- +- +- + Forking javac with max heap size ${ooxml.memory} + + +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057167 +Forwarded: no + +--- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java ++++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java +@@ -232,11 +232,11 @@ + ResponderID ocspResponderId = respId.toASN1Primitive(); + DERTaggedObject derTaggedObject = (DERTaggedObject)ocspResponderId.toASN1Primitive(); + if (2 == derTaggedObject.getTagNo()) { +- ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); ++ ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getBaseObject(); + byte key[] = keyHashOctetString.getOctets(); + responderId.setByKey(key); + } else { +- X500Name name = X500Name.getInstance(derTaggedObject.getObject()); ++ X500Name name = X500Name.getInstance(derTaggedObject.getBaseObject()); + String nameStr = name.toString(); + responderId.setByName(nameStr); + } diff --git a/debian/patches/17_commons-compress-upgrade.patch b/debian/patches/17_commons-compress-upgrade.patch new file mode 100644 index 0000000..0fd63c9 --- /dev/null +++ b/debian/patches/17_commons-compress-upgrade.patch @@ -0,0 +1,33 @@ +Description: fix compile issue due to commons-compress upgrade + commons-compress 1.25 has a different signature for + ZipArchiveOutputStream.putArchiveEntry(). This causes a build failure. +Author: PJ Fanning +Origin: upstream, https://github.com/apache/poi/commit/386b2fcc7898533ef047d9b52e86d370d2cc9ee2 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065455 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libapache-poi-java/+bug/2056384 +Forwarded: not-needed +Applied-Upstream: commit, 386b2fcc7898533ef047d9b52e86d370d2cc9ee2 +Last-Update: 2024-03-07 + +diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/marshallers/TestZipPackagePropertiesMarshaller.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/marshallers/TestZipPackagePropertiesMarshaller.java +index 30fabfc1..dc986b24 100644 +--- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/marshallers/TestZipPackagePropertiesMarshaller.java ++++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/marshallers/TestZipPackagePropertiesMarshaller.java +@@ -24,7 +24,7 @@ import java.io.ByteArrayOutputStream; + import java.io.IOException; + import java.io.OutputStream; + +-import org.apache.commons.compress.archivers.ArchiveEntry; ++import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; + import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; + import org.apache.poi.openxml4j.exceptions.OpenXML4JException; + import org.apache.poi.openxml4j.opc.PackagingURIHelper; +@@ -58,7 +58,7 @@ public class TestZipPackagePropertiesMarshaller { + marshaller.marshall(new PackagePropertiesPart(null, PackagingURIHelper.createPartName(PACKAGE_RELATIONSHIPS_ROOT_URI)), + new ZipArchiveOutputStream(new ByteArrayOutputStream()) { + @Override +- public void putArchiveEntry(final ArchiveEntry archiveEntry) throws IOException { ++ public void putArchiveEntry(final ZipArchiveEntry archiveEntry) throws IOException { + throw new IOException("TestException"); + } + }); diff --git a/debian/patches/series b/debian/patches/series index e2b6790..605fd9a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,8 @@ bug-62996.patch #ignore-test-errors.patch +13_rhino-script-engine.patch +14_language-level.patch +15_xmlbeans-compatibility.patch +16_bouncycastle-1.77.patch +17_commons-compress-upgrade.patch diff --git a/debian/rules b/debian/rules index c94adb7..2e54850 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,8 @@ VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed 's/+dfsg//') dh $@ --with maven-repo-helper --with javahelper override_dh_auto_build: - dh_auto_build -- -Dversion.id=$(VERSION) -DDSTAMP=$(shell date '--date=@$(SOURCE_DATE_EPOCH)' +%Y%m%d) jar maven-poms javadocs + dh_auto_build -- -Dversion.id=$(VERSION) -DDSTAMP=$(shell date --utc --date=@$(SOURCE_DATE_EPOCH) +%Y%m%d) jar maven-poms javadocs + override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) diff --git a/debian/watch b/debian/watch index 01e4568..228bce0 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,2 @@ -version=3 +version=4 https://archive.apache.org/dist/poi/release/src/poi-src-([\d\.]*)-(?:.*).*.tar.gz debian debian/orig-tar.sh