Build with Multi-Arch support
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 28 Jun 2011 08:51:58 +0000 (10:51 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 28 Jun 2011 08:51:58 +0000 (10:51 +0200)
debian/changelog
debian/compat
debian/control
debian/lintian-overrides
debian/rules

index e3d4a4d..b0da451 100644 (file)
@@ -1,6 +1,7 @@
-libnss-gw-name (0.2-2) UNRELEASED; urgency=low
+libnss-gw-name (0.2.1-1) UNRELEASED; urgency=low
 
   * Fix typo in Homepage, thx to Tomas Pospisek for noticing (Closes: #574893)
+  * Build with Multi-Arch support 
 
  -- Joachim Breitner <nomeata@debian.org>  Sun, 21 Mar 2010 23:40:54 +0100
 
index 7f8f011..45a4fb7 100644 (file)
@@ -1 +1 @@
-7
+8
index 500618f..e0b1c45 100644 (file)
@@ -3,11 +3,9 @@ Section: admin
 Priority: extra
 Maintainer: Joachim Breitner <nomeata@debian.org>
 Build-Depends:
-  debhelper (>= 7),
+  debhelper (>= 8.1.3),
   pkg-config,
   libnl-dev,
-# Disable multilib until libnl supports it
-# gcc-multilib [sparc i386 kfreebsd-amd64 amd64 mips mipsel powerpc s390]
 Standards-Version: 3.8.4
 Homepage: http://www.joachim-breitner.de/projects#libnss-gw-name
 VCS-Git: git://git.nomeata.de/libnss-gw-name.git
@@ -16,8 +14,9 @@ VCS-Browser: http://git.nomeata.de/?p=libnss-gw-name.git
 
 Package: libnss-gw-name
 Architecture: linux-any
+Multi-Arch: same
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: ${alternatelibs:Suggests}
+Pre-Depends: ${misc:Pre-Depends}
 Description: nss module that names the current gateway’s IP address
  This Name Service Switch (NSS) module resolves the name “gateway.localhost” to
  the IP of the current default gateways of the system. This allows easy access
index 98a1bcf..ef2b266 100644 (file)
@@ -1,7 +1 @@
 libnss-gw-name: package-name-doesnt-match-sonames libnss-gw-name2
-libnss-gw-name: no-shlibs-control-file usr/lib/libnss_gw_name.so.2
-libnss-gw-name: no-shlibs-control-file usr/lib64/libnss_gw_name.so.2
-libnss-gw-name: no-shlibs-control-file usr/lib32/libnss_gw_name.so.2
-libnss-gw-name: no-symbols-control-file usr/lib64/libnss_gw_name.so.2
-libnss-gw-name: no-symbols-control-file usr/lib32/libnss_gw_name.so.2
-libnss-gw-name: no-symbols-control-file usr/lib/libnss_gw_name.so.2
index c3d4258..14dad24 100755 (executable)
@@ -3,8 +3,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 CFLAGS = -Wall -g -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
@@ -15,48 +15,14 @@ endif
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
         MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 endif
-ALSODO =
-# life would be to simple if there was something to work everywhere....
-ABIFLAG_32=-m32
-ABIFLAG_64=-m64
 
-# Disable until we have multilib support in libnl
-ifeq (dis,abled)
-# do not forget to update Build-depends when changing something here:
-ifeq ($(DEB_HOST_ARCH),sparc)
-ALSODO = 64
-else ifeq ($(DEB_HOST_ARCH),i386)
-ALSODO = 64
-else ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
-ALSODO = 32
-else ifeq ($(DEB_HOST_ARCH),amd64)
-ALSODO = 32
-else ifeq ($(DEB_HOST_ARCH),mips)
-ABIFLAG_32=-mabi=n32
-ABIFLAG_64=-mabi=64
-ALSODO = 64 32
-else ifeq ($(DEB_HOST_ARCH),mipsel)
-ABIFLAG_32=-mabi=n32
-ABIFLAG_64=-mabi=64
-ALSODO = 64 32
-else ifeq ($(DEB_HOST_ARCH),powerpc)
-ALSODO = 64
-else ifeq ($(DEB_HOST_ARCH),s390)
-ALSODO = 64
-endif
-endif
-
-build-arch: build-arch-stamp $(foreach bits,$(ALSODO),build-arch-$(bits)-stamp)
+build-arch: build-arch-stamp
 build-indep:
 build: build-arch-stamp
 
-build-arch-%-stamp:
-       $(MAKE) BITSOFS=$* CC="$(DEB_HOST_GNU_TYPE)-gcc" CFLAGS="$(ABIFLAG_$*) $(CFLAGS)"
-       touch $@
-
 build-arch-stamp:
        dh_testdir
-       $(MAKE) CC="$(DEB_HOST_GNU_TYPE)-gcc" CFLAGS="$(CFLAGS)"
+       $(MAKE) CFLAGS="$(CFLAGS)"
        touch build-arch-stamp
 
 clean:
@@ -79,20 +45,14 @@ binary-arch: build-arch
        dh_testroot
        dh_prep
        dh_installdirs
-       $(MAKE) install DESTDIR=$(CURDIR)/debian/libnss-gw-name
-       for also in $(ALSODO) ; do \
-               $(MAKE) BITSOFS=$${also} install DESTDIR=$(CURDIR)/debian/libnss-gw-name ; \
-       done
+       $(MAKE) install libprefix=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) DESTDIR=$(CURDIR)/debian/libnss-gw-name
        dh_lintian
        dh_installchangelogs
        dh_installdocs
        dh_link
        dh_strip
-       [ "$(ALSODO)" = "" ] || \
-         dpkg-shlibdeps -Tdebian/libnss-gw-name.substvars \
-           -palternatelibs -dSuggests \
-           $(foreach bits,$(ALSODO), debian/libnss-gw-name/usr/lib$(bits)/$(LIBNAME))
-       dh_shlibdeps $(foreach bits,$(ALSODO), -X/usr/lib$(bits)/$(LIBNAME))
+       dh_makeshlibs
+       dh_shlibdeps
        dh_compress
        dh_fixperms
        dh_installdeb