Fix broken symlink for libwbclient

resolves: rhbz#2216712
This commit is contained in:
Pavel Filipenský 2023-07-10 09:40:56 +02:00
parent dc4326426b
commit 1ade48351d

View File

@ -138,7 +138,7 @@
%define samba_requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") %define samba_requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%global samba_version 4.18.4 %global samba_version 4.18.4
%global baserelease 100 %global baserelease 101
# This should be rc1 or %%nil # This should be rc1 or %%nil
%global pre_release %nil %global pre_release %nil
@ -829,6 +829,7 @@ suite.
%package -n libwbclient %package -n libwbclient
Summary: The winbind client library Summary: The winbind client library
Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver}
Conflicts: sssd-libwbclient
%description -n libwbclient %description -n libwbclient
The libwbclient package contains the winbind client library from the Samba The libwbclient package contains the winbind client library from the Samba
@ -837,6 +838,7 @@ suite.
%package -n libwbclient-devel %package -n libwbclient-devel
Summary: Developer tools for the winbind library Summary: Developer tools for the winbind library
Requires: libwbclient = %{samba_depver} Requires: libwbclient = %{samba_depver}
Conflicts: sssd-libwbclient-devel
Provides: samba-winbind-devel = %{samba_depver} Provides: samba-winbind-devel = %{samba_depver}
Obsoletes: samba-winbind-devel < %{samba_depver} Obsoletes: samba-winbind-devel < %{samba_depver}
@ -1090,7 +1092,7 @@ Requires: %{name}-common-libs = %{samba_depver}
Provides: bundled(libreplace) Provides: bundled(libreplace)
%description winexe %description winexe
Winexe is a Remote Windows®-command executor Winexe is a Remote Windows-command executor
%endif %endif
### CTDB ### CTDB
@ -1354,17 +1356,6 @@ install -d -m 0755 %{buildroot}/%{_libdir}/samba
install -d -m 0755 %{buildroot}/%{_libdir}/samba/ldb install -d -m 0755 %{buildroot}/%{_libdir}/samba/ldb
install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig
# Move libwbclient.so* into private directory, it cannot be just libdir/samba
# 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
touch %{buildroot}%{_libexecdir}/samba/cups_backend_smb touch %{buildroot}%{_libexecdir}/samba/cups_backend_smb
# Install other stuff # Install other stuff
@ -1571,52 +1562,13 @@ fi
%endif %endif
%if %{with libwbclient} %if %{with libwbclient}
%posttrans -n libwbclient %pre -n libwbclient
# It has to be posttrans here to make sure all files of a previous version if [ $1 -gt 1 ] ; then
# without alternatives support are removed rm -rf %{_libdir}/samba/wbclient/
%{_sbindir}/update-alternatives \ rm -f /etc/alternatives/libwbclient.so*
--install \ rm -f /var/lib/alternatives/libwbclient.so*
%{_libdir}/libwbclient.so.%{libwbc_alternatives_version} \ fi
libwbclient.so.%{libwbc_alternatives_version}%{libwbc_alternatives_suffix} \
%{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version} \
10
%{?ldconfig} %{?ldconfig}
%preun -n libwbclient
if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives \
--remove \
libwbclient.so.%{libwbc_alternatives_version}%{libwbc_alternatives_suffix} \
%{_libdir}/samba/wbclient/libwbclient.so.%{libwbc_alternatives_version}
fi
/sbin/ldconfig
%posttrans -n libwbclient-devel
%{_sbindir}/update-alternatives \
--install %{_libdir}/libwbclient.so \
libwbclient.so%{libwbc_alternatives_suffix} \
%{_libdir}/samba/wbclient/libwbclient.so \
10
%preun -n libwbclient-devel
# alternatives checks if the file which should be removed is a link or not, but
# not if it points to the /etc/alternatives directory or to some other place.
# 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 [ $1 -eq 0 ]; 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
fi
fi
#endif {with libwbclient} #endif {with libwbclient}
%endif %endif
@ -2421,12 +2373,12 @@ fi
### LIBWBCLIENT ### LIBWBCLIENT
%if %{with libwbclient} %if %{with libwbclient}
%files -n libwbclient %files -n libwbclient
%{_libdir}/samba/wbclient/libwbclient.so.%{libwbclient_so_version}* %{_libdir}/libwbclient.so.%{libwbclient_so_version}*
### LIBWBCLIENT-DEVEL ### LIBWBCLIENT-DEVEL
%files -n libwbclient-devel %files -n libwbclient-devel
%{_includedir}/samba-4.0/wbclient.h %{_includedir}/samba-4.0/wbclient.h
%{_libdir}/samba/wbclient/libwbclient.so %{_libdir}/libwbclient.so
%{_libdir}/pkgconfig/wbclient.pc %{_libdir}/pkgconfig/wbclient.pc
#endif {with libwbclient} #endif {with libwbclient}
%endif %endif
@ -4376,6 +4328,9 @@ fi
%endif %endif
%changelog %changelog
* Mon Jul 10 2023 Pavel Filipenský <pfilipen@redhat.com> - 4.18.4-101
- resolves: rhbz#2216712 - Fix broken symlink for libwbclient
* Thu Jul 06 2023 Pavel Filipenský <pfilipen@redhat.com> - 4.18.4-100 * Thu Jul 06 2023 Pavel Filipenský <pfilipen@redhat.com> - 4.18.4-100
- resolves: rhbz#2190415 - Update to version 4.18.4 - resolves: rhbz#2190415 - Update to version 4.18.4