Fix libwbclient alternatives link.

resolves: #1214973
This commit is contained in:
Andreas Schneider 2015-04-24 14:48:58 +02:00
parent 427f6ef661
commit 1b9d99efc1

View File

@ -6,7 +6,7 @@
# ctdb is enabled by default, you can disable it with: --without clustering
%bcond_without clustering
%define main_release 2
%define main_release 3
%define samba_version 4.2.1
%define talloc_version 2.1.2
@ -46,6 +46,7 @@
%endif
%endif
%global libwbc_alternatives_version 0.12
%global libwbc_alternatives_suffix %nil
%if 0%{?__isa_bits} == 64
%global libwbc_alternatives_suffix -64
@ -746,6 +747,11 @@ install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig
# because samba uses rpath with this directory.
install -d -m 0755 %{buildroot}/%{_libdir}/samba/wbclient
mv %{buildroot}/%{_libdir}/libwbclient.so* %{buildroot}/%{_libdir}/samba/wbclient
if [ ! -f %{buildroot}/%{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version} ]
then
echo "Expected libwbclient version not found, please check if version has changed."
exit -1
fi
# Install other stuff
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
@ -859,12 +865,12 @@ fi
%posttrans -n libwbclient
# It has to be posttrans here to make sure all files of a previous version
# without alternatives support are removed
%{_sbindir}/update-alternatives --install %{_libdir}/libwbclient.so.0.11 \
libwbclient.so.0.11%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so.0.11 10
%{_sbindir}/update-alternatives --install %{_libdir}/libwbclient.so.%{libwbc_alternatives_version} \
libwbclient.so.%{libwbc_alternatives_version}%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version} 10
/sbin/ldconfig
%preun -n libwbclient
%{_sbindir}/update-alternatives --remove libwbclient.so.0.11%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so.0.11
%{_sbindir}/update-alternatives --remove libwbclient.so.%{libwbc_alternatives_version}%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version}
/sbin/ldconfig
%posttrans -n libwbclient-devel
@ -877,7 +883,7 @@ fi
# When downgrading to a version where alternatives is not used and
# libwbclient.so is a link and not a file it will be removed. The following
# check removes the alternatives files manually if that is the case.
if [ "`readlink %{_libdir}/libwbclient.so`" == "libwbclient.so.0.11" ]; then
if [ "`readlink %{_libdir}/libwbclient.so`" == "libwbclient.so.%{libwbc_alternatives_version}" ]; then
/bin/rm -f /etc/alternatives/libwbclient.so%{libwbc_alternatives_suffix} /var/lib/alternatives/libwbclient.so%{libwbc_alternatives_suffix} 2> /dev/null
else
%{_sbindir}/update-alternatives --remove libwbclient.so%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so
@ -1920,6 +1926,9 @@ rm -rf %{buildroot}
%endif # with_clustering_support
%changelog
* Fri Apr 24 2015 Andreas Schneider <asn@redhat.com> - 4.2.1-3
- resolves: #1214973 - Fix libwbclient alternatives link.
* Wed Apr 22 2015 Guenther Deschner <gdeschner@redhat.com> - 4.2.1-2
- Add vfs snapper module.