calibre/calibre.spec

271 lines
9.1 KiB
RPMSpec
Raw Permalink Normal View History

2014-06-20 03:04:52 +04:00
Summary: E-book converter and library management
2012-12-04 04:13:37 +04:00
Name: calibre
2024-09-13 08:54:12 +00:00
Version: 7.18.0
2022-07-12 09:50:28 +03:00
Release: 1
2014-06-20 03:04:52 +04:00
License: GPLv3+
2015-08-01 00:50:38 +10:00
Group: Office
2023-02-06 10:27:21 +00:00
URL: http://calibre-ebook.com/
2017-08-28 13:31:08 +03:00
Source0: https://download.calibre-ebook.com/%{version}/%{name}-%{version}.tar.xz
2018-07-02 20:43:31 +03:00
Source1: calibre-mount-helper
Patch0: calibre-3.26.1-linkage.patch
Patch1: calibre-3.26.1-no-update.patch
Patch3: calibre-3.26.1-nodisplay.patch
2019-07-14 13:06:06 +00:00
2014-06-20 03:04:52 +04:00
BuildRequires: desktop-file-utils
BuildRequires: python-apsw
BuildRequires: python-beautifulsoup
BuildRequires: python-cssselect
BuildRequires: python-cssutils >= 0.9.9
BuildRequires: python-dateutil
BuildRequires: python-imaging
BuildRequires: python-lxml
BuildRequires: python-mechanize
2017-06-25 15:16:03 +02:00
BuildRequires: python-msgpack
BuildRequires: python-setuptools
2014-06-20 03:04:52 +04:00
BuildRequires: python-six
2017-06-25 15:16:03 +02:00
BuildRequires: python-regex
2017-08-08 23:46:27 +02:00
BuildRequires: python-html5-parser
2019-07-14 13:06:06 +00:00
BuildRequires: python-beautifulsoup4
2014-06-20 03:04:52 +04:00
BuildRequires: unzip
BuildRequires: xdg-utils
BuildRequires: chmlib-devel
BuildRequires: libwmf-devel
BuildRequires: podofo-devel
2015-08-01 00:50:38 +10:00
BuildRequires: python-qt5-devel
BuildRequires: qt5-devel
2015-08-01 01:13:57 +10:00
# Pulled by some Qt5 packages via sip
BuildRequires: pkgconfig(egl)
2017-06-25 15:16:03 +02:00
BuildRequires: pkgconfig(gl)
2014-06-20 03:04:52 +04:00
BuildRequires: pkgconfig(icu-i18n)
2015-08-01 00:50:38 +10:00
BuildRequires: pkgconfig(ImageMagick)
BuildRequires: pkgconfig(libmtp)
2018-07-02 20:43:31 +03:00
BuildRequires: pkgconfig(libcurl)
2014-05-16 16:11:25 +04:00
BuildRequires: pkgconfig(poppler-glib)
2015-08-01 00:50:38 +10:00
BuildRequires: pkgconfig(poppler-qt5)
BuildRequires: pkgconfig(python)
BuildRequires: pkgconfig(sqlite3)
2017-08-28 13:31:08 +03:00
BuildRequires: pythonegg(chardet)
2018-07-02 20:43:31 +03:00
BuildRequires: pythonegg(lxml) >= 3.8.0
2017-08-28 13:31:08 +03:00
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(cairo)
2018-07-02 20:43:31 +03:00
BuildRequires: pkgconfig(gobject-2.0)
2022-07-12 09:50:28 +03:00
BuildRequires: pkgconfig(python3) >= 3.7.0
2019-07-14 13:06:06 +00:00
BuildRequires: python-css-parser
Requires: python-css-parser
Requires: imagemagick
2014-05-16 16:11:25 +04:00
Requires: python-apsw
Requires: python-beautifulsoup
Requires: python-cherrypy
Requires: python-cssselect
Requires: python-cssutils
Requires: python-dateutil
2015-08-01 00:50:38 +10:00
Requires: python-dbus
2014-05-16 16:11:25 +04:00
Requires: python-django-tagging
Requires: python-genshi
Requires: python-imaging
Requires: python-lxml
Requires: python-mechanize
2019-07-14 13:06:06 +00:00
Requires: python-msgpack
2017-06-25 22:10:53 +03:00
Requires: python-regex
2014-05-16 16:11:25 +04:00
Requires: python-netifaces
2017-08-08 23:46:27 +02:00
Requires: python-html5-parser
2014-05-16 16:11:25 +04:00
Requires: python-odf
Requires: python-pypdf
2015-08-01 00:50:38 +10:00
Requires: python-qt5
2019-07-14 13:06:06 +00:00
Requires: python-beautifulsoup4
2014-05-16 16:11:25 +04:00
Requires: poppler
# Require the packages of the files which are symlinked by calibre
Requires: fonts-ttf-liberation
# E-mail functionality requires this package
# see https://bugs.launchpad.net/calibre/+bug/739073
Requires: python-dnspython
2012-02-01 22:04:55 +04:00
%description
Calibre is meant to be a complete e-library solution. It includes library
2014-05-16 16:11:25 +04:00
management, format conversion, news feeds to ebook conversion as well as
2012-02-01 22:04:55 +04:00
e-book reader sync features.
2014-05-16 16:11:25 +04:00
Calibre is primarily a ebook cataloging program. It manages your ebook
2012-02-01 22:04:55 +04:00
collection for you. It is designed around the concept of the logical book,
2014-05-16 16:11:25 +04:00
i.e. a single entry in the database that may correspond to ebooks in several
formats. It also supports conversion to and from a dozen different ebook
2012-02-01 22:04:55 +04:00
formats.
2012-11-30 16:19:29 +04:00
Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ,
RTF, TXT, PDF and LRS.
2014-05-16 16:11:25 +04:00
%files
#-f %{name}.lang
2012-11-30 16:19:29 +04:00
%doc COPYRIGHT LICENSE Changelog.yaml
%{_bindir}/calibre
%{_bindir}/calibre-complete
%{_bindir}/calibre-customize
%{_bindir}/calibre-debug
%{_bindir}/calibre-parallel
%{_bindir}/calibre-server
%{_bindir}/calibre-smtp
%{_bindir}/calibre-mount-helper
%{_bindir}/calibredb
%{_bindir}/ebook-convert
%{_bindir}/ebook-device
2014-05-16 16:11:25 +04:00
%{_bindir}/ebook-edit
2012-11-30 16:19:29 +04:00
%{_bindir}/ebook-meta
%{_bindir}/ebook-polish
2014-05-16 16:11:25 +04:00
%{_bindir}/ebook-viewer
2012-11-30 16:19:29 +04:00
%{_bindir}/fetch-ebook-metadata
%{_bindir}/lrf2lrs
%{_bindir}/lrfviewer
%{_bindir}/lrs2lrf
%{_bindir}/markdown-calibre
%{_bindir}/web2disk
%{_libdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/pixmaps/*
%{_datadir}/applications/*.desktop
2015-08-01 00:50:38 +10:00
%{_datadir}/bash-completion/completions/%{name}
2012-11-30 16:19:29 +04:00
%{_datadir}/mime/packages/*
2017-08-08 23:46:27 +02:00
%{_datadir}/metainfo/%{name}-*.appdata.xml
2012-11-30 16:19:29 +04:00
%{_datadir}/icons/hicolor/*/apps/*
2016-02-10 00:41:37 +04:00
%{_datadir}/icons/hicolor/*/mimetypes/*
2012-11-30 16:19:29 +04:00
%{python_sitelib}/init_calibre.py*
#--------------------------------------------------------------------
2012-02-01 22:04:55 +04:00
%prep
2015-08-01 00:50:38 +10:00
%setup -q
2012-02-01 22:04:55 +04:00
2016-02-15 00:11:50 +04:00
# remove redundant / non-free fonts
2012-11-30 16:19:29 +04:00
rm -rf resources/fonts/*/
2012-02-01 22:04:55 +04:00
2022-07-12 09:50:28 +03:00
#patch0 -p1
2015-08-01 00:50:38 +10:00
2012-11-30 16:19:29 +04:00
# don't check for new upstream version (that's what packagers do)
# otherwise the plugins are safe to be updated in ~/.config/calibre/plugins/
2022-07-12 09:50:28 +03:00
#patch1 -F 2 -p1 -b .no-update
2012-11-30 16:19:29 +04:00
2022-07-12 09:50:28 +03:00
#patch3 -p1 -b .python-fix
2012-02-01 22:04:55 +04:00
# dos2unix newline conversion
2012-12-04 04:13:37 +04:00
sed -i -e 's/\r//' src/calibre/web/feeds/recipes/*
2012-11-30 16:19:29 +04:00
# fix the location of liberation default font
2012-12-04 04:13:37 +04:00
# sed -i -e "s:P('fonts/liberation/LiberationSerif:('%{_datadir}/fonts/TTF/liberation/LiberationSerif:" \
2012-11-30 16:19:29 +04:00
# src/calibre/library/catalog.py
2012-12-04 04:13:37 +04:00
sed -i -e "s:P('fonts/liberation/LiberationSerif:('%{_datadir}/fonts/TTF/liberation/LiberationSerif:" \
2012-11-30 16:19:29 +04:00
src/calibre/utils/magick/draw.py
2012-12-04 04:13:37 +04:00
sed -i -e "s:P('fonts/liberation/LiberationSerif:('%{_datadir}/fonts/TTF/liberation/LiberationSerif:" \
2012-11-30 16:19:29 +04:00
src/calibre/web/feeds/news.py
2012-12-04 04:13:37 +04:00
sed -i -e "s:P('fonts/liberation/LiberationSerif:('%{_datadir}/fonts/TTF/liberation/LiberationSerif:" \
2012-11-30 16:19:29 +04:00
recipes/*_ke.recipe
2012-02-01 22:04:55 +04:00
# remove shebangs
2012-12-04 04:13:37 +04:00
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
sed -i -e '/^#!\//, 1d' src/templite/*.py
sed -i -e '/^#!\//, 1d' resources/default_tweaks.py
sed -i -e '/^#!\//, 1d' recipes/*.recipe
chmod -x src/calibre/*/*/*/*.py
chmod -x src/calibre/*/*/*.py
chmod -x src/calibre/*/*.py
chmod -x src/calibre/*.py
chmod -x recipes/*.recipe
2012-02-01 22:04:55 +04:00
%build
2022-07-12 09:50:28 +03:00
OVERRIDE_CFLAGS="%{optflags}" python3 setup.py build
2012-02-01 22:04:55 +04:00
%install
mkdir -p %{buildroot}%{_datadir}
# create directories for xdg-utils
mkdir -p %{buildroot}%{_datadir}/icons
mkdir -p %{buildroot}%{_datadir}/icons/hicolor
mkdir -p %{buildroot}%{_datadir}/packages
mkdir -p %{buildroot}%{_datadir}/mime
mkdir -p %{buildroot}%{_datadir}/mime/packages
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/desktop-directories
2012-11-30 16:19:29 +04:00
# create directory for calibre environment module
# the install script assumes it's there.
2012-02-01 22:04:55 +04:00
mkdir -p %{buildroot}%{python_sitelib}
2012-11-30 16:19:29 +04:00
2012-02-01 22:04:55 +04:00
XDG_DATA_DIRS="%{buildroot}%{_datadir}" \
XDG_UTILS_INSTALL_MODE="system" \
LIBPATH="%{_libdir}" \
2014-05-16 16:11:25 +04:00
LANG="en_US" \
2012-02-01 22:04:55 +04:00
python setup.py install --root=%{buildroot}%{_prefix} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
2012-11-30 16:19:29 +04:00
--staging-libdir=%{buildroot}%{_libdir} \
# remove shebang from init_calibre.py here because
# it just got spawned by the install script
2012-12-04 04:13:37 +04:00
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/init_calibre.py
2012-11-30 16:19:29 +04:00
2012-02-01 22:04:55 +04:00
# icons
mkdir -p %{buildroot}%{_datadir}/pixmaps/
2012-11-30 16:19:29 +04:00
cp -p resources/images/library.png \
%{buildroot}%{_datadir}/pixmaps/%{name}-gui.png
cp -p resources/images/viewer.png \
%{buildroot}%{_datadir}/pixmaps/calibre-viewer.png
2012-02-01 22:04:55 +04:00
# every file is empty here
find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs rm -f
2012-02-02 00:20:04 +04:00
# the portable batch (>=0.8.5) is not needed
rm -f %{buildroot}%{_bindir}/calibre-portable.bat
2012-02-01 22:04:55 +04:00
# packages aren't allowed to register mimetypes like this
2012-11-30 16:19:29 +04:00
rm -f %{buildroot}%{_datadir}/applications/defaults.list
rm -f %{buildroot}%{_datadir}/applications/mimeinfo.cache
rm -f %{buildroot}%{_datadir}/mime/application/*.xml
rm -f %{buildroot}%{_datadir}/mime/text/*.xml
2012-02-01 22:04:55 +04:00
desktop-file-validate \
%{buildroot}%{_datadir}/applications/calibre-ebook-viewer.desktop
desktop-file-validate \
%{buildroot}%{_datadir}/applications/calibre-gui.desktop
desktop-file-validate \
%{buildroot}%{_datadir}/applications/calibre-lrfviewer.desktop
# mimetype icon for lrf
rm -rf %{buildroot}%{_datadir}/icons/hicolor/128x128
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
cp -p resources/images/mimetypes/lrf.png \
2012-11-30 16:19:29 +04:00
%{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.png
2012-02-01 22:04:55 +04:00
cp -p resources/images/viewer.png \
2012-11-30 16:19:29 +04:00
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.png
2012-02-01 22:04:55 +04:00
# these are provided as separate packages
rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,cssutils}
rm -rf %{buildroot}%{_libdir}/%{name}/cal/utils/genshi
rm -rf %{buildroot}%{_libdir}/%{name}/cal/trac
# link to system fonts after we have deleted the non-free ones
2012-11-30 16:19:29 +04:00
# http://oldbugs.calibre-ebook.com/ticket/3832
mkdir -p %{buildroot}%{_datadir}/%{name}/fonts/prs500
2012-02-01 22:04:55 +04:00
ln -s %{_datadir}/fonts/TTF/liberation/LiberationSans-Regular.ttf \
2012-11-30 16:19:29 +04:00
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf
2012-02-01 22:04:55 +04:00
ln -s %{_datadir}/fonts/TTF/liberation/LiberationSerif-Regular.ttf \
2012-11-30 16:19:29 +04:00
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf
2012-02-01 22:04:55 +04:00
ln -s %{_datadir}/fonts/TTF/liberation/LiberationMono-Regular.ttf \
2012-11-30 16:19:29 +04:00
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf
2012-02-01 22:04:55 +04:00
2014-05-16 16:11:25 +04:00
# localization has changed since calibre-0.8.5
# locale.zip is treated internally at runtime
# so the traditional locale fixes are moot.
# locales should still be looked for in the proper place
# but under the new localization zip-based schema
sed -i -e 's:localization/locale.zip:%{_datadir}/%{name}/localization/locales.zip:' %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py
#% find_lang %{name} --with-kde --all-name
2012-02-01 22:04:55 +04:00
rm -f %{buildroot}%{_bindir}/%{name}-uninstall
2012-02-01 22:04:55 +04:00
2018-07-02 20:43:31 +03:00
install -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/
2019-07-14 13:06:06 +00:00