]> andersk Git - nss_nonlocal.git/blame - debian/rules
Rewrite packaging with Debhelper 7
[nss_nonlocal.git] / debian / rules
CommitLineData
e9dcc028
AK
1#!/usr/bin/make -f
2
61375334 3DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
75b66003 4
61375334
AK
5# Work around http://bugs.debian.org/572077 (debhelper < 7.4.16)
6binary: binary-arch binary-indep ;
407b359f 7
61375334
AK
8%:
9 dh $@ --with autoreconf
75b66003 10
61375334
AK
11all_flavors = libnss-nonlocal
12libnss-nonlocal_configure_args += --prefix=/
13libnss-nonlocal_dh_install = 'lib/*'
21ca49e1 14
5eedad0d
AK
15ifneq ($(DEB_HOST_MULTIARCH),)
16 export DH_COMPAT = 9
61375334
AK
17 libnss-nonlocal_configure_args += --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)'
18 libnss-nonlocal_dh_install = 'lib/$(DEB_HOST_MULTIARCH)/*'
19 libnss-nonlocal_dh_gencontrol = -- -DMulti-Arch=same
20else ifeq ($(shell hash dpkg-buildflags 2>/dev/null && echo y),y)
21 all_configure_args += $(foreach var,CFLAGS CPPFLAGS LDFLAGS,"$(var)=$$(dpkg-buildflags --get $(var))")
5eedad0d
AK
22endif
23
3d60c2db 24IS_UBUNTU := $(if $(filter Ubuntu,$(shell lsb_release -is)),y)
21ca49e1 25LIBC6_VERSION := $(shell dpkg-query --showformat='$${Version}' --show libc6)
8e0165e3
AK
26libc6_ge = $(shell dpkg --compare-versions '$(LIBC6_VERSION)' ge '$(1)' && echo y)
27
61375334 28all_flavors += lib32nss-nonlocal
8e0165e3 29# i386_configure_target in eglibc/debian/sysdeps/amd64.mk
3d60c2db 30ifeq ($(or $(IS_UBUNTU),$(call libc6_ge,2.8+20080809)),y)
61375334 31lib32nss-nonlocal_configure_args += --build=i686-linux
5f228bb5 32else
61375334 33lib32nss-nonlocal_configure_args += --build=i486-linux
8e0165e3
AK
34endif
35# i386_CC in eglibc/debian/sysdeps/amd64.mk
61375334 36lib32nss-nonlocal_configure_args += CC='$(CC) -m32'
8e0165e3 37# i386_slibdir in eglibc/debian/sysdeps/amd64.mk
3d60c2db 38ifeq ($(or $(IS_UBUNTU),$(call libc6_ge,2.9-14~)),y)
61375334
AK
39lib32nss-nonlocal_configure_args += --prefix=/ --libdir='$${prefix}/lib32'
40lib32nss-nonlocal_dh_install = 'lib32/*'
8e0165e3 41else
61375334
AK
42lib32nss-nonlocal_configure_args += --prefix=/emul/ia32-linux
43lib32nss-nonlocal_dh_install = 'emul/ia32-linux/*'
5f228bb5
AK
44endif
45
61375334 46all_flavors += lib64nss-nonlocal
8e0165e3 47# amd64_configure_target in eglibc/debian/sysdeps/i386.mk
61375334 48lib64nss-nonlocal_configure_args += --build=x86_64-linux
8e0165e3 49# amd64_CC in eglibc/debian/sysdeps/i386.mk
61375334 50lib64nss-nonlocal_configure_args += CC='$(CC) -m64 -D__x86_64__'
8e0165e3 51# amd64_slibdir in eglibc/debian/sysdeps/i386.mk
61375334 52lib64nss-nonlocal_configure_args += --prefix=/ --libdir="\$${prefix}/lib64"
5f228bb5 53
61375334 54flavors := $(filter $(all_flavors),$(shell dh_listpackages))
5f228bb5 55
61375334
AK
56define do_overrides
57override_$(1): $(addsuffix _$(1),$(2))
58$(addsuffix _$(1),$(filter-out REMAINING,$(2))): %_$(1):
59 $(1) -p$$* $(3)
60REMAINING_$(1): $(addsuffix _$(1),$(filter-out REMAINING,$(2)))
61 $(1) --remaining-packages $(4)
5f228bb5 62
61375334 63endef
5f228bb5 64
61375334
AK
65$(eval $(foreach auto,configure build install test clean,$(call do_overrides,dh_auto_$(auto),$(flavors),-Bdebian/build_$$* -- $$(all_$(auto)_args) $$($$*_$(auto)_args))))
66$(eval $(call do_overrides,dh_install,$(flavors) REMAINING,$$($$*_dh_install)))
67$(eval $(call do_overrides,dh_gencontrol,libnss-nonlocal REMAINING,$$($$*_dh_gencontrol)))
This page took 0.086111 seconds and 5 git commands to generate.