From 9b2e71d628370cc790b22a74426ae6323f4a20b1 Mon Sep 17 00:00:00 2001 From: Stewart Adam Date: Wed, 19 Mar 2008 18:10:31 +0000 Subject: [PATCH] Fixes from bz#327211: Use alternatives to switch totem's backends --- totem-bin-backend-ondemand.sh | 17 +++++++++++++---- totem.spec | 35 +++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/totem-bin-backend-ondemand.sh b/totem-bin-backend-ondemand.sh index 5a434b5..6dc4da0 100644 --- a/totem-bin-backend-ondemand.sh +++ b/totem-bin-backend-ondemand.sh @@ -28,9 +28,19 @@ set_backend() { echo "*** Invalid backend name ***" usage fi - - # FIXME if someone can explain update-alternatives to me - + _LIBDIR="$(rpm --eval '%{_libdir}')" + if [ -f $_LIBDIR/libbaconvideowidget-gstreamer.so.0.0.0 ];then + if [ -f $_LIBDIR/libbaconvideowidget-xine.so.0.0.0 ];then + # only if both files exist + /usr/sbin/alternatives --set totem-backend $_LIBDIR/libbaconvideowidget-$TOTEM_BACKEND.so.0.0.0 + else + echo -e 'Error: The xine backend was not found! Please check your totem installation.' + exit 1 + fi + else + echo -e 'Error: The gstreamer backend was not found! Please check your totem installation.' + exit 1 + fi exit 0 } # end functions @@ -64,4 +74,3 @@ else shift 3 LD_PRELOAD=libgdk-x11-2.0.so.0:libbaconvideowidget-$TOTEM_BACKEND.so.0.0.0 exec $BIN "$@" fi - diff --git a/totem.spec b/totem.spec index c12c209..9f03d2b 100644 --- a/totem.spec +++ b/totem.spec @@ -10,11 +10,11 @@ Summary: Movie player for GNOME Name: totem Version: 2.23.0 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 with exception Group: Applications/Multimedia URL: http://www.gnome.org/projects/totem/ -Source0: http://ftp.gnome.org/pub/GNOME/sources/totem/2.21/totem-%{version}.tar.bz2 +Source0: http://ftp.gnome.org/pub/GNOME/sources/totem/2.23/totem-%{version}.tar.bz2 Source1: totem-bin-backend-ondemand.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -256,9 +256,6 @@ mv $RPM_BUILD_ROOT/%{_libdir}/libbaconvideowidget.so.0.0.0 $RPM_BUILD_ROOT/%{_li popd %endif -# Restore the default backend -ln -sf %{_libdir}/libbaconvideowidget-gstreamer.so.0.0.0 $RPM_BUILD_ROOT/%{_libdir}/libbaconvideowidget.so.0.0.0 - rm -f $RPM_BUILD_ROOT%{_libdir}/totem/plugins/*/*.{a,la} \ $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/*.{a,la} \ $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-2.0/*.{a,la} \ @@ -285,9 +282,13 @@ if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor fi -%post gstreamer -p /sbin/ldconfig +%post gstreamer +/usr/sbin/alternatives --install %{_libdir}/libbaconvideowidget.so.0.0.0 totem-backend %{_libdir}/libbaconvideowidget-gstreamer.so.0.0.0 2 +/sbin/ldconfig -%post xine -p /sbin/ldconfig +%post xine +/usr/sbin/alternatives --install %{_libdir}/libbaconvideowidget.so.0.0.0 totem-backend %{_libdir}/libbaconvideowidget-xine.so.0.0.0 1 +/sbin/ldconfig %pre if [ "$1" -gt 1 ]; then @@ -310,7 +311,6 @@ if [ "$1" -eq 0 ]; then fi %postun -/sbin/ldconfig scrollkeeper-update -q update-desktop-database -q touch %{_datadir}/icons/hicolor @@ -318,9 +318,14 @@ if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor fi -%postun gstreamer -p /sbin/ldconfig +%postun gstreamer +/usr/sbin/alternatives --remove totem-backend %{_libdir}/libbaconvideowidget-gstreamer.so.0.0.0 +/sbin/ldconfig + +%postun xine +/usr/sbin/alternatives --remove totem-backend %{_libdir}/libbaconvideowidget-xine.so.0.0.0 +/sbin/ldconfig -%postun xine -p /sbin/ldconfig %post mythtv export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` @@ -414,7 +419,6 @@ fi %{_libdir}/totem/plugins/publish %files gstreamer -%{_libdir}/libbaconvideowidget.so.0.0.0 %{_libdir}/libbaconvideowidget-gstreamer.so.0.0.0 %if %{with_xine} @@ -423,7 +427,14 @@ fi %endif %changelog -* Mon Mar 17 2008 Jesse Keating - 2.23.0-5 +* Wed Mar 19 2008 Stewart Adam - 2.23.0-6 +- Use alternatives to switch the backend +- Update totem-backend script accordingly +- Remove ldconfig from %%postun, do that in individual the backends instead +- Do not restore a default backend, ldconfig in backends does this +- Fix Source0 URL + +* Mon Mar 17 2008 Jesse Keating - 2.23.0-5 - Fix some Provides to prevent cross arch obsoletions. * Mon Mar 10 2008 - Bastien Nocera - 2.23.0-4