Name: calibre Version: 0.6.17 Release: 1%{?dist} Summary: E-book converter and library management Group: Applications/Multimedia License: GPLv3 URL: http://calibre.kovidgoyal.net/ Source0: http://pypi.python.org/packages/source/c/%{name}/%{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: lrfviewer.desktop Patch0: %{name}-outputdev.patch Patch1: %{name}-desktopintegration.patch Patch2: %{name}-cssprofiles.patch Patch3: %{name}-manpages.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python >= 2.6 BuildRequires: python-devel >= 2.6 BuildRequires: ImageMagick-devel BuildRequires: python-setuptools-devel BuildRequires: qt-devel BuildRequires: PyQt4-devel BuildRequires: poppler-qt4-devel BuildRequires: podofo-devel BuildRequires: desktop-file-utils BuildRequires: python-mechanize BuildRequires: python-lxml BuildRequires: python-dateutil BuildRequires: python-imaging BuildRequires: libwmf Requires: pyPdf Requires: python-cherrypy Requires: python-cssutils Requires: ImageMagick Requires: odfpy Requires: django-tagging %description Calibre is meant to be a complete e-library solution. It includes library management, format conversion, news feeds to ebook conversion as well as e-book reader sync features. Calibre is primarily a ebook cataloging program. It manages your ebook collection for you. It is designed around the concept of the logical book, i.e. a single entry in the database that may correspond to ebooks in several formats. It also upports conversion from a dozen different ebook formats to LRF and EPUB. A graphical interface to the conversion software can be accessed easily by just clicking the "Convert E-books" button. Supported input formats are: MOBI, LIT, PRC, EPUB, ODT, HTML, CBR, CBZ, RTF, TXT, PDF and LRS. %prep %setup -q -n %{name} # small bug in the source code %patch0 -p1 -b .outputdev # do the desktop integration ourselves %patch1 -p1 -b .desktopintegration # we've moved the profiles so we don't have to redistribute cssutils %patch2 -p1 -b .cssprofiles # don't append calibre1 to the name of the manpages. No need to compress either %patch3 -p1 -b .manpages # dos2unix newline conversion %{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/* # remove shebangs %{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*/*py %{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*py %{__sed} -i -e '/^#![ ]*\//, 1d' src/calibre/*/*py %{__sed} -i -e '/^#!\//, 1d' src/calibre/*py %{__chmod} -x src/calibre/*/*/*/*py %{__chmod} -x src/calibre/*/*/*py %{__chmod} -x src/calibre/*/*py %{__chmod} -x src/calibre/*py %build python setup.py build CFLAGS=%{_optflags} %install rm -rf %{buildroot} # this is the only file we need from the provided cssutils package cp -p src/cssutils/profiles.py src/calibre/cssutils_profiles.py python setup.py install --root=%{buildroot}%{_prefix} --prefix=%{_prefix} \ --staging-libdir=%{buildroot}%{_libdir} # icons mkdir -p %{buildroot}%{_datadir}/pixmaps/ cp -p src/%{name}/manual/resources/logo.png \ %{buildroot}%{_datadir}/pixmaps/%{name}.png convert icons/viewer.ico %{buildroot}%{_datadir}/pixmaps/lrfviewer.png desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %{SOURCE1} desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %{SOURCE2} # don't put bash completions in /usr/etc mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot} # these are provided as separate packages rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,cssutils} # man pages mv %{buildroot}%{_datadir}/%{name}/man %{buildroot}%{_mandir} # udev rules mkdir -p %{buildroot}/%{_lib} # lib is hardcoded in src/calibre/linux.py mv %{buildroot}/usr/lib/udev %{buildroot}/%{_lib}/udev # move locales mv %{buildroot}%{_datadir}/%{name}/localization/locales \ %{buildroot}%{_datadir}/locale for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/messages.mo; do lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/messages.mo \ %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.mo done; for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \ %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo done; for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/qt.qm; do lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') mv $file %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_$lang.qm done; %find_lang %{name} --with-qt --all-name # locales should be looked for in the proper place %{__sed} -i -e "s:P('localization/locales:('/usr/share/locale:" \ -e "s:messages.mo:calibre.mo:" \ -e "s:iso639.mo:calibre_iso639.mo:" \ %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py # this is the only file we need from the provided cssutils package cp -p src/cssutils/profiles.py %{buildroot}%{_libdir}/%{name} %{__rm} -f %{buildroot}%{_bindir}/%{name}-uninstall %clean %{__rm} -rf %{buildroot} %files -f %{name}.lang %defattr(-,root,root,-) %doc COPYRIGHT LICENSE INSTALL %{_bindir}/* %{_sysconfdir}/* %{_libdir}/%{name} /%{_lib}/udev/* %{_datadir}/%{name} %{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/lrfviewer.png %{_datadir}/applications/%{name}.desktop %{_datadir}/applications/lrfviewer.desktop %{_mandir}/man1/* %changelog * Sat Oct 10 2009 Ionuț Arțăriși - 0.6.17-1 - new upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.1709Oct2009 - the install process changed significantly - locales were added * Thu Sep 10 2009 Ionuț Arțăriși - 0.6.11-1 - new upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.1104Sep2009 - minor path fixes - rearranged files section * Fri Aug 28 2009 Ionuț Arțăriși 0.6.10-1 - handle desktop files - don't compress manpages and don't list them as duplicates - added lrfviewer icon * Tue Aug 25 2009 Ionuț Arțăriși 0.6.8-1 - Initial RPM release