/[packages]/cauldron/calibre/current/SPECS/calibre.spec
ViewVC logotype

Annotation of /cauldron/calibre/current/SPECS/calibre.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1917263 - (hide annotations) (download)
Sun Dec 4 06:17:20 2022 UTC (22 months ago) by danf
File size: 13457 byte(s)
SILENT: Switch URLs to https:
1 tarakbumba 942206 Name: calibre
2 kekepower 1910976 Version: 6.9.0
3     Release: %mkrel 1
4 tarakbumba 990089 Summary: E-book converter and library management
5 tarakbumba 942206 Group: Office/Utilities
6     License: GPLv3
7 danf 1917263 URL: https://calibre-ebook.com/
8 tv 1785183 Source0: https://download.calibre-ebook.com/%{version}/calibre-%{version}.tar.xz
9 tarakbumba 796153 Source2: %{name}-mount-helper
10 tarakbumba 804342 # 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 tv 1775355 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 tarakbumba 803213
17 kekepower 1907196 # Qt6Webengine and python3-qt6-webenginecore is not available on aarch64 and arm
18     ExclusiveArch: x86_64 %{ix86}
19    
20 neoclust 1764147 #
21     # Security patches
22     # P100 -> ...
23     #
24 kekepower 1393394 # Kovid keeps updating the requirements
25     # Here is an updated list
26     # https://github.com/kovidgoyal/build-calibre/blob/master/scripts/sources.json
27 tv 1436131 BuildRequires: python3
28 kekepower 1860468 BuildRequires: python3dist(sip)
29 kekepower 1883588 BuildRequires: python3-pyqt6-sip
30 tv 1436131 BuildRequires: pkgconfig(python3)
31     BuildRequires: python3dist(setuptools)
32 kekepower 1883588 BuildRequires: python3dist(sip) >= 6
33 tv 1775427 BuildRequires: python3dist(pyqt-builder)
34 tv 1775355 BuildRequires: python3dist(pychm)
35 tv 1775759 #BuildRequires: python3dist(pycrypto)
36     BuildRequires: python3dist(pycryptodome)
37 tv 1775355 BuildRequires: python3dist(cchardet)
38     BuildRequires: python3dist(sgmllib3k)
39 tv 1775429 BuildRequires: python3-speechd
40     BuildRequires: python3-jeepney
41 kekepower 1883588 BuildRequires: python3-qt6-devel
42 guillomovitch 1903763 BuildRequires: python3-qt6-webenginecore
43     BuildRequires: python3-qt6-webenginewidgets
44 kekepower 1883588 BuildRequires: python3-qt6-widgets
45 daviddavid 1581940 BuildRequires: pkgconfig(libpodofo)
46 kekepower 1327765 BuildRequires: desktop-file-utils
47     BuildRequires: xdg-utils
48     BuildRequires: chmlib-devel
49 tv 1436131 BuildRequires: python3-cssutils >= 0.9.9
50 kekepower 1327765 BuildRequires: pkgconfig(sqlite3)
51     BuildRequires: icu-devel
52     BuildRequires: pkgconfig(libpng)
53 daviddavid 1488889 BuildRequires: pkgconfig(libmspack)
54 kekepower 1327765 BuildRequires: pkgconfig(libmtp)
55 kekepower 1883588 BuildRequires: pkgconfig(Qt6Core)
56     BuildRequires: pkgconfig(Qt6DBus)
57     BuildRequires: pkgconfig(Qt6Gui)
58     BuildRequires: pkgconfig(Qt6Network)
59     BuildRequires: pkgconfig(Qt6Widgets)
60     #BuildRequires: pkgconfig(Qt6WebKit)
61 kekepower 1327765 BuildRequires: web-assets-devel
62     BuildRequires: pkgconfig(xrender)
63 danf 1779318 BuildRequires: pkgconfig(libsystemd)
64 kekepower 1327765 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 kekepower 1907210 BuildRequires: bash-completion
68 tv 1436131 BuildRequires: python3dist(apsw)
69 kekepower 1327765 BuildRequires: pkgconfig(glib-2.0)
70     BuildRequires: pkgconfig(fontconfig)
71     BuildRequires: pkgconfig(libinput)
72     BuildRequires: pkgconfig(xkbcommon)
73 tv 1436131 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 guillomovitch 1789246 BuildRequires: python3dist(zeroconf)
89 tv 1436131 BuildRequires: python3dist(markdown) >= 3.0
90 kekepower 1327765 BuildRequires: pkgconfig(appstream-glib)
91 tv 1775429 BuildRequires: libstemmer-devel
92 kekepower 1883588 BuildRequires: qtimageformats6-devel
93     #BuildRequires: qt6themesupport-devel
94     #BuildRequires: qt6fontdatabasesupport-devel
95     #BuildRequires: qt6servicesupport-devel
96     #BuildRequires: qt6eventdispatchersupport-devel
97 kekepower 1393394 BuildRequires: html2text
98 kekepower 1449220 BuildRequires: pkgconfig(hunspell)
99 kekepower 1789299 # Required for tests
100 kekepower 1789436 #BuildRequires: fonts-ttf-liberation
101     #BuildRequires: jpeg-progs
102     #BuildRequires: optipng
103     #BuildRequires: jxrlib-devel
104     #BuildRequires: pkgconfig(Qt5WebEngine)
105 kekepower 1883588 BuildRequires: hyphen-devel
106     BuildRequires: pkgconfig(uchardet)
107     BuildRequires: chrpath
108 kekepower 1327765
109 kekepower 1883588 %{?pyqt6_requires}
110 kekepower 1327765
111 tv 1436131 Requires: python3-dbus
112 kekepower 1883588 Requires: python3-qt6
113     Requires: python3-qt6-core
114 guillomovitch 1903763 Requires: python3-qt6-webenginecore
115     Requires: python3-qt6-webenginewidgets
116 tv 1436131 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 kekepower 1327765 Requires: poppler
124 dmorgan 111989 # Require the packages of the files which are symlinked by calibre
125 kekepower 1327765 Requires: fonts-ttf-liberation
126 tv 1436131 Requires: python3dist(netifaces)
127     Requires: python3dist(dnspython)
128     Requires: python3dist(apsw)
129 kekepower 1327765 Requires: mathjax
130 tv 1436131 Requires: python3dist(psutil)
131     Requires: python3dist(pygments)
132 kekepower 1327765 Requires: optipng
133 tv 1436131 Requires: python3dist(msgpack)
134     Requires: python3dist(regex)
135     Requires: python3dist(html5-parser)
136     Requires: python3dist(six)
137 guillomovitch 1789246 Requires: python3dist(zeroconf)
138 tv 1436131 Requires: python3dist(markdown)
139     Requires: python3dist(feedparser)
140     Requires: python3dist(soupsieve)
141 tv 1775430 Requires: jpeg-progs
142 tv 1775429 Requires: python3-jeepney
143 blino 78038
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 dmorgan 111989 Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ,
156     RTF, TXT, PDF and LRS.
157 blino 78038
158     %prep
159 tarakbumba 804342 %autosetup -p1
160 blino 78038
161     # remove redundant / non-free fonts
162 tv 315328 rm -rf resources/fonts/*/
163 blino 78038
164     # dos2unix newline conversion
165 tarakbumba 796153 sed -i -e 's/\r//' src/calibre/web/feeds/recipes/*
166 blino 78038
167 dmorgan 111989 # fix the location of liberation default font
168 tarakbumba 796153 sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \
169 dmorgan 111989 src/calibre/utils/magick/draw.py
170 tarakbumba 796153 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 dmorgan 111989 src/calibre/web/feeds/news.py
178 tarakbumba 796153 sed -i -e "s:P('fonts/liberation/Liberation:('%{_datadir}/fonts/TTF/liberation/Liberation:" \
179 dmorgan 111989 recipes/*_ke.recipe
180    
181 blino 78038 # remove shebangs
182 tv 1775435 sed -i -e '/^#!\//, 1d' src/calibre/*/*/*/*/*.py
183 tarakbumba 796153 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 tv 1775435 sed -i -e '/^#!\//, 1d' src/css_selectors/*.py
188     sed -i -e '/^#!\//, 1d' src/polyglot/*.py
189 tarakbumba 796153 sed -i -e '/^#!\//, 1d' src/templite/*.py
190 tv 1775435 sed -i -e '/^#!\//, 1d' src/tinycss/*/*.py
191     sed -i -e '/^#!\//, 1d' src/tinycss/*.py
192 tarakbumba 796153 sed -i -e '/^#!\//, 1d' resources/default_tweaks.py
193 blino 78038
194 wally 1243561 # libdir
195     sed -i -e 's,/usr/lib,%{_libdir},g' setup/build_environment.py
196    
197 tarakbumba 796153 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 blino 78038
203 daviddavid 1488889 # 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 blino 78038 %build
208 kekepower 1327765 # The setup.py file doesn't like the --executable option set with
209 daviddavid 1436287 # %%py3_build. That's why we use this operation.
210 kekepower 1327765 export OVERRIDE_CFLAGS="%{optflags}"
211 tv 1436131 CALIBRE_PY3_PORT=1 \
212     %__python3 setup.py build
213 blino 78038
214 kekepower 1883588 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 blino 78038 %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 dmorgan 111989
231     # create directory for calibre environment module
232     # the install script assumes it's there.
233 tv 1775355 mkdir -p %{buildroot}%{python3_sitearch}
234 dmorgan 111989
235 tarakbumba 796153 # create directory for completion files, so calibre knows where
236     # to install them
237 kekepower 1907210 mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
238 kekepower 1902449 mkdir -p %{buildroot}%{_datadir}/zsh/site-functions
239 tarakbumba 796153
240 blino 78038 XDG_DATA_DIRS="%{buildroot}%{_datadir}" \
241     XDG_UTILS_INSTALL_MODE="system" \
242     LIBPATH="%{_libdir}" \
243 tv 1436131 CALIBRE_PY3_PORT=1 \
244     %__python3 setup.py install --root=%{buildroot}%{_prefix} \
245 tarakbumba 796153 --prefix=%{_prefix} \
246     --libdir=%{_libdir} \
247     --staging-libdir=%{buildroot}%{_libdir} \
248 kekepower 1327765
249 dmorgan 111989 # remove shebang from init_calibre.py here because
250     # it just got spawned by the install script
251 tv 1775355 sed -i -e '/^#!\//, 1d' %{buildroot}%{python3_sitearch}/init_calibre.py
252 blino 78038
253     # icons
254     mkdir -p %{buildroot}%{_datadir}/pixmaps/
255 tarakbumba 796153 cp -p resources/images/library.png \
256 tv 1775482 %{buildroot}%{_datadir}/pixmaps/calibre-gui.png
257 tarakbumba 796153 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 blino 78038
262     # every file is empty here
263 wally 611997 find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs rm -f
264 blino 78038
265 dmorgan 111989 # the portable batch (>=0.8.5) is not needed
266     rm -f %{buildroot}%{_bindir}/calibre-portable.bat
267    
268 blino 78038 # packages aren't allowed to register mimetypes like this
269 dmorgan 111989 rm -f %{buildroot}%{_datadir}/applications/defaults.list
270     rm -f %{buildroot}%{_datadir}/applications/mimeinfo.cache
271 dams 296834 rm -f %{buildroot}%{_datadir}/mime/application/*.xml
272     rm -f %{buildroot}%{_datadir}/mime/text/*.xml
273 blino 78038
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 dmorgan 111989 %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.png
281 blino 78038 cp -p resources/images/viewer.png \
282 dmorgan 111989 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.png
283 blino 78038
284     # these are provided as separate packages
285 kekepower 1357945 rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,css-parser}
286 blino 78038 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 dmorgan 111989 # http://oldbugs.calibre-ebook.com/ticket/3832
291     mkdir -p %{buildroot}%{_datadir}/%{name}/fonts/prs500
292 blino 78038 ln -s %{_datadir}/fonts/TTF/liberation/LiberationSans-Regular.ttf \
293 dmorgan 111989 %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf
294 blino 78038 ln -s %{_datadir}/fonts/TTF/liberation/LiberationSerif-Regular.ttf \
295 dmorgan 111989 %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf
296 blino 78038 ln -s %{_datadir}/fonts/TTF/liberation/LiberationMono-Regular.ttf \
297 dmorgan 111989 %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf
298 blino 78038
299 dmorgan 111989 # 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 tarakbumba 1012237 sed -i -e 's:localization/locale.zip:%{_datadir}/%{name}/localization/locales.zip:' %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py
305 blino 78038
306 tarakbumba 796153 rm -f %{buildroot}%{_bindir}/%{name}-uninstall
307 blino 78038
308 tarakbumba 796153 cp -a %{SOURCE2} %{buildroot}%{_bindir}/
309 blino 78038
310 kekepower 1789436 %if 0
311 guillomovitch 1789246 %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 kekepower 1789436 %ifarch %{ix86} armv7hl x86_64
326 guillomovitch 1789246 --exclude-test-name qt
327     %endif
328 kekepower 1789436 %endif
329 tarakbumba 796153
330     %files
331 tv 1775437 %license LICENSE
332     %doc Changelog.txt COPYRIGHT README.md
333 tarakbumba 796153 %{_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 tv 1775436 %{_bindir}/ebook-edit
345 tarakbumba 796153 %{_bindir}/ebook-meta
346 tv 1775436 %{_bindir}/ebook-polish
347 tarakbumba 796153 %{_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 kekepower 1907210 %{_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 tarakbumba 796153 %{_libdir}/%{name}
360     %{_datadir}/%{name}
361     %{_datadir}/pixmaps/*
362     %{_datadir}/applications/*.desktop
363     %{_datadir}/mime/packages/*
364     %{_datadir}/icons/hicolor/*/apps/*
365 tarakbumba 885620 %{_datadir}/icons/hicolor/*/mimetypes/*
366 tv 1775355 %{_datadir}/metainfo/%{name}-*.metainfo.xml
367     %{python3_sitearch}/init_calibre.py
368     %{python3_sitearch}/__pycache__/init_calibre.*.py*

  ViewVC Help
Powered by ViewVC 1.1.30