[med-svn] [libsis-base-java] 02/05: add Debian packaging

Olivier Sallou osallou at debian.org
Fri Aug 21 14:26:32 UTC 2015


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

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

commit dfc8f8c59a55516fecab0e101bad3c617fd68cd9
Author: Olivier Sallou <osallou at debian.org>
Date:   Fri Aug 21 14:07:21 2015 +0000

    add Debian packaging
---
 debian/README.Debian                        | 12 ++++++++
 debian/build_native/Makefile.am             |  7 +++++
 debian/build_native/configure.ac            | 28 +++++++++++++++++
 debian/changelog                            |  9 ++++++
 debian/compat                               |  1 +
 debian/control                              | 27 +++++++++++++++++
 debian/copyright                            | 18 +++++++++++
 debian/get-orig-source                      | 19 ++++++++++++
 debian/libsis-base-java.jlibs               |  1 +
 debian/manifest                             |  2 ++
 debian/patches/fix_tests.patch              | 40 ++++++++++++++++++++++++
 debian/patches/load_native_debian.patch     | 29 ++++++++++++++++++
 debian/patches/remove_ch_rinn_imports.patch | 45 +++++++++++++++++++++++++++
 debian/patches/series                       |  3 ++
 debian/rules                                | 47 +++++++++++++++++++++++++++++
 debian/source/format                        |  1 +
 debian/watch                                |  3 ++
 17 files changed, 292 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..1dbd3f3
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,12 @@
+This package is needed by libsis-jhdf5-java and possibly by other related
+packages in the future.
+
+Do not confuse it with "Apache SIS".
+
+It does not seem to have a web page and does not seem to be used outside of
+internal ETH SIS projects.
+
+
+native libraries are put in /usr/lib/sis-base
+Jar files need "native.libpath" system property to be set to find the library:
+  java ... -Dnative.libpath=/usr/lib/sis-base ...
diff --git a/debian/build_native/Makefile.am b/debian/build_native/Makefile.am
new file mode 100644
index 0000000..494500a
--- /dev/null
+++ b/debian/build_native/Makefile.am
@@ -0,0 +1,7 @@
+AM_CFLAGS=-I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -DMACHINE_BYTE_ORDER=1
+
+lib_LTLIBRARIES = libcisd_unix.la libcisd_nativedata.la
+libcisd_unix_la_SOURCES = unix.c
+#libcisd_unix_la_LD_FLAGS = 
+libcisd_nativedata_la_SOURCES = copyByteChar.c copyByteDouble.c copyByteFloat.c copyByteInt.c copyByteLong.c copyByteShort.c copyCommon.c
+#libcisd_nativedata_la_LDFLAGS = -DMACHINE_BYTE_ORDER=1
diff --git a/debian/build_native/configure.ac b/debian/build_native/configure.ac
new file mode 100644
index 0000000..2ebd607
--- /dev/null
+++ b/debian/build_native/configure.ac
@@ -0,0 +1,28 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([iscd], [1.14], [osallou at debian.org])
+AC_CONFIG_SRCDIR([copyByteFloat.c])
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE
+LT_INIT
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([string.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_STRUCT_ST_BLOCKS
+
+# Checks for library functions.
+AC_FUNC_CHOWN
+AC_CHECK_FUNCS([strerror])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..7fb7531
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,9 @@
+libsis-base-java (14.12.0-1) UNRELEASED; urgency=medium
+
+  [ Team upload]
+  * First package (Closes: #TODO)
+
+  [TODO]
+  * set watch file, though svn export is used for get-orig-source
+
+ -- 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..444ffe7
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,27 @@
+Source: libsis-base-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,
+               testng,
+               autotools-dev, dh-autoreconf, libtool
+Standards-Version: 3.9.6
+Homepage: http://svncisd.ethz.ch/repos/cisd/base/tags/release/14.12.x/14.12.0/base
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-med/libsis-base-java.git
+Vcs-Git: git://anonscm.debian.org/debian-med/libsis-base-java.git
+
+
+Package: libsis-base-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, libsis-base-jni (= ${binary:Version})
+Description: Base libraries used by software from the SIS division at ETH Zurich
+ This library supplies some utility classes needed for libraries like sis-jhdf5.
+
+Package: libsis-base-jni
+Architecture: any
+Depends: ${misc:Depends}, ${java:Depends}
+Description: Base libraries used by ETH-SIS (JNI components)
+ This library contains the two small native libraries used by libsis-base-java.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..5223666
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,18 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: sis-base
+Upstream-Contact: https://www1.ethz.ch/id/about/sections/sis/index_EN
+Source: http://bs-svn01.ethz.ch/repos/cisd/libraries/trunk/sis-base/sis-base.jar
+
+Files: *
+Copyright: Copyright (C) Copyright 2007-2012 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: 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..cc9371a
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,19 @@
+#!/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
+
+svn export http://svncisd.ethz.ch/repos/cisd/base/tags/release/14.12.x/14.12.0/base ${PKG}-${VERSION}
+rm -rf ${PKG}-${VERSION}/build
+rm -rf ${PKG}-${VERSION}/libs
+
+GZIP="--best --no-name" 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-base-java.jlibs b/debian/libsis-base-java.jlibs
new file mode 100644
index 0000000..029944e
--- /dev/null
+++ b/debian/libsis-base-java.jlibs
@@ -0,0 +1 @@
+sis-base.jar
diff --git a/debian/manifest b/debian/manifest
new file mode 100644
index 0000000..50a2d01
--- /dev/null
+++ b/debian/manifest
@@ -0,0 +1,2 @@
+usr/share/java/sis-base.jar:
+         Class-Path: commons-lang.jar commons-io.jar
diff --git a/debian/patches/fix_tests.patch b/debian/patches/fix_tests.patch
new file mode 100644
index 0000000..5483735
--- /dev/null
+++ b/debian/patches/fix_tests.patch
@@ -0,0 +1,40 @@
+Subject: Tests made assumption user is not root
+Description: Update uid/gid tests assuming non root user.
+Forwarded: no
+Author: Olivier Sallou <osallou at debian.org>
+--- a/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
++++ b/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
+@@ -164,14 +164,14 @@
+         { "requires_unix" })
+     public void testGetUid()
+     {
+-        assertTrue(Unix.getUid() > 0);
++        assertTrue(Unix.getUid() >= 0);
+     }
+ 
+     @Test(groups =
+         { "requires_unix" })
+     public void testGetEuid()
+     {
+-        assertTrue(Unix.getEuid() > 0);
++        assertTrue(Unix.getEuid() >= 0);
+         assertEquals(Unix.getUid(), Unix.getEuid());
+     }
+ 
+@@ -179,14 +179,14 @@
+         { "requires_unix" })
+     public void testGetGid()
+     {
+-        assertTrue(Unix.getGid() > 0);
++        assertTrue(Unix.getGid() >= 0);
+     }
+ 
+     @Test(groups =
+         { "requires_unix" })
+     public void testGetEgid()
+     {
+-        assertTrue(Unix.getEgid() > 0);
++        assertTrue(Unix.getEgid() >= 0);
+         assertEquals(Unix.getGid(), Unix.getEgid());
+     }
+ 
diff --git a/debian/patches/load_native_debian.patch b/debian/patches/load_native_debian.patch
new file mode 100644
index 0000000..444e4d6
--- /dev/null
+++ b/debian/patches/load_native_debian.patch
@@ -0,0 +1,29 @@
+Subject: fix way to load native libraries
+Description: upstream applies various methods to look for the
+ native library and falls back to pure java if linking fails.
+ Here we just load the library from /usr/lib/jni and quit
+ immediately if linking fails.
+--- a/source/java/ch/systemsx/cisd/base/convert/NativeData.java
++++ b/source/java/ch/systemsx/cisd/base/convert/NativeData.java
+@@ -45,7 +45,8 @@
+             useNativeLib = false;
+         } else
+         {
+-            useNativeLib = NativeLibraryUtilities.loadNativeLibrary("nativedata");
++	    System.loadLibrary("cisd_nativedata");
++	    useNativeLib = true;
+         }
+     }
+ 
+--- a/source/java/ch/systemsx/cisd/base/unix/Unix.java
++++ b/source/java/ch/systemsx/cisd/base/unix/Unix.java
+@@ -46,7 +46,8 @@
+ 
+     static
+     {
+-        operational = NativeLibraryUtilities.loadNativeLibrary("unix");
++	System.loadLibrary("cisd_unix");
++        operational = true;
+         if (operational)
+         {
+             init();
diff --git a/debian/patches/remove_ch_rinn_imports.patch b/debian/patches/remove_ch_rinn_imports.patch
new file mode 100644
index 0000000..ba9fcfa
--- /dev/null
+++ b/debian/patches/remove_ch_rinn_imports.patch
@@ -0,0 +1,45 @@
+We don't care if the interface is private or public, as it makes no
+difference to the running code.
+I have no idea where the code for this decorator is in any case.
+--- a/source/java/ch/systemsx/cisd/base/unix/Unix.java
++++ b/source/java/ch/systemsx/cisd/base/unix/Unix.java
+@@ -19,7 +19,6 @@
+ import java.io.File;
+ import java.io.IOException;
+ 
+-import ch.rinn.restrictions.Private;
+ import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
+ import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked;
+ import ch.systemsx.cisd.base.utilities.NativeLibraryUtilities;
+@@ -415,13 +414,11 @@
+ 
+     private static native String strerror();
+ 
+-    @Private
+     static boolean isProcessRunningProcFS(int pid)
+     {
+         return new File("/proc/" + pid).isDirectory();
+     }
+ 
+-    @Private
+     static boolean isProcessRunningPS(int pid)
+     {
+         try
+--- a/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
++++ b/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
+@@ -24,7 +24,6 @@
+ import org.apache.commons.io.FileUtils;
+ import org.testng.annotations.Test;
+ 
+-import ch.rinn.restrictions.Friend;
+ import ch.systemsx.cisd.base.BuildAndEnvironmentInfo;
+ import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase;
+ import ch.systemsx.cisd.base.unix.Unix.Group;
+@@ -36,7 +35,6 @@
+  * 
+  * @author Bernd Rinn
+  */
+- at Friend(toClasses = Unix.class)
+ public class UnixTests extends AbstractFileSystemTestCase
+ {
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0f16c71
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+remove_ch_rinn_imports.patch
+load_native_debian.patch
+fix_tests.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..cc28731
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,47 @@
+#!/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/testng.jar
+
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+get-orig-source:
+	. debian/get-orig-source
+
+%:
+	dh $@ --with javahelper
+
+override_dh_auto_configure:
+	cp debian/build_native/* source/c
+	#Needed on Ubuntu 14.04
+	touch source/c/NEWS source/c/README source/c/AUTHORS source/c/ChangeLog
+	cd source/c && autoreconf -i
+	dh_auto_configure
+
+override_dh_auto_install:
+	dh_auto_install
+	dh_installdirs -plibsis-base-jni /usr/lib/jni
+	cp -L source/c/.libs/*.so debian/*/usr/lib/jni/
+
+override_dh_auto_clean:
+	if test -e source/c/Makefile; then cd source/c; make clean; fi
+	rm -f source/c/AUTHORS source/c/NEWS source/c/README source/c/ChangeLog
+	rm -rf source/c/configure* source/c/Makefile* source/c/autom4te.cache
+	rm -rf src lib build *.jar test .classpath libs
+	#find test -name '*.class' -delete
+
+override_dh_auto_build:
+	# Avoids jh_build thinking that files in .svn or .pc are things it
+	# needs to compile.
+	mkdir src ; cp -r source/java/ch src
+	jh_build sis-base.jar src
+	cd source/c ; ./configure && make
+
+override_dh_auto_test:
+	dh_auto_test
+	mkdir test ; cp -r source/java/ch test ; cp -r sourceTest/java/ch test
+	jh_build sis-base-test.jar test
+	LC_ALL=C java -Djava.library.path=source/c/.libs -classpath sis-base-test.jar ch.systemsx.cisd.base.AllTests
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..1008e4e
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+# The latest vesrsion can be found at:
+#
+# http://svncisd.ethz.ch/repos/cisd/base/tags/release/14.12.x/14.12.0/base

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



More information about the debian-med-commit mailing list