Add versioned library to alternatives system

This commit is contained in:
Simone Caronni 2014-05-16 17:04:29 +02:00
parent 9017302d33
commit 29391a88d0

View File

@ -19,7 +19,7 @@
Name: bacula
Version: 7.0.3
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Cross platform network backup for Linux, Unix, Mac and Windows
# See LICENSE for details
License: AGPLv3 with exceptions
@ -475,9 +475,18 @@ rm -rf %{buildroot}
exit 0
%post libs-sql
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-mysql.so 50
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-sqlite3.so 40
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-postgresql.so 60
# Add alternative on unversioned library, so it's not broken during upgrades,
# and use the versioned library as a slave alternative.
/usr/sbin/alternatives \
--install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-mysql.so 50 \
--slave %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-mysql-%{version}.so
/usr/sbin/alternatives \
--install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-sqlite3.so 40 \
--slave %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-sqlite3-%{version}.so
/usr/sbin/alternatives \
--install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-postgresql.so 60 \
--slave %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-postgresql-%{version}.so
# Fix for automatic selection of backends during upgrades
if readlink /etc/alternatives/libbaccats.so | grep --silent mysql || \
readlink /etc/alternatives/bacula-dir | grep --silent mysql || \
@ -751,6 +760,9 @@ fi
%{_libdir}/nagios/plugins/check_bacula
%changelog
* Fri May 16 2014 Simone Caronni <negativo17@gmail.com> - 7.0.3-3
- Add versioned library to alternatives system.
* Fri May 16 2014 Simone Caronni <negativo17@gmail.com> - 7.0.3-2
- Filter out libbaccats from auto generated Provides/Obsoletes and add note on
the libbaccats-x.x.x.so shared object name mess.