[med-svn] [Git][med-team/libsis-jhdf5-java][master] 11 commits: Adding final qualifier to some arguments of functions

Pierre Gruet gitlab at salsa.debian.org
Tue May 12 22:00:01 BST 2020



Pierre Gruet pushed to branch master at Debian Med / libsis-jhdf5-java


Commits:
10723447 by Pierre Gruet at 2020-05-12T21:49:23+02:00
Adding final qualifier to some arguments of functions

- - - - -
3ffb128b by Pierre Gruet at 2020-05-12T21:50:58+02:00
Providing hardening while compiling the jni part

- - - - -
1b85335a by Pierre Gruet at 2020-05-12T21:52:18+02:00
Changing syntax in override_dh_auto_clean

- - - - -
54310d4c by Pierre Gruet at 2020-05-12T21:57:53+02:00
Providing the executable h5ar

Creating a new binary package with the executable and the jar that it wraps
Compiling this jar
Modifying the wrapper to incorporate Debian paths

- - - - -
1855adf0 by Pierre Gruet at 2020-05-12T22:00:12+02:00
Providing a manpage for h5ar

- - - - -
a490429d by Pierre Gruet at 2020-05-12T22:04:22+02:00
Overriding jh_depends

The jni does not need jh_depends.
Moreover, having only the default call would lead to useless dependencies for
 libsis-jhdf5-java.

- - - - -
76476c05 by Pierre Gruet at 2020-05-12T22:07:10+02:00
Adding a test for h5ar to the testsuite

- - - - -
0b3be58d by Pierre Gruet at 2020-05-12T22:07:49+02:00
Updating debian/copyright

- - - - -
3a87c745 by Pierre Gruet at 2020-05-12T22:11:52+02:00
Updating debian/rules to correctly build h5ar

override_dh_auto_clean has to treat more files
the building line for the jar of h5ar is now working

- - - - -
34707754 by Pierre Gruet at 2020-05-12T22:29:24+02:00
Providing tests of the testsuite as examples

- - - - -
d642cc72 by Pierre Gruet at 2020-05-12T22:45:19+02:00
Updating changelog

- - - - -


18 changed files:

- + debian/README.test
- debian/changelog
- debian/control
- debian/copyright
- + debian/h5ar.1
- + debian/h5ar.examples
- debian/libsis-jhdf5-java.install → debian/h5ar.install
- + debian/h5ar.jlibs
- + debian/h5ar.manpages
- + debian/libsis-jhdf5-java.examples
- + debian/patches/adapting_h5ar_script_to_debian.patch
- + debian/patches/declaring_final_variables.patch
- debian/patches/series
- debian/rules
- debian/tests/control
- + debian/tests/run-unit-test-h5ar
- + debian/tests/run-unit-test-libsis-jhdf5-java
- + debian/tests/testWrappingExecutable


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,9 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test-PACKAGE
+
+where PACKAGE is the name of the current package,
+in order to confirm its integrity.


