%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: calibre Version: 0.6.10 Release: 1%{?dist} Summary: E-book converter and library management Group: Applications/Multimedia License: GPLv3 URL: http://calibre.kovidgoyal.net/ Source0: http://calibre.kovidgoyal.net/downloads/%{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: lrfviewer.desktop Patch0: %{name}-%{version}-postinstall.patch Patch1: %{name}-%{version}-cssprofiles.patch Patch2: %{name}-%{version}-desktopintegration.patch Patch3: %{name}-%{version}-manpages.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel >= 2.6 BuildRequires: qt-devel >= 4.5.1 BuildRequires: PyQt4-devel >= 4.5.1 BuildRequires: poppler-qt4-devel >= 0.10.6 BuildRequires: podofo-devel >= 0.7.0 BuildRequires: desktop-file-utils Requires: python-mechanize >= 0.1.10 Requires: python-lxml >= 2.1.5 Requires: python-dateutil >= 1.4.1 Requires: pyPdf >= 1.10 Requires: python-cherrypy >= 2.3 Requires: python-cssutils >= 0.9.5 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 # we run the postinstall script manually so no need for it in setup.py %patch0 -p1 -b .postinstall # we delete the provided cssutils and move the css profiles to calibre, # which wasn't installed before %patch1 -p1 -b .cssprofiles # do the desktop integration ourselves instead of letting calibre # install all the files manually in the homedir of the user running the # install script %patch2 -p1 -b .desktopintegration # compress manpages with gzip, not bz2 # they should also be put into section 1, not 1calibre %patch3 -p1 -b .manpages # dos2unix newline conversion %{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/* %build python setup.py build %install rm -rf %{buildroot} mkdir -p %{buildroot}%{python_sitelib}/calibre/ # this is the only file we need from the provided cssutils package cp src/cssutils/profiles.py src/calibre/cssutils_profiles.py cp src/cssutils/profiles.py %{buildroot}%{python_sitelib}/calibre PATH=$PATH:%{buildroot}%{python_sitelib}/calibre/ \ PYTHONPATH="src:%{buildroot}%{python_sitelib}/calibre" \ python setup.py install --root=%{buildroot} # icons mkdir -p %{buildroot}/usr/share/pixmaps/ cp src/%{name}/manual/resources/logo.png \ %{buildroot}/usr/share/pixmaps/%{name}.png cp src/calibre/gui2/images/viewer.svg \ %{buildroot}/usr/share/pixmaps/lrfviewer.svg PATH=$PATH:%{buildroot}%{python_sitelib}/%{name}/ \ PYTHONPATH="src" \ DESTDIR=%{buildroot} \ python src/%{name}/linux.py --use-destdir \ --dont-check-root --do-not-reload-udev-hal desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %{SOURCE1} desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %{SOURCE2} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc COPYRIGHT LICENSE %{_bindir}/%{name}* %{_bindir}/ebook-convert %{_bindir}/ebook-device %{_bindir}/ebook-meta %{_bindir}/ebook-viewer %{_bindir}/fetch-ebook-metadata %{_bindir}/librarything %{_bindir}/lrf2lrs %{_bindir}/lrfviewer %{_bindir}/lrs2lrf %{_bindir}/markdown-calibre %{_bindir}/pdfmanipulate %{_bindir}/web2disk %{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/lrfviewer.svg %{_mandir}/man1/%{name}* %{_mandir}/man1/librarything.1* %{_mandir}/man1/ebook-meta.1* %{_mandir}/man1/ebook-convert.1* %{_mandir}/man1/web2disk.1* %{_mandir}/man1/lrs2lrf.1* %{_mandir}/man1/lrf2lrs.1* %{_mandir}/man1/fetch-ebook-metadata.1* %{_mandir}/man1/pdfmanipulate.1* %dir %{python_sitelib}/%{name}/* %{python_sitelib}/%{name}/web/* %{python_sitelib}/%{name}/devices/* %{python_sitelib}/%{name}/customize/* %{python_sitelib}/%{name}/ebooks/* %{python_sitelib}/%{name}/gui2/* %{python_sitelib}/%{name}/library/* %{python_sitelib}/%{name}/plugins/* %{python_sitelib}/%{name}/trac/* %{python_sitelib}/%{name}/translations/* %{python_sitelib}/%{name}/utils/* %{_sysconfdir}/* %{python_sitelib}/%{name}-%{version}-py2.6.egg-info %{_datadir}/applications/%{name}.desktop %{_datadir}/applications/lrfviewer.desktop # these are provided as separate packages %exclude %{python_sitelib}/odf %exclude %{python_sitelib}/cherrypy %exclude %{python_sitelib}/pyPdf %exclude %{python_sitelib}/encutils %exclude %{python_sitelib}/cssutils %changelog * 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