diff mbox

please add multi-arch support for gmp

Message ID 20110823104957.GB15357@afflict.kos.to
State Accepted
Headers show

Commit Message

Riku Voipio Aug. 23, 2011, 10:49 a.m. UTC
Package: gmp
Version: 2:5.0.1+dfsg-7
Severity: normal
User: debian-dpkg@lists.debian.org
Usertags: multiarch
Tags: patch

Hi,

The attached patch converts gmp to multiarch paths 
and adds the relevant Multi-Arch: fields to debian/control.

Since gmp is bottom dependency installed by default when installing
toolchain, we need a early conversion of gmp to be able to take advantage
of multiarch.

Riku
diff mbox

Patch

diff -urN orig/gmp-5.0.1+dfsg//debian/control gmp-5.0.1+dfsg//debian/control
--- orig/gmp-5.0.1+dfsg//debian/control	2011-08-23 11:19:30.000000000 +0300
+++ gmp-5.0.1+dfsg//debian/control	2011-08-23 11:44:06.914692001 +0300
@@ -2,7 +2,7 @@ 
 Homepage: http://gmplib.org/
 Section: libs
 Priority: optional
-Build-Depends: m4, debhelper (>= 7), quilt, gcc-multilib [amd64 kfreebsd-amd64 powerpc ppc64], g++-multilib [amd64 kfreebsd-amd64 powerpc ppc64]
+Build-Depends: m4, debhelper (>= 8.1.3), quilt, gcc-multilib [amd64 kfreebsd-amd64 powerpc ppc64], g++-multilib [amd64 kfreebsd-amd64 powerpc ppc64]
 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
 XSBC-Original-Maintainer: Debian Scientific Computing Team <pkg-scicomp-devel@lists.alioth.debian.org>
 Uploaders: Steve M. Robbins <smr@debian.org>
@@ -15,6 +15,8 @@ 
 Priority: optional
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Description: Multiprecision arithmetic library
  GNU MP is a programmer's library for arbitrary precision
  arithmetic (ie, a bignum package).  It can operate on signed
@@ -28,6 +30,8 @@ 
 Priority: optional
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Conflicts: libgmp3, libgmpxx4
 Replaces: libgmp3
 Description: Multiprecision arithmetic library (C++ bindings)
@@ -40,6 +44,7 @@ 
 Priority: optional
 Architecture: any
 Depends: libgmp10 (= ${binary:Version}), libgmpxx4ldbl (= ${binary:Version}), ${misc:Depends}
+Multi-Arch: same
 Provides: libgmp10-dev
 Conflicts: libgmp3-dev (<< 5.0.1), libgmp10-dev
 Replaces: libgmp3-dev, libgmp10-dev
diff -urN orig/gmp-5.0.1+dfsg//debian/rules gmp-5.0.1+dfsg//debian/rules
--- orig/gmp-5.0.1+dfsg//debian/rules	2011-08-23 11:19:30.000000000 +0300
+++ gmp-5.0.1+dfsg//debian/rules	2011-08-23 11:58:22.764692001 +0300
@@ -18,6 +18,7 @@ 
 DEB_HOST_ARCH  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 export DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 MAKE_CHECK = : disabled make check
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
@@ -82,6 +83,8 @@ 
   MAKE_CHECK = : disabled make check
 endif
 
+confflags_ma = $(confflags) --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+
 CC   = $(DEB_HOST_GNU_TYPE)-gcc
 CC32 = $(DEB_HOST_GNU_TYPE)-gcc $(m32)
 CC64 = $(DEB_HOST_GNU_TYPE)-gcc $(m64)
@@ -112,7 +115,7 @@ 
 configure: patch configure-stamp
 configure-stamp:
 	mkdir -p build
-	cd build && ../configure $(confflags) \
+	cd build && ../configure $(confflags_ma) \
 	    AR=$(AR) CC="$(CC)" CFLAGS="$(CFLAGS)" \
 	    CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"
 	CC="$(DEB_HOST_GNU_TYPE)-gcc" sh debian/fix-gmp-h.sh build
@@ -174,14 +177,14 @@ 
 install: build-stamp install-prep
 	$(MAKE) DESTDIR=`pwd`/debian/tmp -C build install
 
-	dh_install -plibgmp10 usr/lib/libgmp.so.*
-	dh_install -plibmp3 usr/lib/libmp.so.*
+	dh_install -plibgmp10 usr/lib/*/libgmp.so.*
+	dh_install -plibmp3 usr/lib/*/libmp.so.*
 
-	dh_install -plibgmpxx4ldbl usr/lib/libgmpxx.so.*
+	dh_install -plibgmpxx4ldbl usr/lib/*/libgmpxx.so.*
 
-	dh_install -plibgmp-dev usr/lib/lib*.so
-	dh_install -plibgmp-dev usr/lib/lib*.a
-	dh_install -plibgmp-dev usr/lib/lib*.la
+	dh_install -plibgmp-dev usr/lib/*/lib*.so
+	dh_install -plibgmp-dev usr/lib/*/lib*.a
+	dh_install -plibgmp-dev usr/lib/*/lib*.la
 	dh_install -plibgmp-dev usr/include
 	dh_install -plibgmp-dev -Xgmp-mparam.h build/gmp*.h usr/include