=====================================
debian/changelog
=====================================
@@ -1,8 +1,13 @@
 libsis-jhdf5-java (19.04.0+dfsg-2) UNRELEASED; urgency=medium
 
   * Changing the name of the .so file in libsis-jhdf5-jni (Closes: #959955)
+  * Providing the executable h5ar and a manpage
+  * Adding a test for h5ar to the testsuite
+  * Adding final qualifier to some arguments of functions
+  * Providing hardening while compiling the jni part
+  * Providing tests of the testsuite as examples
 
- -- Pierre Gruet <pgtdebian at free.fr>  Thu, 07 May 2020 21:46:07 +0200
+ -- Pierre Gruet <pgtdebian at free.fr>  Tue, 12 May 2020 22:37:32 +0200
 
 libsis-jhdf5-java (19.04.0+dfsg-1) unstable; urgency=medium
 


=====================================
debian/control
=====================================
@@ -28,6 +28,22 @@ Vcs-Browser: https://salsa.debian.org/med-team/libsis-jhdf5-java
 Vcs-Git: https://salsa.debian.org/med-team/libsis-jhdf5-java.git
 Homepage: https://sissource.ethz.ch/sispub/jhdf5
 
+Package: h5ar
+Architecture: all
+Depends: ${misc:Depends},
+         ${java:Depends},
+         libsis-jhdf5-jni (>= ${binary:Version}),
+         libsis-jhdf5-jni (<< ${source:Version}.1~),
+         libargs4j-java,
+         jarwrapper
+Description: easy-to-use HDF archiver using Java
+ h5ar provides an archiver using a Java binding to the HDF Group library for
+ HDF5 focusing on ease-of-use, which was developed by CISD and is now
+ maintained by ETH SIS.
+ The executable uses HDF5 1.8 from the HDF Group and files created with
+ h5ar are fully compatible with HDF5 1.6/1.8 (as you choose).
+
+
 Package: libsis-jhdf5-java
 Architecture: all
 Depends: ${misc:Depends},


=====================================
debian/copyright
=====================================
@@ -82,7 +82,8 @@ License: Apache
 Files: debian/*
 Copyright: 2015 Tim Booth <tbooth at ceh.ac.uk>
            2015 Olivier Sallou <osallou at debian.org>
-           2016-2018 Andreas Tille <tille at debian.org>
+           2016-2020 Andreas Tille <tille at debian.org>
+           2020 Pierre Gruet <pgtdebian at free.fr>
 License: GPL-3
  On Debian systems, the full text of the GNU General Public
  License version 3 can be found in the file


=====================================
debian/h5ar.1
=====================================
@@ -0,0 +1,133 @@
+.TH HDF5 "1" "May 2020" "HDF5 archiver version 19.04.0" "User Commands"
+.SH NAME
+h5ar \- HDF5 archiver
+.SH SYNOPSIS
+.B h5ar
+[ARCHIVE [option [...]] <archive_file> <item\-to\-archive> [...]
+| CAT [option [...]] <archive_file> <item\-to\-cat> [...]
+| EXTRACT [option [...]] <archive_file> [<item\-to\-unarchive> [...]]
+| DELETE [option [...]] <archive_file> <item\-to\-delete> [...]
+| LIST [option [...]] <archive_file> [<item\-to\-list> [...]]
+| VERIFY [option [...]] <archive_file> [<item\-to\-verify> [...]]]
+.SH DESCRIPTION
+h5ar is a HDF5 archiver, which can create an HDF5 archive, extract it and manipulate it in various ways. It does to by calling an executable jar file.
+
+.SH OPTIONS
+.TP
+\fB\-B\fR, \fB\-\-build\fR
+prints out the build and environment information
+.TP
+\fB\-C\fR, \fB\-\-compress\-all\fR
+compresses all files
+.TP
+\fB\-D\fR, \fB\-\-suppress\-directories\fR
+suppresses output for directories itself for LIST
+and VERIFY (default: false)
+.TP
+\fB\-E\fR, \fB\-\-exclude\-dirs\fR REGEX
+excludes directories according to provided regex
+.TP
+\fB\-F\fR, \fB\-\-file\-format\fR N
+specifies the file format version when creating
+an archive (N=1 \-> HDF51.8 (default), N=2 \->
+HDF51.10), N=99 \-> LATEST (default: 1)
+.TP
+\fB\-H\fR, \fB\-\-help\fR
+shows this help text
+.TP
+\fB\-I\fR, \fB\-\-include\-dirs\fR REGEX
+includes directories according to provided regex
+.TP
+\fB\-N\fR, \fB\-\-no\-sync\fR
+does not sync to disk before program exits (write
+mode only) (default: false)
+.TP
+\fB\-R\fR, \fB\-\-recursive\fR
+recursive LIST and VERIFY (default: false)
+.TP
+\fB\-S\fR, \fB\-\-stop\-on\-error\fR
+stops on first error and gives detailed error
+report (default: false)
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+prints out the version information
+.TP
+\fB\-a\fR, \fB\-\-verify\-attributes\fR
+considers file attributes for VERIFY (default:
+false)
+.TP
+\fB\-c\fR, \fB\-\-compress\fR REGEX
+compresses files according to provided regex
+.TP
+\fB\-e\fR, \fB\-\-exclude\fR REGEX
+excludes files according to provided regex
+.TP
+\fB\-i\fR, \fB\-\-include\fR REGEX
+includes files according to provided regex
+.TP
+\fB\-m\fR, \fB\-\-check\-missing\-files\fR
+checks for files present on the filesystem but
+missing from the archive for VERIFY (default:
+false)
+.TP
+\fB\-n\fR, \fB\-\-numeric\fR
+uses numeric values for mode, uid and gid for
+LIST and VERIFY (default: false)
+.HP
+\fB\-nc\fR, \fB\-\-no\-compression\fR REGEX
+does not compress files satisfying provided regex
+.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+quiet operation (only error output) (default:
+false)
+.TP
+\fB\-r\fR, \fB\-\-root\-dir\fR DIR
+root directory for archiving / extracting /
+verifying
+.TP
+\fB\-t\fR, \fB\-\-test\-checksums\fR
+tests CRC32 checksums of files in archive for
+LIST (default: false)
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+verbose output (all operations) (default: false)
+.SS "Modes (command capitalization ignored):"
+.IP
+ARCHIVE (AR, A): add files on the file system to an archive (always recursive)
+.br
+CAT (C): extract files from an archive to stdout
+.br
+EXTRACT (EX, E): extract files from an archive to the file system (always recursive)
+.br
+DELETE (REMOVE, RM, D): delete files from an archive
+.br
+LIST (LS, S): list files in an archive
+.br
+VERIFY (VF, V): verify the existence and integrity of files on the file system vs. the contents of an archive
+.SH EXAMPLES
+.IP
+h5ar ar /tmp/home \-r ~/ .
+.IP
+\- will create home.h5ar in /tmp containing all files of the user's home directory (note: ARCHIVE is always recursive).
+.IP
+h5ar ls \-v \-R \-t \-S /tmp/home
+.IP
+\- will list the full content of archive /tmp/home.h5ar recursively, with full detail and verify the checksums; stop if there is a checksum mismatch.
+.IP
+h5ar vf \-r ~/ \-v \-R \-m /tmp/home foo bar
+.IP
+\- will verify the contents of directories foo/ and bar/ in archive /tmp/home.h5ar recursively against the user's home directory, detecting any missing files.
+.SH "SEE ALSO"
+The full documentation for
+.B HDF5
+is maintained as a Texinfo manual.  If the
+.B info
+and
+.B HDF5
+programs are properly installed at your site, the command
+.IP
+.B info HDF5
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+This manual page was created by Pierre Gruet <pgtdebian at free.fr> for the Debian GNU/Linux distribution, because the original package does not have one.


=====================================
debian/h5ar.examples
=====================================
@@ -0,0 +1,3 @@
+debian/README.test
+debian/tests/run-unit-test-h5ar
+debian/tests/testWrappingExecutable


=====================================
debian/libsis-jhdf5-java.install → debian/h5ar.install
=====================================


=====================================
debian/h5ar.jlibs
=====================================
@@ -0,0 +1 @@
+sis-jhdf5-h5ar-cli.jar


=====================================
debian/h5ar.manpages
=====================================
@@ -0,0 +1 @@
+debian/h5ar.1


=====================================
debian/libsis-jhdf5-java.examples
=====================================
@@ -0,0 +1,3 @@
+debian/README.test
+debian/tests/run-unit-test-libsis-jhdf5-java
+debian/tests/readWriteTest


=====================================
debian/patches/adapting_h5ar_script_to_debian.patch
=====================================
@@ -0,0 +1,31 @@
+Description: Adapting bindings to the location of files on a Debian system
+Author: Pierre Gruet <pgtdebian at free.fr>
+Last-Update: 2020-05-12
+
+--- a/dist/bin/h5ar
++++ b/dist/bin/h5ar
+@@ -1,23 +1,3 @@
+ #! /bin/bash
+ 
+-# This script requires the readlink binary. If your system lacks this binary, $JHDFDIR needs to be hard-coded
+-
+-SCRIPT="$0"
+-if [ "${SCRIPT}" = "${SCRIPT#/}" ]; then
+-  SCRIPT="`pwd`/${SCRIPT#./}"
+-fi
+-BINDIR="${SCRIPT%/*}"
+-LINK="`readlink $0`"
+-while [ -n "${LINK}" ]; do
+-  if [ "${LINK#/}" = "${LINK}" ]; then
+-    SCRIPT="${BINDIR}/${LINK}"
+-  else
+-    SCRIPT="${LINK}"
+-  fi
+-  BINDIR="${SCRIPT%/*}"
+-  LINK="`readlink ${SCRIPT}`"
+-done
+-BINDIR="${SCRIPT%/*}"
+-JHDFDIR="${BINDIR%/*}"
+-VERSION=`cat "${JHDFDIR}/version.txt"`
+-java -Dnative.libpath="${JHDFDIR}/lib/native" -jar "${JHDFDIR}/lib/sis-jhdf5-h5ar-cli-${VERSION}.jar" "$@"
++java -Djava.library.path="/usr/lib/jni/" -jar "/usr/share/java/sis-jhdf5-h5ar-cli.jar" "$@"


=====================================
debian/patches/declaring_final_variables.patch
=====================================
@@ -0,0 +1,395 @@
+Description: Adding final qualifier for some variables used by an inner class
+Author: Pierre Gruet <pgtdebian at free.fr>
+Last-Update: 2020-05-12
+
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5BaseWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5BaseWriter.java
+@@ -1038,7 +1038,7 @@
+      */
+     HDF5DataSet createDataSet(final String objectPath, final long storageDataTypeId,
+             final HDF5AbstractStorageFeatures features, final long[] dimensions,
+-            final long[] chunkSizeOrNull, int elementLength)
++            final long[] chunkSizeOrNull, final int elementLength)
+     {
+         final ICallableWithCleanUp<HDF5DataSet> openDataSetCallable =
+                 new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5IntWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5IntWriter.java
+@@ -281,7 +281,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -659,7 +659,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDIntArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDIntArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -787,7 +787,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -824,7 +824,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5ShortWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5ShortWriter.java
+@@ -281,7 +281,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -659,7 +659,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDShortArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDShortArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -787,7 +787,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -824,7 +824,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5ByteWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5ByteWriter.java
+@@ -281,7 +281,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -659,7 +659,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDByteArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDByteArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -787,7 +787,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -824,7 +824,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5FloatWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5FloatWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDFloatArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDFloatArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedByteWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedByteWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDByteArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDByteArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5DoubleWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5DoubleWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDDoubleArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDDoubleArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5LongWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5LongWriter.java
+@@ -281,7 +281,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -659,7 +659,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDLongArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDLongArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -787,7 +787,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -824,7 +824,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedShortWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedShortWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDShortArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDShortArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedIntWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedIntWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDIntArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDIntArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedLongWriter.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5UnsignedLongWriter.java
+@@ -280,7 +280,7 @@
+     }
+ 
+     @Override
+-    public void createArray(String objectPath, HDF5DataSetTemplate template)
++    public void createArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         assert objectPath != null;
+ 
+@@ -658,7 +658,7 @@
+     }
+ 
+     @Override
+-    public void writeMDArray(String objectPath, MDLongArray data, HDF5DataSetTemplate template)
++    public void writeMDArray(final String objectPath, final MDLongArray data, final HDF5DataSetTemplate template)
+     {
+         assert data != null;
+         baseWriter.checkOpen();
+@@ -786,7 +786,7 @@
+     }
+ 
+     @Override
+-    public void createMDArray(String objectPath, HDF5DataSetTemplate template)
++    public void createMDArray(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<Void> createRunnable = new ICallableWithCleanUp<Void>()
+@@ -823,7 +823,7 @@
+     }
+ 
+     @Override
+-    public HDF5DataSet createMDArrayAndOpen(String objectPath, HDF5DataSetTemplate template)
++    public HDF5DataSet createMDArrayAndOpen(final String objectPath, final HDF5DataSetTemplate template)
+     {
+         baseWriter.checkOpen();
+         final ICallableWithCleanUp<HDF5DataSet> createRunnable = new ICallableWithCleanUp<HDF5DataSet>()


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,5 @@ use_jaxb.patch
 avoid_using_private_hdf5_header.patch
 using_h5util_definitions.patch
 loading_jni_in_java_file.patch
+declaring_final_variables.patch
+adapting_h5ar_script_to_debian.patch


=====================================
debian/rules
=====================================
@@ -9,6 +9,7 @@ export TESTCLASSPATH=/usr/share/java/junit4.jar:/usr/share/java/testng.jar:/usr/
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 include /usr/share/java/java_defaults.mk
+export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 
 CPPFLAGS += ${jvm_includes} -Ijni
 
@@ -17,13 +18,19 @@ CPPFLAGS += ${jvm_includes} -Ijni
 
 override_dh_auto_clean:
 	dh_auto_clean
-	-rm -rf debian/libsis-jhdf5-java/ debian/libsis-jhdf5-jni/ debian/tmp/ debian/.debhelper/
-	-rm debian/*debhelper* debian/files debian/*.substvars
-	-rm -rf targets/ test-output/
-	-rm source/c/libsis-jhdf5.so
+	$(RM) -rf debian/libsis-jhdf5-java/ debian/libsis-jhdf5-jni/ debian/tmp/ debian/.debhelper/
+	$(RM) debian/*debhelper* debian/files debian/*.substvars
+	$(RM) -rf targets/ test-output/
+	$(RM) source/c/libsis-jhdf5.so
+	$(RM) -rf debian/_jh*
+	$(RM) -rf debian/h5ar/
+	$(RM) sis-jhdf5-h5ar-cli.jar
 
 override_dh_auto_build:
 	dh_auto_build
+	# The jar needed by the h5ar wrapper is not built by the call to gradle..
+	# We thus do it manually.
+	CLASSPATH="$(CLASSPATH):/usr/share/java/args4j.jar:/usr/share/java/jaxb-runtime.jar" jh_build sis-jhdf5-h5ar-cli.jar $$(find source/java/ -name *.java) --main ch.systemsx.cisd.hdf5.h5ar.HDF5ArchiverMain
 	# Create JNI manually since this is not part of the build system
 	# Upsteam seems to `cd source/c` and call a script which in turn calls compile_hdf5_gcc.sh
 	# In this script hdf5 source is unpacked, possibly patched, build and used for the JNI build
@@ -41,6 +48,12 @@ override_jh_installlibs:
 	mv $$GENERATEDJARPATH targets/gradle/libs/sis-jhdf5.jar
 	jh_installlibs --version-strip='[~pre1]*[+]git[.0-9a-f]*[+]dfsg[.0-9]*'
 
+override_jh_depends:
+	# We do two successive calls because the library does not need to depend on
+	# the jre as the program package does, and the jni does not need jh_depends.
+	jh_depends --package=h5ar
+	jh_depends --package=libsis-jhdf5-java
+
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# Run the tests that come with the upstream source.


=====================================
debian/tests/control
=====================================
@@ -1,6 +1,9 @@
 Tests: providedTests
-Depends: @, default-jdk, junit4, testng, libjmock2-java, libjcommander-java
+Depends: libsis-jhdf5-java, libsis-jhdf5-jni, default-jdk, junit4, testng, libjmock2-java, libjcommander-java
+
+Tests: testWrappingExecutable
+Depends: h5ar, libsis-jhdf5-jni, jarwrapper
 
 Tests: readWriteTest
-Depends: @, default-jdk
+Depends: libsis-jhdf5-java, libsis-jhdf5-jni, default-jdk
 Restrictions: superficial


=====================================
debian/tests/run-unit-test-h5ar
=====================================
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -e
+
+pkg=h5ar
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # Double quote below to expand the temporary directory variable now versus
+  # later is on purpose.
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+sh testWrappingExecutable
+if [ $? -eq 0 ]; then
+  echo "Test testWrappingExecutable PASSED"
+else
+  echo "Test testWrappingExecutable FAILED"
+fi
+


=====================================
debian/tests/run-unit-test-libsis-jhdf5-java
=====================================
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -e
+
+pkg=libsis-jhdf5-java
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # Double quote below to expand the temporary directory variable now versus
+  # later is on purpose.
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+sh readWriteTest
+if [ $? -eq 0 ]; then
+  echo "Test readWriteTest PASSED"
+else
+  echo "Test readWriteTest FAILED"
+fi
+


=====================================
debian/tests/testWrappingExecutable
=====================================
@@ -0,0 +1,49 @@
+#!/bin/sh
+# autopkgtest check: Create an archive with both the wrapper and the jar, 
+# then compare their contents. Extract one of them and check that the outfiles
+# are the same as the original ones.
+# (C) 2020 Pierre Gruet.
+# Author: Pierre Gruet <pgtdebian at free.fr>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+cat <<EOF > firstFile
+Contents of file 1
+\[e^{i\pi}+1=0\]
+EOF
+
+cat <<EOF > secondFile.tex
+Contents of file 2
+\[\sum_{n=1}^{+\infty}\frac{1}{n^2}=\frac{\pi^2}{6}\]
+EOF
+
+#Creating an archive
+h5ar ar arch1 firstFile secondFile.tex
+
+#The result must be the same if we directly call the wrapped jar.
+java -jar /usr/share/java/sis-jhdf5-h5ar-cli.jar ar arch2 firstFile secondFile.tex
+#To check it, we get a listing of the files in the two archives and see that they are equal.
+java -jar /usr/share/java/sis-jhdf5-h5ar-cli.jar ls -v -R -t -S arch1.h5ar | tail -n 2 > outLs1
+h5ar ls -v -R -t -S arch2.h5ar | tail -n 2 > outLs2
+diff outLs1 outLs2
+
+if [ $? -ne 0 ]; then
+  exit 1
+fi
+
+#Finally, we make a copy of the original files and delete them.
+#Then we extract the archive and compare the outfiles to the copies we made.
+cp firstFile firstFileCp
+cp secondFile.tex secondFileCp.tex
+rm firstFile secondFile.tex
+h5ar ex arch1.h5ar
+diff firstFile firstFileCp && diff secondFile.tex secondFileCp.tex
+
+if [ $? -ne 0 ]; then
+  exit 1
+fi
+



View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/4d1d27836208c0a4a36a18df2826ffbdd95861c1...d642cc72f3247f5f0192590c52bdb3c65738056a

-- 
View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/4d1d27836208c0a4a36a18df2826ffbdd95861c1...d642cc72f3247f5f0192590c52bdb3c65738056a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200512/52867c0c/attachment-0001.html>


More information about the debian-med-commit mailing list