[med-svn] [libsis-jhdf5-java] 02/04: remove unwanted debian files from repo

Olivier Sallou osallou at debian.org
Fri Aug 21 16:35:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

osallou pushed a commit to branch master
in repository libsis-jhdf5-java.

commit 548c81acfe4e5232cdc980bacd2096ee96d780c8
Author: Olivier Sallou <osallou at debian.org>
Date:   Fri Aug 21 16:27:19 2015 +0000

    remove unwanted debian files from repo
---
 debian/README.source                        | 53 +++++++++++++++++++
 debian/changelog                            | 13 +++++
 debian/compat                               |  1 +
 debian/control                              | 36 +++++++++++++
 debian/copyright                            | 26 ++++++++++
 debian/get-orig-source                      | 20 ++++++++
 debian/libsis-jhdf5-java.jlibs              |  1 +
 debian/libsis-jhdf5-java.manifest           |  2 +
 debian/libsis-jhdf5-jni.install             |  1 +
 debian/patches/fix_dodgy_cast.patch         | 16 ++++++
 debian/patches/load_native_debian.patch     | 25 +++++++++
 debian/patches/remove_ch_rinn_imports.patch | 79 +++++++++++++++++++++++++++++
 debian/patches/series                       |  3 ++
 debian/rules                                | 59 +++++++++++++++++++++
 debian/source/format                        |  1 +
 debian/test/ReadWriteTest.java              | 48 ++++++++++++++++++
 debian/watch                                |  6 +++
 17 files changed, 390 insertions(+)

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..fba96aa
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,53 @@
+We have 2 Free Java libraries for HDF5:
+
+1) The "NCSA" lib distributed by hdfgroup.org with classes in namespace
+ncsa.hdf.hdf5lib, packaged on Debian as libjhdf5-java.
+
+2) The "CISD" aka. "SIS" lib distributed by ethz.ch with classes in the
+namespace ch.systemsx, not currently packaged on Debian.
+
+The SIS library forks some Java code from the ncsa.hdf namespace, and
+also needs to link against the NCSA native library (via JNI) at runtime.
+
+So, trying to package sis-jhdf5:
+
+The 'source' distribution' linked on the web page only have the Java source.
+The real source you need is in SVN:
+
+svn co http://svncisd.ethz.ch/repos/cisd/jhdf5/trunk/
+
+For compilation to succeed, we also need sis-base, not to be confused
+with the entirely separate project at sis.apache.org!
+
+http://svncisd.ethz.ch/repos/cisd/base/trunk/
+See the libsis-base-java package for this.
+
+The code also depends on their own args4j library, but only for the CLI
+under ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java which we can
+simply leave out just now.  I delete it from jsrc/ before compiling and
+also leave out the h5ar.sh script which invokes it.  Once args4j is packaged
+this can be reinstated and the h5ar command can be added to /usr/bin
+( http://bs-svn01.ethz.ch/repos/cisd/libraries/trunk/cisd-args4j/ )
+
+So - can we exclude the ncsa.hdf.hdf5lib.* classes from sis-jhdf5 and
+compile it against the existing classes in /usr/share/java/jhdf5.jar?
+My conclusion is not, because...
+
+The version of ncsa/hdf/hdf5lib/exceptions/HDF5Exception.java supplied
+with the sis-jhdf5 code subclasses RuntimeException but the version in
+libhdf5-java does not.  The result is that the code here does not need
+to declare the exceptions being thrown, and thus simply ignores them
+all.  One can go through and add all "throws" declarations (there are a
+_lot_ of them!!), but then any client code using the library will also
+break unless it is likewise patched or the code is modified to handle
+the exceptions internally. I think we'd best just admit defeat here and
+use the code supplied with sis-jhdf5.
+
+So, I'm going to try rolling two new packages, and see if that allows me
+to compile the latest FastQC:
+
+libsis-base-java (should be simple)
+libsis-jhdf5-java (depends on libsis-base-java + libhdf5, but ignores
+                   existing libjhdf5-jni package)
+
+-- Tim Booth on 12th Aug 2015
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..a450dbc
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,13 @@
+libsis-jhdf5-java (14.12.1-1) UNRELEASED; urgency=medium
+
+  * [ Team upload ]
+    First package
+
+  * [ DONE ]
+    C libraries generated during build
+    Jar library generated during build
+    test jar file generated and executed during test step
+  * [TODO]
+    polishing in control, DEP3 patches, copyright
+
+ -- Tim Booth <tbooth at ceh.ac.uk>  Wed, 12 Aug 2015 12:15:17 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..d1f85c0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,36 @@
+Source: libsis-jhdf5-java
+Section: java
+Priority: extra
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders: Tim Booth <tbooth at ceh.ac.uk>,
+           Olivier Sallou <osallou at debian.org>
+Build-Depends: debhelper (>= 9), default-jdk, javahelper,
+               libcommons-lang-java,
+               libcommons-io-java,
+               libsis-base-java,
+               libhdf5-dev ( >> 1.8.13),
+               libhdf5-dev,
+               junit4,
+               testng,
+               libjmock2-java
+Standards-Version: 3.9.6
+Homepage: http://svncisd.ethz.ch/repos/cisd/jhdf5/tags/release/14.12.x/14.12.1/jhdf5
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-med/libsis-jhdf5-java.git
+Vcs-Git: git://anonscm.debian.org/debian-med/libsis-jhdf5-java.git
+
+
+Package: libsis-jhdf5-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends},
+         libsis-jhdf5-jni (>= ${binary:Version}), libsis-jhdf5-jni (<< ${source:Version}.1~)
+Description: easy-to-use HDF library for Java
+ JHDF5 is 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 library uses HDF5 1.8 from the HDF Group and files created with
+ JHDF5 are fully compatible with HDF5 1.6/1.8 (as you choose).
+
+Package: libsis-jhdf5-jni
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: native libs used by libsis-jhdf5-java package
+ This package is only useful with libsis-jhdf5-java.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..e80392b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,26 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: JHDF5 (HDF5 for Java)
+Upstream-Contact: https://wiki-bsse.ethz.ch/pages/viewpage.action?pageId=26609113
+Source: http://svncisd.ethz.ch/repos/cisd/jhdf5/tags/release/
+
+Files: ch/*
+Copyright: Copyright (C) Copyright 2007-2015 ETH Zuerich, CISD
+License: Apache
+ On Debian systems, you can read the full text of the Apache
+ License in ‘/usr/share/common-licenses/Apache-2.0’.
+
+Files: ncsa/*
+Copyright: Copyright (C) The HDF Group.
+           Copyright (C) the Board of Trustees of the University of Illinois
+License: Apache
+ On Debian systems, you can read the full text of the Apache
+ License in ‘/usr/share/common-licenses/Apache-2.0’.
+
+Files: debian/*
+Copyright: 2015 Tim Booth <tbooth at ceh.ac.uk>
+           2015 Olivier Sallou <osallou at debian.org>
+License: GPL-3
+ On Debian systems, the full text of the GNU General Public
+ License version 3 can be found in the file
+ `/usr/share/common-licenses/GPL-3'
+
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..39cf644
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+PKG=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+
+VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+
+cd ..
+mkdir -p tarballs
+cd tarballs
+
+rm -rf ${PKG}-${VERSION} ; mkdir ${PKG}-${VERSION} ; cd ${PKG}-${VERSION}
+svn export http://svncisd.ethz.ch/repos/cisd/jhdf5/tags/release/14.12.x/14.12.1/jhdf5/source
+svn export http://svncisd.ethz.ch/repos/cisd/jhdf5/tags/release/14.12.x/14.12.1/jhdf5/sourceTest
+cd ..
+
+tar --owner=root --group=root --mode=a+rX --exclude-vcs -caf "$PKG"_"$VERSION".orig.tar.xz "$PKG"-"$VERSION"
+rm -rf "$PKG"-"$VERSION"
+
diff --git a/debian/libsis-jhdf5-java.jlibs b/debian/libsis-jhdf5-java.jlibs
new file mode 100644
index 0000000..b0be7d5
--- /dev/null
+++ b/debian/libsis-jhdf5-java.jlibs
@@ -0,0 +1 @@
+sis-jhdf5.jar
diff --git a/debian/libsis-jhdf5-java.manifest b/debian/libsis-jhdf5-java.manifest
new file mode 100644
index 0000000..f1faee6
--- /dev/null
+++ b/debian/libsis-jhdf5-java.manifest
@@ -0,0 +1,2 @@
+usr/share/java/sis-jhdf5.jar:
+         Class-Path: commons-lang.jar commons-io.jar sis-base.jar
diff --git a/debian/libsis-jhdf5-jni.install b/debian/libsis-jhdf5-jni.install
new file mode 100644
index 0000000..e70401c
--- /dev/null
+++ b/debian/libsis-jhdf5-jni.install
@@ -0,0 +1 @@
+source/c/*.so	    /usr/lib/jni
diff --git a/debian/patches/fix_dodgy_cast.patch b/debian/patches/fix_dodgy_cast.patch
new file mode 100644
index 0000000..490e9fb
--- /dev/null
+++ b/debian/patches/fix_dodgy_cast.patch
@@ -0,0 +1,16 @@
+Subject: fix templating
+Description: fix compilation issue for templating
+Author: Tim Booth
+Last-Updated: 2015-08-21
+Forwarded: no
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5CompoundMemberByteifyerEnumArrayFactory.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5CompoundMemberByteifyerEnumArrayFactory.java
+@@ -438,7 +438,7 @@
+         { "unchecked", "rawtypes" })
+     private static Enum<?> getValue(Class<? extends Enum<?>> enumClass, String value)
+     {
+-        return Enum.valueOf((Class<Enum>) enumClass, value);
++        return Enum.valueOf((Class) enumClass, value);
+     }
+ 
+ }
diff --git a/debian/patches/load_native_debian.patch b/debian/patches/load_native_debian.patch
new file mode 100644
index 0000000..e19b1e1
--- /dev/null
+++ b/debian/patches/load_native_debian.patch
@@ -0,0 +1,25 @@
+Subject: Use Debian directories to load native libs
+Description: There is already a libjhdf5.so on the system.  This is an incompatible fork.
+Since the .so is tightly bound to the Java library there seems no harm in simply
+renaming this one; nothing outside this package should want to link to it.
+
+Also, skip the library loader utility class since it doesn't help us.  Note that
+on modern java, multiple calls to System.loadLibrary() are idempotent too.
+Author: Tim Booth
+Last-Updated: 2015-08-21
+Forwarded: no
+
+--- a/source/java/ch/systemsx/cisd/hdf5/hdf5lib/H5.java
++++ b/source/java/ch/systemsx/cisd/hdf5/hdf5lib/H5.java
+@@ -36,10 +36,7 @@
+ 
+     static
+     {
+-        if (NativeLibraryUtilities.loadNativeLibrary("jhdf5") == false)
+-        {
+-            throw new UnsupportedOperationException("No suitable HDF5 native library found for this platform.");
+-        }
++	System.loadLibrary("sis-jhdf5");
+ 
+         // Important! Exit quietly
+         try
diff --git a/debian/patches/remove_ch_rinn_imports.patch b/debian/patches/remove_ch_rinn_imports.patch
new file mode 100644
index 0000000..7776a5d
--- /dev/null
+++ b/debian/patches/remove_ch_rinn_imports.patch
@@ -0,0 +1,79 @@
+Subject: remove decorator
+Description: decorator class is not in Debian and not useful
+Author: Tim Booth
+Last-Updated: 2015-08-21
+Forwarded: no
+
+--- a/source/java/ch/systemsx/cisd/hdf5/BitSetConversionUtils.java
++++ b/source/java/ch/systemsx/cisd/hdf5/BitSetConversionUtils.java
+@@ -23,7 +23,6 @@
+ 
+ import org.apache.commons.lang.SystemUtils;
+ 
+-import ch.rinn.restrictions.Private;
+ import ch.systemsx.cisd.base.mdarray.MDLongArray;
+ 
+ /**
+@@ -122,7 +121,6 @@
+         }
+     }
+ 
+-    @Private
+     static BitSet fromStorageFormGeneric(final long[] serializedWordArray, int start, int length)
+     {
+         final BitSet result = new BitSet();
+--- a/source/java/ch/systemsx/cisd/hdf5/HDF5Utils.java
++++ b/source/java/ch/systemsx/cisd/hdf5/HDF5Utils.java
+@@ -22,7 +22,6 @@
+ 
+ import ncsa.hdf.hdf5lib.exceptions.HDF5JavaException;
+ 
+-import ch.rinn.restrictions.Private;
+ 
+ /**
+  * Some utility methods used by {@link HDF5Reader} and {@link HDF5Writer}.
+@@ -43,7 +42,6 @@
+     static final String TYPE_VARIANT_ATTRIBUTE_NAME = "TYPE_VARIANT";
+ 
+     /** The minimal size of a chunk. */
+-    @Private
+     static final int MIN_CHUNK_SIZE = 1;
+ 
+     /** The minimal size of a data set in order to allow for chunking. */
+--- a/sourceTest/java/ch/systemsx/cisd/hdf5/BitSetConversionTest.java
++++ b/sourceTest/java/ch/systemsx/cisd/hdf5/BitSetConversionTest.java
+@@ -25,7 +25,6 @@
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+ 
+-import ch.rinn.restrictions.Friend;
+ import ch.systemsx.cisd.base.mdarray.MDLongArray;
+ 
+ /**
+@@ -33,7 +32,6 @@
+  * 
+  * @author Bernd Rinn
+  */
+- at Friend(toClasses = BitSetConversionUtils.class)
+ public class BitSetConversionTest
+ {
+     private BitSet create(final Integer... indices)
+--- a/sourceTest/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverTest.java
++++ b/sourceTest/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverTest.java
+@@ -38,7 +38,6 @@
+ import org.testng.annotations.BeforeSuite;
+ import org.testng.annotations.Test;
+ 
+-import ch.rinn.restrictions.Friend;
+ import ch.systemsx.cisd.base.unix.FileLinkType;
+ import ch.systemsx.cisd.base.unix.Unix;
+ import ch.systemsx.cisd.base.unix.Unix.Stat;
+@@ -51,8 +50,6 @@
+  * 
+  * @author Bernd Rinn
+  */
+- at Friend(toClasses =
+-    { HDF5Archiver.class, IdCache.class, LinkRecord.class })
+ public class HDF5ArchiverTest
+ {
+     private static final File rootDirectory = new File("targets", "unit-test-wd");
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c0291d1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+fix_dodgy_cast.patch
+remove_ch_rinn_imports.patch
+load_native_debian.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..86df809
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,59 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export CLASSPATH=/usr/share/java/commons-lang.jar:/usr/share/java/commons-io.jar:/usr/share/java/sis-base.jar
+export TESTCLASSPATH=/usr/share/java/junit4.jar:/usr/share/java/testng.jar:/usr/share/java/jmock2.jar:/usr/share/java/jcommander.jar
+
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+
+%:
+	dh $@ --with javahelper
+
+get-orig-source:
+	debian/get-orig-source
+
+override_dh_auto_clean:
+	rm -rf build *.jar
+	rm -rf source/c/*.log
+	rm -rf source/c/*.so
+	# Stuff generated during testing
+	find sourceTest/java -name '*.class' -delete
+	cd sourceTest/java && rm -f *.hdf *.h5
+	rm -f sourceTest/java/sourceTest/java/test/hdf5lib/h5ex_g_iterate.hdf
+	rm -rf test-output targets
+	#Things that we'd probably exclude from the orig.tar.gz anyway
+	rm -rf jsrc lib ./sourceTest/java/jni
+
+override_dh_auto_build:
+	# C build
+	cd source/c && \
+		$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)  -shared -fPIC -Wl,--exclude-libs,ALL \
+		-I/usr/lib/jvm/default-java/include/ -I/usr/include/hdf5/serial \
+	       	jhdf5/*.c hdf-java/*.c -o libsis-jhdf5.so -lz -lhdf5_serial
+	# Java build - see README.source about the file being removed
+	mkdir jsrc ; cp -r source/java/ch source/java/ncsa jsrc
+	rm jsrc/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
+	# This line is still needed on Ubuntu 14.04
+	jh_build sis-jhdf5.jar jsrc
+
+override_dh_auto_test:
+	# Run the tests that come with the upstream source.
+	# The contortions with the CLASSPATH are to try and confirm that the MANIFEST is
+	# supplying the correct deps automatically - ie. we should not be feeding any
+	# extra JARs in order to make the tests pass.
+	# The version of testng on trusty does requires us to specifically add jcommander.jar to the
+	# CLASSPATH when invoking TestNG.  This seems to be a bug in the testng package.
+	# Finally, the tests need to be run in the Zurich timezone.
+	export CLASSPATH="sourceTest/java:`readlink -f sis-jhdf5.jar`:$$TESTCLASSPATH" \
+	       JNIPATH="`readlink -f source/c`:/usr/lib/jni" \
+	       TZ=Europe/Zurich LC_ALL=C ; \
+	    find sourceTest/java -name '*.java' | env CLASSPATH="$$CLASSPATH:$(CLASSPATH)" xargs javac && \
+	    java -Xmx2048M -Djava.library.path="$$JNIPATH" org.testng.TestNG -verbose 2 sourceTest/java/tests.xml
+	# These other tests have 3 failures.  I don't think they are expected to pass.
+	#cd sourceTest/java && \
+	#ln -s test/hdf5lib/h5ex_g_iterate.hdf . && \
+	#java -Xmx2048M -Djava.library.path="$$JNIPATH" org.junit.runner.JUnitCore test.hdf5lib.TestAll
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/test/ReadWriteTest.java b/debian/test/ReadWriteTest.java
new file mode 100644
index 0000000..28ade81
--- /dev/null
+++ b/debian/test/ReadWriteTest.java
@@ -0,0 +1,48 @@
+/* Test class based on the sample code at https://wiki-bsse.ethz.ch/pages/viewpage.action?pageId=26609113
+ * and amednded for the Deb package by Tim Booth.  Running this assures us thet the JNI library can
+ * be loaded and that the code is at least somewhat functional.
+ * This is too simple to be worth pulling in any kind of test framework.
+ */
+
+import ch.systemsx.cisd.hdf5.HDF5Factory;
+import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter;
+import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
+
+public class ReadWriteTest {
+
+    public static void main(String[] args) {
+
+	//Make an array
+	double[] mydata = new double[1000];
+	for (int nn=0 ; nn < mydata.length ; nn++) {
+	    mydata[nn] = Math.cos(nn);
+	}
+
+	//Write it
+	IHDF5SimpleWriter writer = HDF5Factory.open("out.h5");
+	writer.writeDoubleArray("cosines", mydata);
+	writer.close();
+
+	//Read it back
+	IHDF5SimpleReader reader = HDF5Factory.openForReading("out.h5");
+	double[] readdata = reader.readDoubleArray("cosines");
+	reader.close();
+
+	//Inspect it
+	if(readdata.length != mydata.length) {
+	    System.out.println("Array length is not 1000 as expected");
+	    System.exit(1);
+	}
+
+	for (int nn=0 ; nn < mydata.length ; nn++ ) {
+	    if(readdata[nn] != mydata[nn]) {
+		System.out.println("Data mismatch at index " + nn);
+		System.exit(1);
+	    }
+	}
+
+	//Happy!
+	System.out.println("OK");
+	//exit(0);
+    }
+}
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..62c0b70
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,6 @@
+# The source is packed into a .zip within the binary distribution.
+#
+# TODO - make a get_orig_source script to extract it, or work out how to
+# pull it from the SVN via HTTP.
+
+# see: http://svncisd.ethz.ch/repos/cisd/jhdf5/tags/release/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libsis-jhdf5-java.git



More information about the debian-med-commit mailing list