[med-svn] [SCM] snappy1.0.3-java branch, master, updated. ba5add67a292db33562df5e0e2811b137742ca8a

Andreas Tille tille at debian.org
Tue Aug 14 08:41:16 UTC 2012


The following commit has been merged in the master branch:
commit ba5add67a292db33562df5e0e2811b137742ca8a
Author: Andreas Tille <tille at debian.org>
Date:   Tue Aug 14 10:40:42 2012 +0200

    Add some preliminary (=not yet tested) debian/ dir

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..b6277c1
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,14 @@
+In the original upstream archive, the file ‘lib/silk-weaver.jar’ is not
+accompanied with its source.  To simplify the process, and prevent
+accidental inclusion of more source-less files in future releases, the
+whole ‘lib’ directory is removed.
+
+Moreover the directory src/main/resources/org/xerial/snappy/native is
+removed as well because it contains binaries of a Debian packaged
+library for different OSes.  Due to the fact that we are using the
+Debian packaged version anyway all the files are removed.
+
+The prepraration of the according orig tarball can be done by using
+
+   make -f debian/rules get-orig-source
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..5b59d16
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+snappy1.0.3-java (1.0.3.3~dfsg-1) UNRELEASED; urgency=low
+
+  * Initial release
+
+ -- Andreas Tille <tille at debian.org>  Wed, 08 Aug 2012 09:21:35 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..ab88656
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,30 @@
+Source: snappy1.0.3-java
+Section: java
+Priority: optional
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders: Charles Plessy <plessy at debian.org>,
+ Andreas Tille <tille at debian.org>,
+Build-Depends: debhelper (>= 8), cdbs, default-jdk, maven-debian-helper (>= 1.4),
+ xml-twig-tools, libsnappy-dev
+Build-Depends-Indep: libmaven-bundle-plugin-java
+Standards-Version: 3.9.3
+Vcs-Git: git://git.debian.org/debian-med/snappy1.0.3-java.git
+Vcs-Browser: http://git.debian.org/?p=debian-med/snappy1.0.3-java.git
+Homepage: http://code.google.com/p/snappy-java/ 
+
+Package: libsnappy1.0.3-java
+Architecture: all
+Depends: ${misc:Depends}, ${maven:Depends}, ${shlib:Depends}, libsnappy1
+Recommends: ${maven:OptionalDepends}
+Description: Snappy v1.0.3 for Java, a fast compressor/decompresser
+ Java port of Snappy, a fast compresser/decompresser written in C++,
+ originally developed by Google. 
+ .
+ Snappy's main target is very high-speed compression/decompression with
+ reasonable compression size. So the compression ratio of snappy-java is
+ modest and about the same as LZF (ranging 20%-100% according to the
+ dataset). 
+ .
+ This version of the Java library is not the latest upstream version
+ but it has an ABI which is used by picard-tools package and was finally
+ packaged exactly for the purpose to support ppicard-tools.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..b25225b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,41 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: https://code.google.com/p/snappy-java/downloads/list?can=4&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
+Comment: lib/silk-weaver.jar is not packaged in Debian, and the other files in
+ this directory are not useful to the Debian package, so they were removed.
+ The native snappy library, for which the sources are not present in the snappy-java
+ archive, was removed as well.
+Removed: lib src/main/resources/org/xerial/snappy/native
+
+Files: *
+Copyright: © 2008–2011 Taro L. Saito
+           © 2011 xerial.org
+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 complete text of the Apache License version 2.0
+ can be found in ‘/usr/share/common-licenses/Apache-2.0’.
+Comment: 
+ This product includes software developed by Google
+   Snappy: http://code.google.com/p/snappy/ (New BSD License)
+ .
+ .
+ This library containd statically linked libstdc++. This inclusion is allowed by 
+ "GCC RUntime Library Exception" 
+ http://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html
+ .
+ == Contributors ==
+   * Tatu Saloranta  
+     * Providing benchmark suite
+   * Alec Wysoker
+     * Performance and memory usage improvement
+
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..7ff374c
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,19 @@
+# This source package is manage in a Git repository with git-buildpackage.
+
+[DEFAULT]
+# use pristine-tar:
+pristine-tar = True
+
+[git-buildpackage]
+# call lintian after a successful build:
+postbuild = lintian -I --pedantic $GBP_CHANGES_FILE
+
+[git-import-orig]
+# import filter:
+filter = snappy-java-*/lib
+# filter out files from tarball passed to pristine tar:
+filter-pristine-tar = True
+
+[git-dch]
+# include 7 digits of the commit id in the changelog entry:
+id-length = 7
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..43270f2
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,35 @@
+#!/bin/sh
+# get source for snappy-java to enable stripping binaries without source
+
+COMPRESSION=xz
+
+set -e
+NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+
+if ! echo $@ | grep -q upstream-version ; then
+    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+else
+    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
+    if echo "$VERSION" | grep -q "upstream-version" ; then
+        echo "Unable to parse version number"
+        exit
+    fi
+fi
+
+mkdir -p ../tarballs
+cd ../tarballs
+TARNAME=`echo ${NAME} | sed 's/[.0-9]\+-java/-java/'`-${VERSION}
+mv ../${TARNAME}.tar.gz .
+
+tar -xaf ${TARNAME}.tar.gz
+
+# Remove native libraries for different OSes which are not needed because we link
+# against Debian packaged libraries
+rm -rf ${TARNAME}/src/main/resources/org/xerial/snappy/native
+
+# Remove lib/ directory which was also stripped by Charles Plessy before and seems to be unneeded
+rm -rf ${TARNAME}/lib
+
+mv ${TARNAME} "${NAME}-${VERSION}"
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION"~dfsg.orig.tar.${COMPRESSION} "${NAME}-${VERSION}"
+rm -rf "${NAME}-$VERSION"
diff --git a/debian/libsnappy-java.poms b/debian/libsnappy-java.poms
new file mode 100644
index 0000000..4c16dce
--- /dev/null
+++ b/debian/libsnappy-java.poms
@@ -0,0 +1,28 @@
+# 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
diff --git a/debian/links b/debian/links
new file mode 100644
index 0000000..2c76bea
--- /dev/null
+++ b/debian/links
@@ -0,0 +1 @@
+/usr/share/maven-repo/org/xerial/snappy/snappy-java/1.0.3.3/snappy-java-1.0.3.3.jar	/usr/share/java/snappy1.0.3-java.jar
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
new file mode 100644
index 0000000..d75bacf
--- /dev/null
+++ b/debian/maven.ignoreRules
@@ -0,0 +1,24 @@
+# Maven ignore rules - ignore some Maven dependencies and plugins
+# Format of this file is:
+# [group] [artifact] [type] [version] [classifier] [scope]
+# where each element can be either
+# - the exact string, for example org.apache for the group, or 3.1
+#   for the version. In this case, the element is simply matched
+#   and left as it is
+# - * (the star character, alone). In this case, anything will
+#   match and be left as it is. For example, using * on the
+#  position of the artifact field will match any artifact id
+# All elements much match before a rule can be applied
+# Example rule: match jar with groupid= junit, artifactid= junit
+# and version starting with 3., this dependency is then removed
+# from the POM
+#   junit junit jar s/3\\..*/3.x/
+
+junit junit * * * *
+org.apache.maven.plugins maven-assembly-plugin * * * *
+org.apache.maven.plugins maven-javadoc-plugin * * * *
+org.apache.maven.plugins maven-release-plugin * * * *
+org.apache.maven.plugins maven-source-plugin * * * *
+org.apache.maven.wagon wagon-ssh-external * * * *
+org.codehaus.plexus plexus-classworlds * * * *
+org.xerial xerial-core * * * *
diff --git a/debian/maven.properties b/debian/maven.properties
new file mode 100644
index 0000000..e593715
--- /dev/null
+++ b/debian/maven.properties
@@ -0,0 +1,5 @@
+# Include here properties to pass to Maven during the build.
+# For example:
+# maven.test.skip=true
+
+maven.test.skip=true
diff --git a/debian/maven.rules b/debian/maven.rules
new file mode 100644
index 0000000..46ba2d1
--- /dev/null
+++ b/debian/maven.rules
@@ -0,0 +1,20 @@
+# Maven rules - transform Maven dependencies and plugins
+# Format of this file is:
+# [group] [artifact] [type] [version] [classifier] [scope]
+# where each element can be either
+# - the exact string, for example org.apache for the group, or 3.1
+#   for the version. In this case, the element is simply matched
+#   and left as it is
+# - * (the star character, alone). In this case, anything will
+#   match and be left as it is. For example, using * on the
+#  position of the artifact field will match any artifact id
+# - a regular expression of the form s/match/replace/
+#   in this case, elements that match are transformed using
+#   the regex rule.
+# All elements much match before a rule can be applied
+# Example rule: match jar with groupid= junit, artifactid= junit
+# and version starting with 3., replacing the version with 3.x
+#   junit junit jar s/3\\..*/3.x/
+
+org.osgi s/core/org.osgi.core/ jar s/.*/debian/ * *
+org.xerial.snappy snappy-java bundle s/.*/debian/ * *
diff --git a/debian/patches/add_missing_file.patch b/debian/patches/add_missing_file.patch
new file mode 100644
index 0000000..4a4c245
--- /dev/null
+++ b/debian/patches/add_missing_file.patch
@@ -0,0 +1,247 @@
+--- /dev/null
++++ snappy-java/src/main/java/org/xerial/snappy/LoadSnappy.java
+@@ -0,0 +1,244 @@
++/*--------------------------------------------------------------------------
++ *  Copyright 2011 Taro L. Saito
++ *
++ *  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.
++ *--------------------------------------------------------------------------*/
++//--------------------------------------
++// snappy-java Project
++//
++// LoadSnappy.java
++// Since: 2011/03/29
++//
++// $URL$ 
++// $Author$
++//--------------------------------------
++package org.xerial.snappy;
++
++import java.io.BufferedInputStream;
++import java.io.ByteArrayOutputStream;
++import java.io.File;
++import java.io.FileInputStream;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.InputStream;
++import java.net.URL;
++import java.security.DigestInputStream;
++import java.security.MessageDigest;
++import java.security.NoSuchAlgorithmException;
++import java.util.Properties;
++
++/**
++ * This class loads a native library of Snappy according to the platform of the
++ * user.
++ * 
++ * @author leo
++ * 
++ */
++public class LoadSnappy
++{
++    private static boolean isLoaded = false;
++
++    public static boolean load() {
++        if (!isLoaded) {
++            loadSnappyNativeLibrary();
++        }
++        return isLoaded;
++    }
++
++    /**
++     * Computes the MD5 value of the input stream
++     * 
++     * @param input
++     * @return
++     * @throws IOException
++     * @throws NoSuchAlgorithmException
++     */
++    static String md5sum(InputStream input) throws IOException {
++        BufferedInputStream in = new BufferedInputStream(input);
++
++        try {
++            MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
++            DigestInputStream digestInputStream = new DigestInputStream(in, digest);
++            for (; digestInputStream.read() >= 0;) {
++
++            }
++            ByteArrayOutputStream md5out = new ByteArrayOutputStream();
++            md5out.write(digest.digest());
++            return md5out.toString();
++        }
++        catch (NoSuchAlgorithmException e) {
++            throw new IllegalStateException("MD5 algorithm is not available: " + e);
++        }
++        finally {
++            in.close();
++        }
++    }
++
++    /**
++     * Extract the specified library file to the target folder
++     * 
++     * @param libFolderForCurrentOS
++     * @param libraryFileName
++     * @param targetFolder
++     * @return
++     */
++    private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, String libraryFileName,
++            String targetFolder) {
++        String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
++        final String prefix = "snappy-" + getVersion() + "-";
++
++        String extractedLibFileName = prefix + libraryFileName;
++        File extractedLibFile = new File(targetFolder, extractedLibFileName);
++
++        try {
++            if (extractedLibFile.exists()) {
++                // test md5sum value
++                String md5sum1 = md5sum(LoadSnappy.class.getResourceAsStream(nativeLibraryFilePath));
++                String md5sum2 = md5sum(new FileInputStream(extractedLibFile));
++
++                if (md5sum1.equals(md5sum2)) {
++                    return loadNativeLibrary(targetFolder, extractedLibFileName);
++                }
++                else {
++                    // remove old native library file
++                    boolean deletionSucceeded = extractedLibFile.delete();
++                    if (!deletionSucceeded) {
++                        throw new IOException("failed to remove existing native library file: "
++                                + extractedLibFile.getAbsolutePath());
++                    }
++                }
++            }
++
++            // extract file into the current directory
++            InputStream reader = LoadSnappy.class.getResourceAsStream(nativeLibraryFilePath);
++            FileOutputStream writer = new FileOutputStream(extractedLibFile);
++            byte[] buffer = new byte[1024];
++            int bytesRead = 0;
++            while ((bytesRead = reader.read(buffer)) != -1) {
++                writer.write(buffer, 0, bytesRead);
++            }
++
++            writer.close();
++            reader.close();
++
++            if (!System.getProperty("os.name").contains("Windows")) {
++                try {
++                    Runtime.getRuntime().exec(new String[] { "chmod", "755", extractedLibFile.getAbsolutePath() })
++                            .waitFor();
++                }
++                catch (Throwable e) {}
++            }
++
++            return loadNativeLibrary(targetFolder, extractedLibFileName);
++        }
++        catch (IOException e) {
++            System.err.println(e.getMessage());
++            return false;
++        }
++
++    }
++
++    private static synchronized boolean loadNativeLibrary(String path, String name) {
++        File libPath = new File(path, name);
++        if (libPath.exists()) {
++
++            try {
++                System.load(new File(path, name).getAbsolutePath());
++                return true;
++            }
++            catch (UnsatisfiedLinkError e) {
++                throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, e);
++            }
++
++        }
++        else
++            return false;
++    }
++
++    private static void loadSnappyNativeLibrary() {
++        if (isLoaded)
++            return;
++
++        // Try loading the library from org.xerial.snappy.lib.path library path */
++        String snappyNativeLibraryPath = System.getProperty("org.xerial.snappy.lib.path");
++        String snappyNativeLibraryName = System.getProperty("org.xerial.snappy.lib.name");
++
++        // Resolve the library file name with a suffix (e.g., dll, .so, etc.) 
++        if (snappyNativeLibraryName == null)
++            snappyNativeLibraryName = System.mapLibraryName("snappy");
++
++        if (snappyNativeLibraryPath != null) {
++            if (loadNativeLibrary(snappyNativeLibraryPath, snappyNativeLibraryName)) {
++                isLoaded = true;
++                return;
++            }
++        }
++
++        // Load the os-dependent library from a jar file
++        snappyNativeLibraryPath = "/org/xerial/snappy/native/" + OSInfo.getNativeLibFolderPathForCurrentOS();
++
++        if (LoadSnappy.class.getResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName) == null) {
++            // use nested VM version
++            return;
++        }
++
++        // Temporary library folder. Use the value of java.io.tmpdir 
++        String tempFolder = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath();
++        // Try extracting the library from jar 
++        if (extractAndLoadLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder)) {
++            isLoaded = true;
++            return;
++        }
++
++        isLoaded = false;
++        return;
++    }
++
++    private static void getNativeLibraryFolderForTheCurrentOS() {
++        String osName = OSInfo.getOSName();
++        String archName = OSInfo.getArchName();
++
++    }
++
++    public static int getMajorVersion() {
++        String[] c = getVersion().split("\\.");
++        return (c.length > 0) ? Integer.parseInt(c[0]) : 1;
++    }
++
++    public static int getMinorVersion() {
++        String[] c = getVersion().split("\\.");
++        return (c.length > 1) ? Integer.parseInt(c[1]) : 0;
++    }
++
++    public static String getVersion() {
++
++        URL versionFile = LoadSnappy.class.getResource("/META-INF/maven/org.xerial.snappy/snappy-java/pom.properties");
++        if (versionFile == null)
++            versionFile = LoadSnappy.class.getResource("/META-INF/maven/org.xerial.snappy/snappy-java/VERSION");
++
++        String version = "unknown";
++        try {
++            if (versionFile != null) {
++                Properties versionData = new Properties();
++                versionData.load(versionFile.openStream());
++                version = versionData.getProperty("version", version);
++                version = version.trim().replaceAll("[^0-9\\.]", "");
++            }
++        }
++        catch (IOException e) {
++            System.err.println(e);
++        }
++        return version;
++    }
++
++}
diff --git a/debian/patches/replace_OSInfo_by_dpkg-architecture.patch b/debian/patches/replace_OSInfo_by_dpkg-architecture.patch
new file mode 100644
index 0000000..285ed6a
--- /dev/null
+++ b/debian/patches/replace_OSInfo_by_dpkg-architecture.patch
@@ -0,0 +1,38 @@
+Description: replace calls to OSInfo.class by calls to dpkg-architecture.
+ The ‘lib’ directory is removed from this package, see ‘debian/README.source’.
+Author: Charles Plessy <plessy at debian.org>
+Forwarded: not-needed
+diff --git a/Makefile.common b/Makefile.common
+index f4a3fdd..991c5e0 100644
+--- a/Makefile.common
++++ b/Makefile.common
+@@ -11,17 +11,9 @@ JAVA  := "$$JAVA_HOME/bin/java"
+ JAVAC := "$$JAVA_HOME/bin/javac" 
+ JAVAH := "$$JAVA_HOME/bin/javah"
+ 
+-OSINFO_CLASS := org.xerial.snappy.OSInfo
+-OSINFO_PROG := lib/org/xerial/snappy/OSInfo.class
+-
+-## building OSInfo.java 
+-#$(info compiling OSInfo.java)
+-#$(shell mkdir -p lib)
+-#$(shell $(JAVAC) src/main/java/org/sqlite/OSInfo.java -d lib)
+-
+-OS_NAME := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --os)
+-OS_ARCH := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --arch)
+-LIB_FOLDER := $(shell $(JAVA) -cp lib $(OSINFO_CLASS))
++OS_NAME := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
++OS_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
++LIB_FOLDER := $(OS_NAME)/$(OS_ARCH)
+ 
+ # Windows uses different path separators
+ ifeq ($(OS_NAME),Windows)
+@@ -41,7 +33,7 @@ endif
+ 
+ # os=Default is meant to be generic unix/linux
+ 
+-known_os_archs := Linux-i386 Linux-amd64 Mac-i386 Mac-x86_64 Windows-x86 Windows-amd64
++known_os_archs := linux-i386 linux-amd64 Mac-i386 Mac-x86_64 Windows-x86 Windows-amd64
+ os_arch := $(OS_NAME)-$(OS_ARCH)
+ 
+ ifeq (,$(findstring $(strip $(os_arch)),$(known_os_archs)))
diff --git a/debian/patches/replace_silk-weaver_by_xml_grep.patch b/debian/patches/replace_silk-weaver_by_xml_grep.patch
new file mode 100644
index 0000000..2226097
--- /dev/null
+++ b/debian/patches/replace_silk-weaver_by_xml_grep.patch
@@ -0,0 +1,18 @@
+Description: Replace silk-weaver.jar by xml_grep from the xml-twig-tools package.
+ No sources are included for silk-weaver.jar, it is therefore deleted from the
+ Debian source package.
+Author: Charles Plessy <plessy at debian.org>
+Forwarded: why not ?
+diff --git a/Makefile b/Makefile
+index 7ad5cc6..2c65c55 100644
+--- a/Makefile
++++ b/Makefile
+@@ -62,7 +62,7 @@ NATIVE_DIR:=src/main/resources/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
+ NATIVE_TARGET_DIR:=$(TARGET)/classes/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
+ NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME)
+ 
+-snappy-jar-version:=snappy-java-$(shell $(JAVA) -jar lib/silk-weaver.jar find 'project(artifactId, version)' pom.xml | grep snappy-java | awk '{ print $$2; }')
++snappy-jar-version:=snappy-java-$(shell xml_grep --text_only "/project/version" pom.xml)
+ 
+ native: $(SNAPPY_UNPACKED) $(NATIVE_DLL) 
+ snappy: native $(TARGET)/$(snappy-jar-version).jar
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b9d996f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+replace_silk-weaver_by_xml_grep.patch
+replace_OSInfo_by_dpkg-architecture.patch
+use_debian_packaged_libsnappy.patch
diff --git a/debian/patches/use_debian_packaged_libsnappy.patch b/debian/patches/use_debian_packaged_libsnappy.patch
new file mode 100644
index 0000000..95c76d4
--- /dev/null
+++ b/debian/patches/use_debian_packaged_libsnappy.patch
@@ -0,0 +1,17 @@
+Author: Andreas Tille <tille at debian.org>
+Date: Sat, 28 Jan 2012 14:14:01 +0100
+Description: Use Debian packaged libsnappy (hopefully)
+
+--- snappy-java-1.0.4.1.orig/Makefile
++++ snappy-java-1.0.4.1/Makefile
+@@ -58,8 +58,8 @@
+ clean:
+ 	rm -rf $(TARGET)
+ 
+-NATIVE_DIR:=src/main/resources/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
+-NATIVE_TARGET_DIR:=$(TARGET)/classes/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
++NATIVE_DIR:=/usr/lib
++NATIVE_TARGET_DIR:=$(TARGET)/usr/lib
+ NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME)
+ 
+ snappy-jar-version:=snappy-java-$(shell xml_grep --text_only "/project/version" pom.xml)
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..6038731
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/maven.mk
+
+JAVA_HOME := /usr/lib/jvm/default-java
+
+get-orig-source:
+	uscan --verbose --force-download
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..f1541d3
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts=dversionmangle=s/\~dfsg// \
+ http://code.google.com/p/snappy-java/downloads/list?can=1 \
+  .*/snappy-java-(1.0.3[\d\.]+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))|zip) \
+ debian debian/get-orig-source

-- 
Packaging of a version of snappy-kava that works together with picard-tools



More information about the debian-med-commit mailing list