add preun and post

(cherry picked from commit ca03435dbae8f8b482a4d900993233956e1de080)
This commit is contained in:
wu-leilei 2022-03-02 20:14:25 +08:00 committed by openeuler-sync-bot
parent 55b8f9beb2
commit 65f69419e3

View File

@ -1,6 +1,6 @@
Name: nss-mdns
Version: 0.15.1
Release: 2
Release: 3
Summary: Host name resolution for GNU Name Service Switch
License: LGPLv2+
URL: https://github.com/lathiat/nss-mdns
@ -18,31 +18,43 @@ common Unix/Linux programs in the ad-hoc mDNS domain .local.
%package_help
%prep
%autosetup
%autosetup -n %{name}-%{version}
%build
%configure --libdir=/%{_lib}
%make_build
%install
%make_install
%check
make check || (cat ./test-suite.log; false)
%install
rm -rf $RPM_BUILD_ROOT
%make_install
%post
%{?ldconfig}
%posttrans
authselect enable-feature with-mdns4 &> /dev/null || :
%pre
%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
%defattr(-,root,root)
%license LICENSE
/%{_lib}/*.so.*
@ -50,8 +62,11 @@ authselect disable-feature with-mdns4 &> /dev/null || :
%doc README.md NEWS.md ACKNOWLEDGEMENTS.md
%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
- add help package
- Add help package
* Tue Dec 28 2021 wulei <wulei80@huawei.com> - 0.15.1-1
- Package update