From ce9e8c1c71e16b28efde46c56eb468c5bc0fc47f Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Oct 18 2009 02:21:57 +0000 Subject: - Provide virtual packages for each available interface - Use alternatives to select the user interface (see README.Fedora) --- diff --git a/README.Fedora b/README.Fedora new file mode 100644 index 0000000..70c0998 --- /dev/null +++ b/README.Fedora @@ -0,0 +1,27 @@ +README for Fedora +----------------- + +The previously-monolithic FBReader package has now been split into +separate subpackages: + +- fbreader: The ebook reader +- zlibrary: Cross-platform GUI library +- zlibrary-ui-gtk: GTK+ interface for zlibrary +- zlibrary-ui-qt: Qt interface for zlibrary + +Two convenience packages are provided: +- fbreader-gtk: installs fbreader and zlibrary-ui-gtk +- fbreader-qt: installs fbreader and zlibrary-ui-qt + +'yum install fbreader' does not guarantee which interface gets picked; +install fbreader-gtk or -qt instead. + +If both -gtk and -qt interfaces are installed, by default +the Gtk+ interface is used. To change the interface you want to use, +do as root: + +# alternatives --config zlibrary-ui + +to reset the choice to the default, use + +# alternatives --auto zlibrary-ui diff --git a/fbreader.spec b/fbreader.spec index 1af0993..9c213bd 100644 --- a/fbreader.spec +++ b/fbreader.spec @@ -1,12 +1,13 @@ Name: fbreader Version: 0.10.7 -Release: 3%{?dist} +Release: 4%{?dist} Summary: E-book reader Group: Applications/Publishing License: GPLv2+ URL: http://www.fbreader.org/ Source0: http://www.fbreader.org/fbreader-sources-%{version}.tgz +Source1: README.Fedora Patch0: fbreader-0.10.0-desktop-file.patch Patch1: fbreader-optflags.patch # Use to expose the compiler flags used during build @@ -19,6 +20,7 @@ BuildRequires: gtk2-devel fribidi-devel libcurl-devel BuildRequires: libjpeg-devel desktop-file-utils BuildRequires: qt4-devel + %description FBReader is an e-book reader, with the following main features: @@ -44,6 +46,28 @@ FBReader is an e-book reader, with the following main features: * Screen rotation by 90, 180 and 270 degrees. +%package gtk +Summary: E-book reader (GTK+ interface) +Group: Applications/Publishing +Requires: %{name} = %{version}-%{release} +Requires: zlibrary-ui-gtk = %{version}-%{release} + +%description gtk +A virtual package that bundles both the FBreader e-book reader and its +GTK+ user interface. + + +%package qt +Summary: E-book reader (Qt interface) +Group: Applications/Publishing +Requires: %{name} = %{version}-%{release} +Requires: zlibrary-ui-qt = %{version}-%{release} + +%description qt +A virtual package that bundles both the FBreader e-book reader and its +Qt4 user interface. + + %package -n zlibrary Summary: Cross-platform GUI library Group: System Environment/Libraries @@ -67,7 +91,10 @@ for writing applications with Zlibrary. %package -n zlibrary-ui-gtk Summary: GTK+ interface module for ZLibrary Group: System Environment/Libraries -Provides: zlibrary-ui +Provides: zlibrary-ui = %{version}-%{release} + +Requires(posttrans): /usr/sbin/alternatives +Requires(postun): /usr/sbin/alternatives %description -n zlibrary-ui-gtk ZLibrary is a cross-platform library to build applications running on @@ -76,12 +103,17 @@ desktop Linux, Windows, and different Linux-based PDAs. This package provides a GTK+-based UI for ZLibrary. -%package -n zlibrary-ui-qt4 +%package -n zlibrary-ui-qt Summary: Qt4 interface module for ZLibrary Group: System Environment/Libraries -Provides: zlibrary-ui +Provides: zlibrary-ui = %{version}-%{release} +Provides: zlibrary-ui-qt4 = %{version}-%{release} +Obsoletes: zlibrary-ui-qt4 < %{version}-%{release} + +Requires(posttrans): /usr/sbin/alternatives +Requires(postun): /usr/sbin/alternatives -%description -n zlibrary-ui-qt4 +%description -n zlibrary-ui-qt ZLibrary is a cross-platform library to build applications running on desktop Linux, Windows, and different Linux-based PDAs. @@ -139,10 +171,39 @@ rm -rf $RPM_BUILD_ROOT %postun -n zlibrary -p /sbin/ldconfig +%posttrans -n zlibrary-ui-gtk +alternatives \ + --install \ + %{_libdir}/zlibrary/ui/zlui-active.so \ + zlibrary-ui \ + %{_libdir}/zlibrary/ui/zlui-gtk.so \ + 2 + +%posttrans -n zlibrary-ui-qt +alternatives \ + --install \ + %{_libdir}/zlibrary/ui/zlui-active.so \ + zlibrary-ui \ + %{_libdir}/zlibrary/ui/zlui-qt4.so \ + 1 + +%postun -n zlibrary-ui-gtk +if [ $1 -eq 0 ]; then + alternatives --remove zlibrary-ui \ + %{_libdir}/zlibrary/ui/zlui-gtk.so +fi +exit 0 + +%postun -n zlibrary-ui-qt +if [ $1 -eq 0 ]; then + alternatives --remove unison \ + %{_libdir}/zlibrary/ui/zlui-qt4.so +fi +exit 0 %files %defattr(-,root,root,-) -%doc fbreader/LICENSE +%doc fbreader/LICENSE README.Fedora %{_bindir}/FBReader %{_datadir}/FBReader %{_datadir}/applications/fedora-FBReader.desktop @@ -150,6 +211,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pixmaps/FBReader %{_datadir}/zlibrary +%files gtk +%files qt + %files -n zlibrary %defattr(-,root,root,-) %doc fbreader/LICENSE @@ -169,7 +233,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/zlibrary/ui/zlui-gtk.so %{_datadir}/zlibrary/keynames-gtk.xml -%files -n zlibrary-ui-qt4 +%files -n zlibrary-ui-qt %defattr(-,root,root,-) %{_libdir}/zlibrary/ui/zlui-qt4.so %{_datadir}/zlibrary/keynames-qt4.xml @@ -177,6 +241,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Oct 17 2009 Michel Salim - 0.10.7-4 +- Provide virtual packages for each available interface +- Use alternatives to select the user interface (see README.Fedora) + * Thu Sep 17 2009 Michel Salim - 0.10.7-3 - Split out zlibrary and zlibrary-ui subpackages (fixes bz# 523946)