!9 [sync] PR-4: 修复avahi服务启动成功,但是使用nss-mdns ping主机名.local失败

From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2022-12-12 03:02:15 +00:00 committed by Gitee
commit 1ddd812a75
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: nss-mdns Name: nss-mdns
Version: 0.15.1 Version: 0.15.1
Release: 2 Release: 3
Summary: Host name resolution for GNU Name Service Switch Summary: Host name resolution for GNU Name Service Switch
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/lathiat/nss-mdns URL: https://github.com/lathiat/nss-mdns
@ -18,31 +18,43 @@ common Unix/Linux programs in the ad-hoc mDNS domain .local.
%package_help %package_help
%prep %prep
%autosetup %autosetup -n %{name}-%{version}
%build %build
%configure --libdir=/%{_lib} %configure --libdir=/%{_lib}
%make_build %make_build
%install
%make_install
%check %check
make check || (cat ./test-suite.log; false) make check || (cat ./test-suite.log; false)
%install %pre
rm -rf $RPM_BUILD_ROOT
%make_install
%post
%{?ldconfig}
%posttrans
authselect enable-feature with-mdns4 &> /dev/null || :
%preun %preun
authselect disable-feature with-mdns4 &> /dev/null || : if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then
sed -i.bak '
/^hosts:/ !b
s/[[:blank:]]\+mdns\(4\|6\)\?\(_minimal\( \[NOTFOUND=return\]\)\?\)\?//g
' /etc/nsswitch.conf
fi
%ldconfig_postun %post
/sbin/ldconfig
if [ -f /etc/nsswitch.conf ] ; then
sed -i.bak '
/^hosts:/ !b
/\<mdns\(4\|6\)\?\(_minimal\)\?\>/ b
s/\([[:blank:]]\+\)dns\>/\1mdns4_minimal [NOTFOUND=return] dns/g
' /etc/nsswitch.conf
fi
%postun
/sbin/ldconfig
%files %files
%defattr(-,root,root)
%license LICENSE %license LICENSE
/%{_lib}/*.so.* /%{_lib}/*.so.*
@ -50,8 +62,11 @@ authselect disable-feature with-mdns4 &> /dev/null || :
%doc README.md NEWS.md ACKNOWLEDGEMENTS.md %doc README.md NEWS.md ACKNOWLEDGEMENTS.md
%changelog %changelog
* Wed Mar 02 2022 wulei <wulei80@huawei.com> - 0.15.1-3
- Add preun and post
* Fri Jan 07 2022 wulei <wulei80@huawei.com> - 0.15.1-2 * Fri Jan 07 2022 wulei <wulei80@huawei.com> - 0.15.1-2
- add help package - Add help package
* Tue Dec 28 2021 wulei <wulei80@huawei.com> - 0.15.1-1 * Tue Dec 28 2021 wulei <wulei80@huawei.com> - 0.15.1-1
- Package update - Package update