[libcanberra/f14/master] - Make the gtk2 module installable without gtk3

Bastien Nocera hadess at fedoraproject.org
Thu Sep 9 15:02:24 UTC 2010


commit 85e8e2b1da2a69b006919057f99bd68760e5ec60
Author: Bastien Nocera <hadess at hadess.net>
Date:   Thu Sep 9 16:02:28 2010 +0100

    - Make the gtk2 module installable without gtk3

 libcanberra.spec                 |   50 ++++++++++++++++++++++++-------------
 link-gtk-play-against-gtk2.patch |   17 +++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)
---
diff --git a/libcanberra.spec b/libcanberra.spec
index c150d32..4c1d1d7 100644
--- a/libcanberra.spec
+++ b/libcanberra.spec
@@ -1,6 +1,6 @@
 Name: libcanberra
 Version: 0.25
-Release: 3%{?dist}
+Release: 4%{?dist}
 Summary: Portable Sound Event Library
 Group: System Environment/Libraries
 Source0: http://0pointer.de/lennart/projects/libcanberra/libcanberra-%{version}.tar.gz
@@ -21,6 +21,10 @@ BuildRequires: gettext-devel
 Requires: sound-theme-freedesktop
 Requires: pulseaudio-libs >= 0.9.15
 
+# Link canberra-gtk-play against GTK 2.x for F14
+Patch0: link-gtk-play-against-gtk2.patch
+BuildRequires: automake autoconf libtool
+
 %description
 A small and lightweight implementation of the XDG Sound Theme Specification
 (http://0pointer.de/public/sound-theme-spec.html).
@@ -29,8 +33,9 @@ A small and lightweight implementation of the XDG Sound Theme Specification
 Summary: Gtk+ 2.x Bindings for libcanberra
 Group: System Environment/Libraries
 Requires: %{name} = %{version}-%{release}
-# GConf and other stuff is included in the gtk3 package, so always pull that in.
-Requires: %{name}-gtk3 = %{version}-%{release}
+Requires(pre): GConf2
+Requires(post): GConf2
+Requires(preun): GConf2
 
 %description gtk2
 Gtk+ 2.x bindings for libcanberra
@@ -39,9 +44,9 @@ Gtk+ 2.x bindings for libcanberra
 Summary: Gtk+ 3.x Bindings for libcanberra
 Group: System Environment/Libraries
 Requires: %{name} = %{version}-%{release}
-Requires(pre): GConf2
+# GConf and other stuff is included in the gtk2 package, so always pull that in.
+Requires: %{name}-gtk2 = %{version}-%{release}
 Requires(preun): GConf2
-Requires(post): GConf2
 
 %description gtk3
 Gtk+ 3.x bindings for libcanberra
@@ -58,18 +63,22 @@ Development Files for libcanberra Client Development
 %post -p /sbin/ldconfig
 %postun -p /sbin/ldconfig
 
-%pre gtk2 -p /sbin/ldconfig
-%post gtk2 -p /sbin/ldconfig
-%preun gtk2 -p /sbin/ldconfig
-%postun gtk2 -p /sbin/ldconfig
-
-%pre gtk3
+%pre gtk2
+/sbin/ldconfig
 %gconf_schema_prepare libcanberra
 
-%post gtk3
+%post gtk2
 /sbin/ldconfig
 %gconf_schema_upgrade libcanberra
 
+%preun gtk2
+/sbin/ldconfig
+%gconf_schema_remove libcanberra
+
+%postun gtk2 -p /sbin/ldconfig
+
+%post gtk3 -p /sbin/ldconfig
+
 %preun gtk3
 %gconf_schema_remove libcanberra
 
@@ -77,8 +86,10 @@ Development Files for libcanberra Client Development
 
 %prep
 %setup -q
+%patch0 -p1 -b .gtk2
 
 %build
+autoreconf -f
 %configure --disable-static --enable-pulse --enable-alsa --enable-null --enable-gstreamer --disable-oss --with-builtin=dso
 make %{?_smp_mflags}
 
@@ -103,12 +114,6 @@ rm $RPM_BUILD_ROOT%{_docdir}/libcanberra/README
 %defattr(-,root,root)
 %{_libdir}/libcanberra-gtk.so.*
 %{_libdir}/gtk-2.0/modules/libcanberra-gtk-module.so
-
-%files gtk3
-%defattr(-,root,root)
-%{_libdir}/libcanberra-gtk3.so.*
-%{_libdir}/gtk-3.0/modules/libcanberra-gtk3-module.so
-%{_libdir}/gtk-3.0/modules/libcanberra-gtk-module.so
 %{_bindir}/canberra-gtk-play
 %{_datadir}/gnome/autostart/libcanberra-login-sound.desktop
 %{_datadir}/gnome/shutdown/libcanberra-logout-sound.sh
@@ -119,6 +124,12 @@ rm $RPM_BUILD_ROOT%{_docdir}/libcanberra/README
 %{_datadir}/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop
 %{_sysconfdir}/gconf/schemas/libcanberra.schemas
 
+%files gtk3
+%defattr(-,root,root)
+%{_libdir}/libcanberra-gtk3.so.*
+%{_libdir}/gtk-3.0/modules/libcanberra-gtk3-module.so
+%{_libdir}/gtk-3.0/modules/libcanberra-gtk-module.so
+
 %files devel
 %defattr(-,root,root)
 %doc %{_datadir}/gtk-doc
@@ -137,6 +148,9 @@ rm $RPM_BUILD_ROOT%{_docdir}/libcanberra/README
 %{_datadir}/vala/vapi/libcanberra.vapi
 
 %changelog
+* Thu Sep 09 2010 Bastien Nocera <bnocera at redhat.com> 0.25-4
+- Make the gtk2 module installable without gtk3
+
 * Mon Aug 23 2010 Matthias Clasen <mclasen at redhat.com> 0.25-3
 - Co-own /usr/share/gtk-doc (#604379)
 
diff --git a/link-gtk-play-against-gtk2.patch b/link-gtk-play-against-gtk2.patch
new file mode 100644
index 0000000..59706b0
--- /dev/null
+++ b/link-gtk-play-against-gtk2.patch
@@ -0,0 +1,17 @@
+--- libcanberra-0.25/src/Makefile.am		2010-06-13 18:41:49.000000000 +0100
++++ libcanberra-0.25.new/src/Makefile.am	2010-09-09 15:58:59.000000000 +0100
+@@ -356,11 +356,11 @@ endif
+ if HAVE_GTK3
+ 
+ canberra_gtk_play_LDADD = \
+-	$(GTK3_LIBS) \
++	$(GTK_LIBS) \
+ 	libcanberra.la \
+-	libcanberra-gtk3.la
++	libcanberra-gtk.la
+ canberra_gtk_play_CFLAGS = \
+-	$(GTK3_CFLAGS)
++	$(GTK_CFLAGS)
+ 
+ else
+ if HAVE_GTK


More information about the scm-commits mailing list