Source: libssh2
Version: 1.2.8-2
Severity: normal
Tags: patch
Usertags: multiarch

Hi,

The following patch converts libssh2 to support multi-arch. Summary of
changes:
- Makefile.am: install libssh2.pc to /usr/share/pkgconfig instead of
  /usr/lib/pkgconfig. According to the pkg-config manual, both locations
  are valid. On the other hand, the installation path in Makefile.am
  used to be dependent on $(libdir), which is modified in an
  incompatible way by multi-arch.
- debian/rules: set libdir for multiarch
- debian/*.install: adapt to changed paths
- debian/control: add required dependencies and pre-depends, as well as
  multi-arch stanzas.
  
-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -urN libssh2-1.2.8/debian/changelog libssh2-1.2.8-new/debian/changelog
--- libssh2-1.2.8/debian/changelog	2011-08-14 21:42:38.000000000 +0200
+++ libssh2-1.2.8-new/debian/changelog	2012-03-13 20:29:58.000000000 +0100
@@ -1,3 +1,9 @@
+libssh2 (1.2.8-2.1) karotte-local; urgency=low
+
+  * Update to multi-arch.
+
+ -- Johannes Kloos <jkl...@unix-ag.uni-kl.de>  Tue, 13 Mar 2012 20:20:00 +0100
+
 libssh2 (1.2.8-2) unstable; urgency=low
 
   * Fix version in pkg-config file (Closes: #637670).
diff -urN libssh2-1.2.8/debian/control libssh2-1.2.8-new/debian/control
--- libssh2-1.2.8/debian/control	2011-03-28 20:47:55.000000000 +0200
+++ libssh2-1.2.8-new/debian/control	2012-03-13 20:33:05.000000000 +0100
@@ -2,12 +2,14 @@
 Section: libs
 Priority: optional
 Maintainer: Mikhail Gusarov <dotted...@debian.org>
-Build-Depends: debhelper (>= 7), autotools-dev, automake, libtool, libgcrypt11-dev, zlib1g-dev
+Build-Depends: debhelper (>= 8.1.3), autotools-dev, automake, libtool, libgcrypt11-dev, zlib1g-dev
 Standards-Version: 3.9.1
 
 Package: libssh2-1
 Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Multi-Arch: same
 Description: SSH2 client-side library
  libssh2 is a client-side C library implementing the SSH2 protocol.
  It supports regular terminal, SCP and SFTP sessions; port forwarding;
diff -urN libssh2-1.2.8/debian/libssh2-1-dev.install libssh2-1.2.8-new/debian/libssh2-1-dev.install
--- libssh2-1.2.8/debian/libssh2-1-dev.install	2010-06-10 12:23:31.000000000 +0200
+++ libssh2-1.2.8-new/debian/libssh2-1-dev.install	2012-03-13 20:21:48.000000000 +0100
@@ -1,4 +1,4 @@
 usr/include/*
-usr/lib/*.a
-usr/lib/*.so
-usr/lib/pkgconfig/*.pc
+usr/lib/*/*.a
+usr/lib/*/*.so
+usr/share/pkgconfig/*.pc
diff -urN libssh2-1.2.8/debian/libssh2-1.install libssh2-1.2.8-new/debian/libssh2-1.install
--- libssh2-1.2.8/debian/libssh2-1.install	2010-06-10 12:23:31.000000000 +0200
+++ libssh2-1.2.8-new/debian/libssh2-1.install	2012-03-13 20:21:52.000000000 +0100
@@ -1 +1 @@
-usr/lib/*.so.*
+usr/lib/*/*.so.*
diff -urN libssh2-1.2.8/debian/patches/save-pkgconfig-data-in-usr-share libssh2-1.2.8-new/debian/patches/save-pkgconfig-data-in-usr-share
--- libssh2-1.2.8/debian/patches/save-pkgconfig-data-in-usr-share	1970-01-01 01:00:00.000000000 +0100
+++ libssh2-1.2.8-new/debian/patches/save-pkgconfig-data-in-usr-share	2012-03-13 20:24:51.000000000 +0100
@@ -0,0 +1,33 @@
+Description: Move the pkg-config .pc file to /usr/share/pkgconfig
+  Move the pkgconfig .pc file to /usr/share/pkgconfig. Since this file
+  is architecture-independent, this is actually the proper place.
+  Furthermore, since libdir has been redefined by multi-arch, but
+  the pkgconfig data is expected in /usr/lib/pkgconfig and not a
+  multi-arch subdirectory, this new location makes more sense.
+
+Author: Johannes Kloos <jkl...@unix-ag.uni-kl.de>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- libssh2-1.2.8.orig/Makefile.am
++++ libssh2-1.2.8/Makefile.am
+@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
+ 
+ SUBDIRS = src example tests docs
+ 
+-pkgconfigdir = $(libdir)/pkgconfig
++pkgconfigdir = $(datarootdir)/pkgconfig
+ pkgconfig_DATA = libssh2.pc
+ 
+ include_HEADERS =			\
diff -urN libssh2-1.2.8/debian/patches/series libssh2-1.2.8-new/debian/patches/series
--- libssh2-1.2.8/debian/patches/series	2011-08-14 12:00:57.000000000 +0200
+++ libssh2-1.2.8-new/debian/patches/series	2012-03-13 20:23:16.000000000 +0100
@@ -1,2 +1,3 @@
 fix-version-in-pc.patch
 man-wrong-nf-macro.patch
+save-pkgconfig-data-in-usr-share
diff -urN libssh2-1.2.8/debian/rules libssh2-1.2.8-new/debian/rules
--- libssh2-1.2.8/debian/rules	2010-06-10 12:23:31.000000000 +0200
+++ libssh2-1.2.8-new/debian/rules	2012-03-13 20:22:51.000000000 +0100
@@ -2,6 +2,7 @@
 
 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 CFLAGS = -Wall -g
 
@@ -65,7 +66,8 @@
 	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
 		--build=$(DEB_BUILD_GNU_TYPE) \
 		--prefix=/usr \
-		--with-libgcrypt
+		--with-libgcrypt \
+		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
 
 build: build-stamp
 build-stamp: config.status

Reply via email to