Source: jhove Severity: wishlist Tags: patch Hi Tony,
following up on the patches submitted in Bug#1035852, there is one more issue I would like to address. Currently, jhove-ext-modules are excluded from the binary package due to missing build dependencies. As it turns out, the issue could be resolved by adding just one package to the Debian archives. Therefore, I have prepared two more patches for your consideration: 1. Another patch to be applied on top of the patch series submitted in Bug#1035852 in order to include jhove-ext-modules in the build process. 2. An "initial commit" patch as a suggestion for the new package libjwat-java which would be required for jhove-ext-modules to build successfully. After committing it to an empty git repo, you should be able to pull in upstream code via uscan and friends. Do these additions stand a chance of being included in the distribution? Cheers, Elias
>From be68a4d3ebf2b93e77c3439a57f21a066bc8f45d Mon Sep 17 00:00:00 2001 From: Elias Oltmanns <oltma...@zib.de> Date: Wed, 31 May 2023 16:14:05 +0200 Subject: [PATCH] Include jhove-ext-modules in the package --- debian/README.source | 6 ++++-- debian/control | 3 ++- debian/install | 2 +- debian/jhove.poms | 2 +- debian/maven.ignoreRules | 1 - debian/patches/binaries | 12 +++++++----- debian/patches/gui | 12 +++++++----- debian/patches/jwat-upgrade.patch | 30 ++++++++++++++++++++++++++++++ debian/patches/series | 1 + 9 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 debian/patches/jwat-upgrade.patch diff --git a/debian/README.source b/debian/README.source index c12bdd6..1e15874 100644 --- a/debian/README.source +++ b/debian/README.source @@ -11,8 +11,10 @@ the Debian policy. Due to DFSG issues, upstream source has been repackaged without various JAR files as well as two ICC profiles. This does not impose any restrictions on building and using the application including its -internal modules. The test suite and code from the jhove-ext-modules -directory cannot be built, however, because some dependencies have not +modules. The test suite +cannot be built, however, because some dependencies have not been packaged for Debian yet. Note that the deleted ICC profiles (used as resources in the test suite) are shipped with Debian in the non-free icc-profiles package. + + -- Elias Oltmanns <oltma...@zib.de>, Thu, 1 Jun 2023 11:23:07 +0200 diff --git a/debian/control b/debian/control index 5ec6143..b82faac 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,8 @@ Build-Depends: Build-Depends-Indep: libjaxb-api-java (>= 2.3.1), libjaxb-java, - libjsonp-java + libjsonp-java, + libjwat-java Standards-Version: 4.6.2 Vcs-Git: https://salsa.debian.org/java-team/jhove.git Vcs-Browser: https://salsa.debian.org/java-team/jhove diff --git a/debian/install b/debian/install index f8fb8e3..db3e98c 100644 --- a/debian/install +++ b/debian/install @@ -1,3 +1,3 @@ jhove-installer/src/main/scripts/jhove /usr/bin jhove-installer/src/main/scripts/jhove-gui /usr/bin -jhove-installer/src/main/config/jhove.conf /etc/jhove \ No newline at end of file +jhove-installer/src/main/config/ext-modules/jhove.conf /etc/jhove diff --git a/debian/jhove.poms b/debian/jhove.poms index 0ff0de7..67589af 100644 --- a/debian/jhove.poms +++ b/debian/jhove.poms @@ -39,6 +39,6 @@ jhove-modules/tiff-hul/pom.xml jhove-modules/utf8-hul/pom.xml jhove-modules/wave-hul/pom.xml jhove-modules/xml-hul/pom.xml -jhove-ext-modules/pom.xml --ignore +jhove-ext-modules/pom.xml --has-package-version jhove-apps/pom.xml --has-package-version jhove-installer/pom.xml --ignore diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules index d40c231..ced8431 100644 --- a/debian/maven.ignoreRules +++ b/debian/maven.ignoreRules @@ -1,5 +1,4 @@ -org.openpreservation.jhove jhove-ext-modules jar * * * org.openpreservation.jhove jhove-installer jar * * * junit junit * * * * nl.jqno.equalsverifier equalsverifier * * * * diff --git a/debian/patches/binaries b/debian/patches/binaries index b7ef5ee..7f6752b 100644 --- a/debian/patches/binaries +++ b/debian/patches/binaries @@ -3,18 +3,20 @@ Date: Mon, 24 Apr 2023 18:18:12 +0200 Subject: binaries --- - jhove-installer/src/main/scripts/jhove | 6 ++++++ - 1 file changed, 6 insertions(+) + jhove-installer/src/main/scripts/jhove | 8 ++++++++ + 1 file changed, 8 insertions(+) diff --git a/jhove-installer/src/main/scripts/jhove b/jhove-installer/src/main/scripts/jhove -index 3ef25fc..1859a8c 100644 +index 3ef25fc..b398f5c 100644 --- a/jhove-installer/src/main/scripts/jhove +++ b/jhove-installer/src/main/scripts/jhove -@@ -1,4 +1,10 @@ +@@ -1,4 +1,12 @@ #!/bin/sh +set -e + -+CP=$(find /usr/share/maven-repo/org/openpreservation/jhove/ -name \*-debian.jar | paste -sd:) ++JHOVE_JARS=$(find /usr/share/maven-repo/org/openpreservation/jhove/ -name \*-debian.jar | paste -sd:) ++JWAT_JARS=$(ls /usr/share/java/jwat-*[a-z].jar | paste -sd:) ++CP=$JHOVE_JARS:$JWAT_JARS:/usr/share/java/epubcheck.jar +java -cp "$CP" edu.harvard.hul.ois.jhove.Jhove -c /etc/jhove/jhove.conf "${@}" + +exit $? diff --git a/debian/patches/gui b/debian/patches/gui index b79a239..3fb9370 100644 --- a/debian/patches/gui +++ b/debian/patches/gui @@ -3,18 +3,20 @@ Date: Mon, 24 Apr 2023 18:18:12 +0200 Subject: gui --- - jhove-installer/src/main/scripts/jhove-gui | 6 ++++++ - 1 file changed, 6 insertions(+) + jhove-installer/src/main/scripts/jhove-gui | 8 ++++++++ + 1 file changed, 8 insertions(+) diff --git a/jhove-installer/src/main/scripts/jhove-gui b/jhove-installer/src/main/scripts/jhove-gui -index 46cff3e..4de24ce 100644 +index 46cff3e..4605a88 100644 --- a/jhove-installer/src/main/scripts/jhove-gui +++ b/jhove-installer/src/main/scripts/jhove-gui -@@ -1,4 +1,10 @@ +@@ -1,4 +1,12 @@ #!/bin/sh +set -e + -+CP=$(find /usr/share/maven-repo/org/openpreservation/jhove/ -name \*-debian.jar | paste -sd:) ++JHOVE_JARS=$(find /usr/share/maven-repo/org/openpreservation/jhove/ -name \*-debian.jar | paste -sd:) ++JWAT_JARS=$(ls /usr/share/java/jwat-*[a-z].jar | paste -sd:) ++CP=$JHOVE_JARS:$JWAT_JARS:/usr/share/java/epubcheck.jar +java -cp "$CP" edu.harvard.hul.ois.jhove.viewer.JhoveView -c /etc/jhove/jhove.conf "${@}" + +exit $? diff --git a/debian/patches/jwat-upgrade.patch b/debian/patches/jwat-upgrade.patch new file mode 100644 index 0000000..1a8e5a4 --- /dev/null +++ b/debian/patches/jwat-upgrade.patch @@ -0,0 +1,30 @@ +Description: Fix build against jwat 1.2.1 + Adapt to slightly modified interface of jwat 1.2.1. +Author: Elias Oltmanns <oltma...@zib.de> +Bug: https://github.com/openpreserve/jhove/pull/862 + +--- +Last-Update: 2023-05-30 + +--- jhove-1.28.0+dfsg1.orig/jhove-ext-modules/src/main/java/edu/harvard/hul/ois/jhove/module/GzipModule.java ++++ jhove-1.28.0+dfsg1/jhove-ext-modules/src/main/java/edu/harvard/hul/ois/jhove/module/GzipModule.java +@@ -241,7 +241,7 @@ public class GzipModule extends ModuleBa + */ + private void reportResults(GzipReader reader, RepInfo repInfo) { + JwatJhoveIdMinter minter = JwatJhoveIdMinter.getInstance(NAME); +- Diagnostics<Diagnosis> diagnostics = reader.diagnostics; ++ Diagnostics diagnostics = reader.diagnostics; + if (diagnostics.hasErrors()) { + for (Diagnosis d : diagnostics.getErrors()) { + repInfo.setMessage(new ErrorMessage(minter.mint(d))); +--- jhove-1.28.0+dfsg1.orig/jhove-ext-modules/src/main/java/edu/harvard/hul/ois/jhove/module/WarcModule.java ++++ jhove-1.28.0+dfsg1/jhove-ext-modules/src/main/java/edu/harvard/hul/ois/jhove/module/WarcModule.java +@@ -330,7 +330,7 @@ public class WarcModule extends ModuleBa + */ + private void reportResults(WarcReader reader, RepInfo repInfo) { + JwatJhoveIdMinter minter = JwatJhoveIdMinter.getInstance(NAME); +- Diagnostics<Diagnosis> diagnostics = reader.diagnostics; ++ Diagnostics diagnostics = reader.diagnostics; + if (diagnostics.hasErrors()) { + for (Diagnosis d : diagnostics.getErrors()) { + repInfo.setMessage(new ErrorMessage(minter.mint(d))); diff --git a/debian/patches/series b/debian/patches/series index d17f173..9529fc6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ binaries gui ftbfs.patch +jwat-upgrade.patch -- 2.25.1
>From 76e2394b82237561937945e317c8ccb821a67b0e Mon Sep 17 00:00:00 2001 From: Elias Oltmanns <oltma...@zib.de> Date: Mon, 5 Jun 2023 19:55:01 +0200 Subject: [PATCH] Initial commit --- debian/README.source | 9 +++++++++ debian/changelog | 6 ++++++ debian/control | 27 +++++++++++++++++++++++++++ debian/copyright | 29 +++++++++++++++++++++++++++++ debian/libjwat-java.poms | 35 +++++++++++++++++++++++++++++++++++ debian/maven.ignoreRules | 21 +++++++++++++++++++++ debian/maven.properties | 6 ++++++ debian/maven.rules | 9 +++++++++ debian/rules | 4 ++++ debian/source/format | 1 + debian/watch | 2 ++ 11 files changed, 149 insertions(+) create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libjwat-java.poms create mode 100644 debian/maven.ignoreRules create mode 100644 debian/maven.properties create mode 100644 debian/maven.rules create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..130fc0b --- /dev/null +++ b/debian/README.source @@ -0,0 +1,9 @@ +Information about libjwat-java +------------------------------ + +This package was debianized using the mh_make command +from the maven-debian-helper package. + +The build system uses Maven but prevents it from downloading +anything from the Internet, making the build compliant with +the Debian policy. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..048b415 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +libjwat-java (1.2.1-1) UNRELEASED; urgency=low + + * Initial release (Closes: #nnnn) <nnnn is the bug number of your + ITP> + + -- Elias Oltmanns <oltma...@zib.de> Mon, 05 Jun 2023 17:38:21 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3e4a17a --- /dev/null +++ b/debian/control @@ -0,0 +1,27 @@ +Source: libjwat-java +Section: java +Priority: optional +Maintainer: Debian Java Maintainers <pkg-java-maintain...@lists.alioth.debian.org> +Build-Depends: + debhelper-compat (= 12), + default-jdk, + maven-debian-helper (>= 2.1) +Build-Depends-Indep: + libbcprov-java (>= 1.65), + libdoxia-java (>= 1.7) +Standards-Version: 4.6.2 +Vcs-Git: https://salsa.debian.org/java-team/libjwat-java.git +Vcs-Browser: https://salsa.debian.org/java-team/libjwat-java +Homepage: https://sbforge.org/display/JWAT/JWAT +Rules-Requires-Root: no + +Package: libjwat-java +Architecture: all +Depends: ${misc:Depends}, ${maven:Depends} +Suggests: ${maven:OptionalDepends} +Multi-Arch: foreign +Description: Java Web Archive Toolkit + A collection of libraries to use for reading, writing and validating ARC, + WARC and GZip files. Also includes various helper classes to help with + different types of input streams. Finally there are also classes to help + with HTTP, character encoding and other Internet related protocols. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a9d6804 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Java Web Archive Toolkit +Upstream-Contact: https://sbforge.org/display/JWAT/JWAT +Source: https://github.com/netarchivesuite/jwat + +Files: * +Copyright: + 2011-2023, Det Kongelige Bibliotek/Royal Danish Library (https://www.kb.dk/) +License: Apache-2.0 + +Files: debian/* +Copyright: 2023, Elias Oltmanns <oltma...@zib.de> +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the full text of the Apache-2.0 license + can be found in the file '/usr/share/common-licenses/Apache-2.0' diff --git a/debian/libjwat-java.poms b/debian/libjwat-java.poms new file mode 100644 index 0000000..671e512 --- /dev/null +++ b/debian/libjwat-java.poms @@ -0,0 +1,35 @@ +# List of POM files for the package +# Format of this file is: +# <path to pom file> [option]* +# where option can be: +# --ignore: ignore this POM and its artifact if any +# --ignore-pom: don't install the POM. To use on POM files that are created +# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms] +# --no-parent: remove the <parent> tag from the POM +# --package=<package>: an alternative package to use when installing this POM +# and its artifact +# --has-package-version: to indicate that the original version of the POM is the same as the upstream part +# of the version for the package. +# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM +# during a clean operation with mh_cleanpom or mh_installpom +# --artifact=<path>: path to the build artifact associated with this POM, +# it will be installed when using the command mh_install. [mh_install] +# --java-lib: install the jar into /usr/share/java to comply with Debian +# packaging guidelines +# --usj-name=<name>: name to use when installing the library in /usr/share/java +# --usj-version=<version>: version to use when installing the library in /usr/share/java +# --no-usj-versionless: don't install the versionless link in /usr/share/java +# --dest-jar=<path>: the destination for the real jar. +# It will be installed with mh_install. [mh_install] +# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default. +# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed. +# Empty by default. [mh_install] +# +pom.xml --has-package-version +jwat-common/pom.xml --has-package-version +jwat-archive-common/pom.xml --has-package-version +jwat-gzip/pom.xml --has-package-version +jwat-arc/pom.xml --has-package-version +jwat-warc/pom.xml --has-package-version +jwat-archive/pom.xml --has-package-version +jwat-distribution/pom.xml --ignore diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules new file mode 100644 index 0000000..988eb89 --- /dev/null +++ b/debian/maven.ignoreRules @@ -0,0 +1,21 @@ + +org.jwat jwat-distribution jar * * * +com.github.spotbugs spotbugs-maven-plugin * * * * +junit junit * * * * +net.sourceforge.pmd pmd-xml * * * * +org.apache.maven.plugins maven-changelog-plugin * * * * +org.apache.maven.plugins maven-checkstyle-plugin * * * * +org.apache.maven.plugins maven-javadoc-plugin * * * * +org.apache.maven.plugins maven-jxr-plugin * * * * +org.apache.maven.plugins maven-pmd-plugin * * * * +org.apache.maven.plugins maven-project-info-reports-plugin * * * * +org.apache.maven.plugins maven-release-plugin * * * * +org.bouncycastle bcprov-jdk15 * * * * +org.codehaus.mojo license-maven-plugin * * * * +org.codehaus.mojo taglist-maven-plugin * * * * +org.codehaus.mojo versions-maven-plugin * * * * +org.hamcrest hamcrest-all * * * * +org.jacoco jacoco-maven-plugin * * * * +org.mockito mockito-all * * * * +org.powermock powermock-api-mockito * * * * +org.powermock powermock-module-junit4 * * * * diff --git a/debian/maven.properties b/debian/maven.properties new file mode 100644 index 0000000..9bc693b --- /dev/null +++ b/debian/maven.properties @@ -0,0 +1,6 @@ +# Include here properties to pass to Maven during the build. +# For example: +# maven.test.skip=true +# project.build.sourceEncoding=UTF-8 + +maven.test.skip=true diff --git a/debian/maven.rules b/debian/maven.rules new file mode 100644 index 0000000..7712e1a --- /dev/null +++ b/debian/maven.rules @@ -0,0 +1,9 @@ + +org.jwat jwat-arc jar s/.*/debian/ * * +org.jwat jwat-archive-common jar s/.*/debian/ * * +org.jwat jwat-archive jar s/.*/debian/ * * +org.jwat jwat-common jar s/.*/debian/ * * +org.jwat jwat-gzip jar s/.*/debian/ * * +org.jwat jwat-warc jar s/.*/debian/ * * +org.jwat jwat pom s/.*/debian/ * * +org.bouncycastle s/bc(.*)-jdk\d+.*/bc$1/ * s/.*/debian/ * * diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..9080e72 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://github.com/netarchivesuite/jwat/tags .*/jwat-([\d\.]+)\.tar\.gz -- 2.25.1