1 |
Name: calibre |
2 |
Version: 6.9.0 |
3 |
Release: %mkrel 1 |
4 |
Summary: E-book converter and library management |
5 |
Group: Office/Utilities |
6 |
License: GPLv3 |
7 |
URL: https://calibre-ebook.com/ |
8 |
Source0: https://download.calibre-ebook.com/%{version}/calibre-%{version}.tar.xz |
9 |
Source2: %{name}-mount-helper |
10 |
# don't check for new upstream version (that's what packagers do) |
11 |
# otherwise the plugins are safe to be updated in ~/.config/calibre/plugins/ |
12 |
Patch1: calibre-no-update.patch |
13 |
# Do not display multiple apps in desktop files, only the main app |
14 |
# This is so gnome-software only 'sees' calibre once. |
15 |
Patch3: calibre-nodisplay.patch |
16 |
|
17 |
# Qt6Webengine and python3-qt6-webenginecore is not available on aarch64 and arm |
18 |
ExclusiveArch: x86_64 %{ix86} |
19 |
|
20 |
# |
21 |
# Security patches |
22 |
# P100 -> ... |
23 |
# |
24 |
# Kovid keeps updating the requirements |
25 |
# Here is an updated list |
26 |
# https://github.com/kovidgoyal/build-calibre/blob/master/scripts/sources.json |
27 |
BuildRequires: python3 |
28 |
BuildRequires: python3dist(sip) |
29 |
BuildRequires: python3-pyqt6-sip |
30 |
BuildRequires: pkgconfig(python3) |
31 |
BuildRequires: python3dist(setuptools) |
32 |
BuildRequires: python3dist(sip) >= 6 |
33 |
BuildRequires: python3dist(pyqt-builder) |
34 |
BuildRequires: python3dist(pychm) |
35 |
#BuildRequires: python3dist(pycrypto) |
36 |
BuildRequires: python3dist(pycryptodome) |
37 |
BuildRequires: python3dist(cchardet) |
38 |
BuildRequires: python3dist(sgmllib3k) |
39 |
BuildRequires: python3-speechd |
40 |
BuildRequires: python3-jeepney |
41 |
BuildRequires: python3-qt6-devel |
42 |
BuildRequires: python3-qt6-webenginecore |
43 |
BuildRequires: python3-qt6-webenginewidgets |
44 |
BuildRequires: python3-qt6-widgets |
45 |
BuildRequires: pkgconfig(libpodofo) |
46 |
BuildRequires: desktop-file-utils |
47 |
BuildRequires: xdg-utils |
48 |
BuildRequires: chmlib-devel |
49 |
BuildRequires: python3-cssutils >= 0.9.9 |
50 |
BuildRequires: pkgconfig(sqlite3) |
51 |
BuildRequires: icu-devel |
52 |
BuildRequires: pkgconfig(libpng) |
53 |
BuildRequires: pkgconfig(libmspack) |
54 |
BuildRequires: pkgconfig(libmtp) |
55 |
BuildRequires: pkgconfig(Qt6Core) |
56 |
BuildRequires: pkgconfig(Qt6DBus) |
57 |
BuildRequires: pkgconfig(Qt6Gui) |
58 |
BuildRequires: pkgconfig(Qt6Network) |
59 |
BuildRequires: pkgconfig(Qt6Widgets) |
60 |
#BuildRequires: pkgconfig(Qt6WebKit) |
61 |
BuildRequires: web-assets-devel |
62 |
BuildRequires: pkgconfig(xrender) |
63 |
BuildRequires: pkgconfig(libsystemd) |
64 |
BuildRequires: pkgconfig(openssl) |
65 |
# calibre installer is so smart that it check for the presence of the |
66 |
# directory (and then installs in the wrong place) |
67 |
BuildRequires: bash-completion |
68 |
BuildRequires: python3dist(apsw) |
69 |
BuildRequires: pkgconfig(glib-2.0) |
70 |
BuildRequires: pkgconfig(fontconfig) |
71 |
BuildRequires: pkgconfig(libinput) |
72 |
BuildRequires: pkgconfig(xkbcommon) |
73 |
BuildRequires: python3dist(mechanize) |
74 |
BuildRequires: python3dist(lxml) |
75 |
BuildRequires: python3dist(python-dateutil) |
76 |
BuildRequires: python3dist(pillow) |
77 |
BuildRequires: python3dist(css-parser) |
78 |
BuildRequires: python3dist(feedparser) |
79 |
BuildRequires: python3dist(netifaces) |
80 |
BuildRequires: python3dist(beautifulsoup4) |
81 |
BuildRequires: python3dist(psutil) |
82 |
BuildRequires: python3dist(pygments) |
83 |
BuildRequires: python3dist(soupsieve) |
84 |
BuildRequires: python3dist(msgpack) |
85 |
BuildRequires: python3dist(regex) |
86 |
BuildRequires: python3dist(html5-parser) >= 0.4.8 |
87 |
BuildRequires: python3dist(html2text) |
88 |
BuildRequires: python3dist(zeroconf) |
89 |
BuildRequires: python3dist(markdown) >= 3.0 |
90 |
BuildRequires: pkgconfig(appstream-glib) |
91 |
BuildRequires: libstemmer-devel |
92 |
BuildRequires: qtimageformats6-devel |
93 |
#BuildRequires: qt6themesupport-devel |
94 |
#BuildRequires: qt6fontdatabasesupport-devel |
95 |
#BuildRequires: qt6servicesupport-devel |
96 |
#BuildRequires: qt6eventdispatchersupport-devel |
97 |
BuildRequires: html2text |
98 |
BuildRequires: pkgconfig(hunspell) |
99 |
# Required for tests |
100 |
#BuildRequires: fonts-ttf-liberation |
101 |
#BuildRequires: jpeg-progs |
102 |
#BuildRequires: optipng |
103 |
#BuildRequires: jxrlib-devel |
104 |
#BuildRequires: pkgconfig(Qt5WebEngine) |
105 |
BuildRequires: hyphen-devel |
106 |
BuildRequires: pkgconfig(uchardet) |
107 |
BuildRequires: chrpath |
108 |
|
109 |
%{?pyqt6_requires} |
110 |
|
111 |
Requires: python3-dbus |
112 |
Requires: python3-qt6 |
113 |
Requires: python3-qt6-core |
114 |
Requires: python3-qt6-webenginecore |
115 |
Requires: python3-qt6-webenginewidgets |
116 |
Requires: python3dist(css-parser) |
117 |
Requires: python3dist(odfpy) |
118 |
Requires: python3dist(lxml) |
119 |
Requires: python3dist(pillow) |
120 |
Requires: python3dist(mechanize) |
121 |
Requires: python3dist(python-dateutil) |
122 |
Requires: python3dist(beautifulsoup4) |
123 |
Requires: poppler |
124 |
# Require the packages of the files which are symlinked by calibre |
125 |
Requires: fonts-ttf-liberation |
126 |
Requires: python3dist(netifaces) |
127 |
Requires: python3dist(dnspython) |
128 |
Requires: python3dist(apsw) |
129 |
Requires: mathjax |
130 |
Requires: python3dist(psutil) |
131 |
Requires: python3dist(pygments) |
132 |
Requires: optipng |
133 |
Requires: python3dist(msgpack) |
134 |
Requires: python3dist(regex) |
135 |
Requires: python3dist(html5-parser) |
136 |
Requires: python3dist(six) |
137 |
Requires: python3dist(zeroconf) |
138 |
Requires: python3dist(markdown) |
139 |
Requires: python3dist(feedparser) |
140 |
Requires: python3dist(soupsieve) |
141 |
Requires: jpeg-progs |
142 |
Requires: python3-jeepney |
143 |
|
144 |
%description |
145 |
Calibre is meant to be a complete e-library solution. It includes library |
146 |
management, format conversion, news feeds to ebook conversion as well as |
147 |
e-book reader sync features. |
148 |
|
149 |
Calibre is primarily a ebook cataloging program. It manages your ebook |
150 |
collection for you. It is designed around the concept of the logical book, |
151 |
i.e. a single entry in the database that may correspond to ebooks in several |
152 |
formats. It also supports conversion to and from a dozen different ebook |
153 |
formats. |
154 |
|
155 |
Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ, |
156 |
RTF, TXT, PDF and LRS. |
157 |
|
158 |
%prep |
159 |
%autosetup -p1 |
160 |
|
161 |
# remove redundant / non-free fonts |
162 |
rm -rf resources/fonts/*/ |
163 |
|
164 |
# dos2unix newline conversion |
165 |
sed -i -e 's/\r//' src/calibre/web/feeds/recipes/* |
166 |
|
167 |
# fix the location of liberation default font |
168 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
169 |
src/calibre/utils/magick/draw.py |
170 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
171 |
src/calibre/library/catalogs/epub_mobi_builder.py |
172 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
173 |
src/calibre/ebooks/oeb/polish/tests/base.py |
174 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
175 |
src/calibre/ebooks/__init__.py |
176 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
177 |
src/calibre/web/feeds/news.py |
178 |
sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \ |
179 |
recipes/*_ke.recipe |
180 |
|
181 |
# remove shebangs |
182 |
sed -i -e '/^#!\//, 1d' src/calibre/*/*/*/*/*.py |
183 |
sed -i -e '/^#!\//, 1d' src/calibre/*/*/*/*.py |
184 |
sed -i -e '/^#!\//, 1d' src/calibre/*/*/*.py |
185 |
sed -i -e '/^#![ ]*\//, 1d' src/calibre/*/*.py |
186 |
sed -i -e '/^#!\//, 1d' src/calibre/*.py |
187 |
sed -i -e '/^#!\//, 1d' src/css_selectors/*.py |
188 |
sed -i -e '/^#!\//, 1d' src/polyglot/*.py |
189 |
sed -i -e '/^#!\//, 1d' src/templite/*.py |
190 |
sed -i -e '/^#!\//, 1d' src/tinycss/*/*.py |
191 |
sed -i -e '/^#!\//, 1d' src/tinycss/*.py |
192 |
sed -i -e '/^#!\//, 1d' resources/default_tweaks.py |
193 |
|
194 |
# libdir |
195 |
sed -i -e 's,/usr/lib,%{_libdir},g' setup/build_environment.py |
196 |
|
197 |
chmod -x src/calibre/*/*/*/*.py |
198 |
chmod -x src/calibre/*/*/*.py |
199 |
chmod -x src/calibre/*/*.py |
200 |
chmod -x src/calibre/*.py |
201 |
chmod -x recipes/*.recipe |
202 |
|
203 |
# use system mspack (mga#15218) |
204 |
rm -f src/calibre/utils/lzx/mspack.h |
205 |
sed -i 's| calibre/utils/lzx/mspack.h||' setup/extensions.json |
206 |
|
207 |
%build |
208 |
# The setup.py file doesn't like the --executable option set with |
209 |
# %%py3_build. That's why we use this operation. |
210 |
export OVERRIDE_CFLAGS="%{optflags}" |
211 |
CALIBRE_PY3_PORT=1 \ |
212 |
%__python3 setup.py build |
213 |
|
214 |
chrpath -d src/calibre/plugins/progress_indicator.so |
215 |
chrpath -d src/calibre/plugins/rcc_backend.so |
216 |
chrpath -d src/calibre/plugins/imageops.so |
217 |
chrpath -d src/calibre/plugins/pictureflow.so |
218 |
|
219 |
%install |
220 |
mkdir -p %{buildroot}%{_datadir} |
221 |
|
222 |
# create directories for xdg-utils |
223 |
mkdir -p %{buildroot}%{_datadir}/icons |
224 |
mkdir -p %{buildroot}%{_datadir}/icons/hicolor |
225 |
mkdir -p %{buildroot}%{_datadir}/packages |
226 |
mkdir -p %{buildroot}%{_datadir}/mime |
227 |
mkdir -p %{buildroot}%{_datadir}/mime/packages |
228 |
mkdir -p %{buildroot}%{_datadir}/applications |
229 |
mkdir -p %{buildroot}%{_datadir}/desktop-directories |
230 |
|
231 |
# create directory for calibre environment module |
232 |
# the install script assumes it's there. |
233 |
mkdir -p %{buildroot}%{python3_sitearch} |
234 |
|
235 |
# create directory for completion files, so calibre knows where |
236 |
# to install them |
237 |
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions |
238 |
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions |
239 |
|
240 |
XDG_DATA_DIRS="%{buildroot}%{_datadir}" \ |
241 |
XDG_UTILS_INSTALL_MODE="system" \ |
242 |
LIBPATH="%{_libdir}" \ |
243 |
CALIBRE_PY3_PORT=1 \ |
244 |
%__python3 setup.py install --root=%{buildroot}%{_prefix} \ |
245 |
--prefix=%{_prefix} \ |
246 |
--libdir=%{_libdir} \ |
247 |
--staging-libdir=%{buildroot}%{_libdir} \ |
248 |
|
249 |
# remove shebang from init_calibre.py here because |
250 |
# it just got spawned by the install script |
251 |
sed -i -e '/^#!\//, 1d' %{buildroot}%{python3_sitearch}/init_calibre.py |
252 |
|
253 |
# icons |
254 |
mkdir -p %{buildroot}%{_datadir}/pixmaps/ |
255 |
cp -p resources/images/library.png \ |
256 |
%{buildroot}%{_datadir}/pixmaps/calibre-gui.png |
257 |
cp -p resources/images/viewer.png \ |
258 |
%{buildroot}%{_datadir}/pixmaps/calibre-viewer.png |
259 |
cp -p resources/images/tweak.png \ |
260 |
%{buildroot}%{_datadir}/pixmaps/calibre-ebook-edit.png |
261 |
|
262 |
# every file is empty here |
263 |
find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs rm -f |
264 |
|
265 |
# the portable batch (>=0.8.5) is not needed |
266 |
rm -f %{buildroot}%{_bindir}/calibre-portable.bat |
267 |
|
268 |
# packages aren't allowed to register mimetypes like this |
269 |
rm -f %{buildroot}%{_datadir}/applications/defaults.list |
270 |
rm -f %{buildroot}%{_datadir}/applications/mimeinfo.cache |
271 |
rm -f %{buildroot}%{_datadir}/mime/application/*.xml |
272 |
rm -f %{buildroot}%{_datadir}/mime/text/*.xml |
273 |
|
274 |
# mimetype icon for lrf |
275 |
rm -rf %{buildroot}%{_datadir}/icons/hicolor/128x128 |
276 |
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable |
277 |
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes |
278 |
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps |
279 |
cp -p resources/images/mimetypes/lrf.png \ |
280 |
%{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.png |
281 |
cp -p resources/images/viewer.png \ |
282 |
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.png |
283 |
|
284 |
# these are provided as separate packages |
285 |
rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,css-parser} |
286 |
rm -rf %{buildroot}%{_libdir}/%{name}/cal/utils/genshi |
287 |
rm -rf %{buildroot}%{_libdir}/%{name}/cal/trac |
288 |
|
289 |
# link to system fonts after we have deleted the non-free ones |
290 |
# http://oldbugs.calibre-ebook.com/ticket/3832 |
291 |
mkdir -p %{buildroot}%{_datadir}/%{name}/fonts/prs500 |
292 |
ln -s %{_datadir}/fonts/TTF/liberation/LiberationSans-Regular.ttf \ |
293 |
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf |
294 |
ln -s %{_datadir}/fonts/TTF/liberation/LiberationSerif-Regular.ttf \ |
295 |
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf |
296 |
ln -s %{_datadir}/fonts/TTF/liberation/LiberationMono-Regular.ttf \ |
297 |
%{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf |
298 |
|
299 |
# localization has changed since calibre-0.8.5 |
300 |
# locale.zip is treated internally at runtime |
301 |
# so the traditional locale fixes are moot. |
302 |
# locales should still be looked for in the proper place |
303 |
# but under the new localization zip-based schema |
304 |
sed -i -e 's:localization/locale.zip:%{_datadir}/%{name}/localization/locales.zip:' %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py |
305 |
|
306 |
rm -f %{buildroot}%{_bindir}/%{name}-uninstall |
307 |
|
308 |
cp -a %{SOURCE2} %{buildroot}%{_bindir}/ |
309 |
|
310 |
%if 0 |
311 |
%check |
312 |
# skip failing tests: |
313 |
# - unrar (missing dependencies) |
314 |
# - bonjour (problems in mock) |
315 |
# - 7z (missing dependencies) |
316 |
# - qt (fails on 32-bit architectures only) |
317 |
# - test_searching (python3 porting issue?) |
318 |
CALIBRE_PY3_PORT=1 \ |
319 |
%{__python3} setup.py test \ |
320 |
--exclude-test-name unrar \ |
321 |
--exclude-test-name bonjour \ |
322 |
--exclude-test-name 7z \ |
323 |
--exclude-test-name test_searching \ |
324 |
--exclude-test-name test_html2text_behavior \ |
325 |
%ifarch %{ix86} armv7hl x86_64 |
326 |
--exclude-test-name qt |
327 |
%endif |
328 |
%endif |
329 |
|
330 |
%files |
331 |
%license LICENSE |
332 |
%doc Changelog.txt COPYRIGHT README.md |
333 |
%{_bindir}/calibre |
334 |
%{_bindir}/calibre-complete |
335 |
%{_bindir}/calibre-customize |
336 |
%{_bindir}/calibre-debug |
337 |
%{_bindir}/calibre-parallel |
338 |
%{_bindir}/calibre-server |
339 |
%{_bindir}/calibre-smtp |
340 |
%{_bindir}/calibre-mount-helper |
341 |
%{_bindir}/calibredb |
342 |
%{_bindir}/ebook-convert |
343 |
%{_bindir}/ebook-device |
344 |
%{_bindir}/ebook-edit |
345 |
%{_bindir}/ebook-meta |
346 |
%{_bindir}/ebook-polish |
347 |
%{_bindir}/ebook-viewer |
348 |
%{_bindir}/fetch-ebook-metadata |
349 |
%{_bindir}/lrf2lrs |
350 |
%{_bindir}/lrfviewer |
351 |
%{_bindir}/lrs2lrf |
352 |
%{_bindir}/markdown-calibre |
353 |
%{_bindir}/web2disk |
354 |
%{_datadir}/bash-completion/completions/%%{name}* |
355 |
%{_datadir}/bash-completion/completions/*ebook* |
356 |
%{_datadir}/bash-completion/completions/lrf2lrs |
357 |
%{_datadir}/bash-completion/completions/lrfviewer |
358 |
%{_datadir}/zsh/site-functions/_%%{name} |
359 |
%{_libdir}/%{name} |
360 |
%{_datadir}/%{name} |
361 |
%{_datadir}/pixmaps/* |
362 |
%{_datadir}/applications/*.desktop |
363 |
%{_datadir}/mime/packages/* |
364 |
%{_datadir}/icons/hicolor/*/apps/* |
365 |
%{_datadir}/icons/hicolor/*/mimetypes/* |
366 |
%{_datadir}/metainfo/%{name}-*.metainfo.xml |
367 |
%{python3_sitearch}/init_calibre.py |
368 |
%{python3_sitearch}/__pycache__/init_calibre.*.py* |