diff --git a/package/public/mdnsresponder/dont-change-libc-config-files.patch b/package/public/mdnsresponder/dont-change-libc-config-files.patch new file mode 100644 index 000000000..69805a8ca --- /dev/null +++ b/package/public/mdnsresponder/dont-change-libc-config-files.patch @@ -0,0 +1,22 @@ +--- mDNSResponder-107/mDNSPosix/Makefile~ 2005-04-20 22:12:17.000000000 +0200 ++++ mDNSResponder-107/mDNSPosix/Makefile 2007-01-25 14:20:30.000000000 +0100 +@@ -468,7 +468,7 @@ + + $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) + $(LN) $< $@ +- ldconfig ++# ldconfig + + $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) + $(CP) $< $@ +@@ -479,8 +479,8 @@ + chmod 444 $@ + # Check the nsswitch.conf file. + # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns' +- cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns +- sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf ++# cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns ++# sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf + + $(MANPATH)/man5/%.5: %.5 + cp $< $@ diff --git a/package/public/mdnsresponder/dont-install-initscript.patch b/package/public/mdnsresponder/dont-install-initscript.patch index 8c81fa67f..944383867 100644 --- a/package/public/mdnsresponder/dont-install-initscript.patch +++ b/package/public/mdnsresponder/dont-install-initscript.patch @@ -19,7 +19,7 @@ - $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns -endif -endif -+# $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) ++$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) +# $(CP) $< $@ +# chmod ugo+x $@ +# ifdef RUNLEVELSCRIPTSDIR diff --git a/package/public/mdnsresponder/mdnsresponder.conf b/package/public/mdnsresponder/mdnsresponder.conf index 0014ea6e4..776ebbd73 100644 --- a/package/public/mdnsresponder/mdnsresponder.conf +++ b/package/public/mdnsresponder/mdnsresponder.conf @@ -4,5 +4,3 @@ hook_add postmake 5 "install_init mdnsd $confdir/mdnsd.init" var_append makeopt " " "os=linux" var_append makeinstopt " " "os=linux" -# FIXME: shared file with glibc -var_append flist''del "|" "etc/nsswitch.conf" diff --git a/package/public/mdnsresponder/postinstall.sh b/package/public/mdnsresponder/postinstall.sh new file mode 100644 index 000000000..148dadb7d --- /dev/null +++ b/package/public/mdnsresponder/postinstall.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if any_installed "lib/libnss_mdns.so.2" ; then + echo "mdnsresponder: adding 'mdns' to host: line in /etc/nsswitch.conf .." + sed -i -e '/mdns/! s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf +fi + +if any_removed "lib/libnss_mdns.so.2" ; then + echo "mdnsresponder: removing 'mdns' from host: line in /etc/nsswitch.conf .." + sed -i -e 's/^\(hosts:.*\)mdns \(.*\)/\1\2/' /etc/nsswitch.conf +fi