[22686] | 1 | #!/usr/bin/make -f |
---|
| 2 | |
---|
[26035] | 3 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
---|
[23113] | 4 | |
---|
[26035] | 5 | # Work around http://bugs.debian.org/572077 (debhelper < 7.4.16) |
---|
| 6 | binary: binary-arch binary-indep ; |
---|
[25083] | 7 | |
---|
[26035] | 8 | %: |
---|
| 9 | dh $@ --with autoreconf |
---|
[22686] | 10 | |
---|
[26035] | 11 | all_flavors = libnss-nonlocal |
---|
| 12 | libnss-nonlocal_configure_args += --prefix=/ |
---|
| 13 | libnss-nonlocal_dh_install = 'lib/*' |
---|
[23113] | 14 | |
---|
[25083] | 15 | ifneq ($(DEB_HOST_MULTIARCH),) |
---|
| 16 | export DH_COMPAT = 9 |
---|
[26035] | 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 |
---|
| 20 | else 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))") |
---|
[25083] | 22 | endif |
---|
| 23 | |
---|
[24755] | 24 | IS_UBUNTU := $(if $(filter Ubuntu,$(shell lsb_release -is)),y) |
---|
[23450] | 25 | LIBC6_VERSION := $(shell dpkg-query --showformat='$${Version}' --show libc6) |
---|
[24585] | 26 | libc6_ge = $(shell dpkg --compare-versions '$(LIBC6_VERSION)' ge '$(1)' && echo y) |
---|
| 27 | |
---|
[26035] | 28 | all_flavors += lib32nss-nonlocal |
---|
[24585] | 29 | # i386_configure_target in eglibc/debian/sysdeps/amd64.mk |
---|
[24755] | 30 | ifeq ($(or $(IS_UBUNTU),$(call libc6_ge,2.8+20080809)),y) |
---|
[26035] | 31 | lib32nss-nonlocal_configure_args += --build=i686-linux |
---|
[24585] | 32 | else |
---|
[26035] | 33 | lib32nss-nonlocal_configure_args += --build=i486-linux |
---|
[24585] | 34 | endif |
---|
| 35 | # i386_CC in eglibc/debian/sysdeps/amd64.mk |
---|
[26035] | 36 | lib32nss-nonlocal_configure_args += CC='$(CC) -m32' |
---|
[24585] | 37 | # i386_slibdir in eglibc/debian/sysdeps/amd64.mk |
---|
[24755] | 38 | ifeq ($(or $(IS_UBUNTU),$(call libc6_ge,2.9-14~)),y) |
---|
[26035] | 39 | lib32nss-nonlocal_configure_args += --prefix=/ --libdir='$${prefix}/lib32' |
---|
| 40 | lib32nss-nonlocal_dh_install = 'lib32/*' |
---|
[23880] | 41 | else |
---|
[26035] | 42 | lib32nss-nonlocal_configure_args += --prefix=/emul/ia32-linux |
---|
| 43 | lib32nss-nonlocal_dh_install = 'emul/ia32-linux/*' |
---|
[23880] | 44 | endif |
---|
| 45 | |
---|
[26035] | 46 | all_flavors += lib64nss-nonlocal |
---|
[24585] | 47 | # amd64_configure_target in eglibc/debian/sysdeps/i386.mk |
---|
[26035] | 48 | lib64nss-nonlocal_configure_args += --build=x86_64-linux |
---|
[24585] | 49 | # amd64_CC in eglibc/debian/sysdeps/i386.mk |
---|
[26035] | 50 | lib64nss-nonlocal_configure_args += CC='$(CC) -m64 -D__x86_64__' |
---|
[24585] | 51 | # amd64_slibdir in eglibc/debian/sysdeps/i386.mk |
---|
[26035] | 52 | lib64nss-nonlocal_configure_args += --prefix=/ --libdir="\$${prefix}/lib64" |
---|
[23880] | 53 | |
---|
[26035] | 54 | flavors := $(filter $(all_flavors),$(shell dh_listpackages)) |
---|
[24756] | 55 | |
---|
[26035] | 56 | define do_overrides |
---|
| 57 | override_$(1): $(addsuffix _$(1),$(2)) |
---|
| 58 | $(addsuffix _$(1),$(filter-out REMAINING,$(2))): %_$(1): |
---|
| 59 | $(1) -p$$* $(3) |
---|
| 60 | REMAINING_$(1): $(addsuffix _$(1),$(filter-out REMAINING,$(2))) |
---|
| 61 | $(1) --remaining-packages $(4) |
---|
[23880] | 62 | |
---|
[26035] | 63 | endef |
---|
[23880] | 64 | |
---|
[26035] | 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))) |
---|