[snappy-java] 21/51: Finally commit suggested patch to use Debian packaged library; Use get-orig-source script to strip unneeded native libraries: Remark: Also dir lib/ is removed from tarball - it seems this was done by Charles Plessy as well.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Tue Nov 25 17:16:44 GMT 2014


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

ebourg-guest pushed a commit to branch master
in repository snappy-java.

commit a0d0e8f77efc4bc7a1b3497e213fb436bdad9062
Author: Andreas Tille <tille at debian.org>
Date:   Wed Feb 1 09:16:52 2012 +0100

    Finally commit suggested patch to use Debian packaged library;
    Use get-orig-source script to strip unneeded native libraries:
    Remark: Also dir lib/ is removed from tarball - it seems this was done
            by Charles Plessy as well.
---
 debian/get-orig-source                             | 31 ++++++++++++++++++++++
 debian/patches/use_debian_packaged_libsnappy.patch | 17 ++++++++++++
 debian/watch                                       |  3 ++-
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..47c789d
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,31 @@
+#!/bin/sh
+# get source for snappy-java to enable stripping binaries without source
+
+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
+mv ../${NAME}-${VERSION}.tar.gz .
+
+tar -xzf ${NAME}-${VERSION}.tar.gz
+
+# Remove native libraries for different OSes which are not needed because we link
+# against Debian packaged libraries
+rm -rf ${NAME}-${VERSION}/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 ${NAME}-${VERSION}/lib
+
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -czf "$NAME"_"$VERSION".orig.tar.gz "${NAME}-${VERSION}"
+rm -rf "${NAME}-$VERSION"
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/watch b/debian/watch
index 259d923..48767e0 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,3 @@
 version=3
-http://googlecode.debian.net/p/snappy-java/snappy-java-(.*).tar.gz
+http://googlecode.debian.net/p/snappy-java/snappy-java-(.*).tar.gz \
+ debian debian/get-orig-source

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/snappy-java.git



More information about the pkg-java-commits mailing list