From 29391a88d0a20f252c794aa5d78c5dd6c543414c Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Fri, 16 May 2014 17:04:29 +0200 Subject: [PATCH] Add versioned library to alternatives system --- bacula.spec | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bacula.spec b/bacula.spec index 592f5b6..81a9652 100644 --- a/bacula.spec +++ b/bacula.spec @@ -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 - 7.0.3-3 +- Add versioned library to alternatives system. + * Fri May 16 2014 Simone Caronni - 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.