buildrootschalter/package/nss-mdns/nss-mdns.mk
Peter Korsgaard c7c0ca288d nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional)
Fixes http://autobuild.buildroot.net/results/481/4819cacd4b7015ef2bfaaf1b3fc9ba33f9194315/

After commit e1eba3d97, the skeleton no longer has a /etc/nsswitch.conf by
the time nss-mdns gets built, so the sed invocation fails.

Work around it by installing the glibc one early if not already available
in the skeleton.

If we want to do further modification of nsswitch.conf in the future (for
E.G.  samba), then we should probably introduce some hooks to
GLIBC_COPY_NSSWITCH_FILE instead.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-31 11:31:05 +01:00

23 lines
735 B
Makefile

################################################################################
#
# nss-mdns
#
################################################################################
NSS_MDNS_VERSION = 0.10
NSS_MDNS_SITE = http://0pointer.de/lennart/projects/nss-mdns
NSS_MDNS_LICENSE = LGPLv2.1+
NSS_MDNS_LICENSE_FILES = LICENSE
define NSS_MDNS_INSTALL_CONFIG
if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
$(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
fi
sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
$(TARGET_DIR)/etc/nsswitch.conf
endef
NSS_MDNS_POST_INSTALL_TARGET_HOOKS += NSS_MDNS_INSTALL_CONFIG
$(eval $(autotools-package))