]>
Commit | Line | Data |
---|---|---|
17e051e1 | 1 | # |
81537047 | 2 | # TODO: - rewrite generate-tarball.sh script to provide locales.zip handling (if needed) |
4279cd82 | 3 | # - make separate server package with init-scripts, etc... |
b856ebb4 | 4 | # |
17e051e1 | 5 | # NOTE: |
7261ec00 | 6 | # Upstream packages contain some non-free fonts which we cannot redistribute, |
17e051e1 | 7 | # so when upgrading calibre we should download upstream tarball by hand from |
8a61eab7 | 8 | # https://download.calibre-ebook.com/ and run generate-tarball.sh script |
3c9d3d2b | 9 | # included as SourceX. |
17e051e1 | 10 | # |
02229893 | 11 | Summary: E-book converter and library management |
cee72504 | 12 | Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków |
0e501b81 | 13 | Name: calibre |
4d780bcf JR |
14 | Version: 6.23.0 |
15 | Release: 1 | |
6d15f615 | 16 | License: GPL v3+ |
02229893 | 17 | Group: Applications/Multimedia |
1068761e | 18 | Source0: %{name}-%{version}-nofonts.tar.xz |
4d780bcf | 19 | # Source0-md5: e0a8b9d98f888d1996e3a594edf13cb5 |
3c9d3d2b | 20 | Source1: generate-tarball.sh |
5cf7f03b | 21 | Source2: %{name}-mount-helper |
0e501b81 | 22 | Patch0: %{name}-prefix.patch |
fe8c5b5e ŁM |
23 | Patch1: %{name}-locales.patch |
24 | Patch2: shebang-python-fix.patch | |
25 | Patch3: desktop-integration.patch | |
43b56935 | 26 | Patch4: %{name}-env_module.patch |
824729ab AF |
27 | %define baeutifulsoup_ver 3.0.5 |
28 | %define pil_ver 1.1.6 | |
54faabcd | 29 | %define pyqt6_ver 6.3.1 |
88ce68b2 | 30 | %define apsw_ver 3.38.0 |
824729ab AF |
31 | %define cssselect_ver 0.7.1 |
32 | %define cssutils_ver 1:0.9.9 | |
33 | %define dateutil_ver 1.4.1 | |
34 | %define dns_ver 1.6.0 | |
35 | %define lxml_ver 2.2.1 | |
36 | %define mechanize_ver 0.1.11 | |
43b56935 | 37 | %define msgpack_ver 1.0.0 |
824729ab AF |
38 | %define netifaces_ver 0.8 |
39 | %define psutil_ver 0.6.1 | |
073fc0d3 | 40 | URL: https://calibre-ebook.com/ |
3b8cf9a9 | 41 | BuildRequires: ImageMagick-devel >= 6.6.4.7 |
54faabcd JR |
42 | BuildRequires: Qt6Core-devel |
43 | BuildRequires: Qt6DBus-devel | |
44 | BuildRequires: Qt6Gui-devel | |
45 | BuildRequires: Qt6WebEngine-devel | |
46 | BuildRequires: Qt6Widgets-devel | |
591b7d3d | 47 | BuildRequires: chmlib-devel >= 0.40 |
fe8c5b5e | 48 | BuildRequires: hunspell-devel |
4602aede | 49 | BuildRequires: hyphen-devel |
212c1324 | 50 | BuildRequires: libicu-devel |
389ef12d | 51 | BuildRequires: libinput-devel |
591b7d3d MB |
52 | BuildRequires: libmtp-devel >= 1.1.5 |
53 | BuildRequires: libwmf-devel >= 0.2.8 | |
f4da95e9 | 54 | BuildRequires: mtdev-devel |
f0879852 | 55 | BuildRequires: pkgconfig |
591b7d3d | 56 | BuildRequires: podofo-devel >= 0.8.2 |
f4da95e9 | 57 | BuildRequires: poppler-glib-devel >= 0.28.1 |
54faabcd JR |
58 | BuildRequires: poppler-qt6-devel >= 0.28.1 |
59 | BuildRequires: python3-PyQt6-devel-tools >= %{pyqt6_ver} | |
49a96cf0 | 60 | BuildRequires: python3-PyQt-builder |
54faabcd JR |
61 | BuildRequires: python3-PyQt6 >= %{pyqt6_ver} |
62 | BuildRequires: python3-PyQt6-uic >= %{pyqt6_ver} | |
63 | BuildRequires: python3-PyQt6-WebEngine | |
fd5ce78b | 64 | BuildRequires: python3-apsw >= %{apsw_ver} |
b0d52b63 | 65 | BuildRequires: python3-bs4 >= %{baeutifulsoup_ver} |
fd5ce78b JR |
66 | BuildRequires: python3-css_parser |
67 | BuildRequires: python3-cssselect >= %{cssselect_ver} | |
68 | BuildRequires: python3-cssutils >= %{cssutils_ver} | |
69 | BuildRequires: python3-dateutil >= %{dateutil_ver} | |
70 | BuildRequires: python3-devel >= 1:2.7.1 | |
71 | BuildRequires: python3-dns >= %{dns_ver} | |
49a96cf0 | 72 | #BuildRequires: python3-genshi |
fd5ce78b | 73 | BuildRequires: python3-html5-parser |
ede0a15a | 74 | BuildRequires: python3-jeepney |
fd5ce78b | 75 | BuildRequires: python3-lxml >= %{lxml_ver} |
b0d52b63 | 76 | BuildRequires: python3-mechanize >= %{mechanize_ver} |
fd5ce78b JR |
77 | BuildRequires: python3-msgpack >= %{msgpack_ver} |
78 | BuildRequires: python3-netifaces >= %{netifaces_ver} | |
b0d52b63 | 79 | BuildRequires: python3-pillow >= %{pil_ver} |
fd5ce78b JR |
80 | BuildRequires: python3-psutil >= %{psutil_ver} |
81 | BuildRequires: python3-regex | |
54faabcd | 82 | BuildRequires: qt6-build |
073fc0d3 | 83 | BuildRequires: rpm-build >= 4.6 |
0e501b81 | 84 | BuildRequires: rpm-pythonprov |
073fc0d3 | 85 | BuildRequires: rpmbuild(macros) >= 1.714 |
ddb4b081 | 86 | BuildRequires: sed >= 4.0 |
b0d52b63 | 87 | BuildRequires: sip6 |
54faabcd | 88 | BuildRequires: sip-PyQt6 >= %{pyqt6_ver} |
43b56935 | 89 | BuildRequires: sqlite3-devel |
23304c7f | 90 | BuildRequires: tar >= 1:1.22 |
f6f5b3d6 | 91 | BuildRequires: unzip |
3c9d3d2b | 92 | BuildRequires: xdg-utils |
23304c7f | 93 | BuildRequires: xz >= 1:4.999.7 |
54faabcd JR |
94 | Requires: Qt6Svg |
95 | Requires: Qt6WebEngine | |
96 | Requires: python3-PyQt6 >= %{pyqt6_ver} | |
97 | Requires: python3-PyQt6-WebEngine | |
2efc6790 | 98 | Requires: python3-apsw >= %{apsw_ver} |
b0d52b63 | 99 | Requires: python3-bs4 >= %{baeutifulsoup_ver} |
2efc6790 JR |
100 | Requires: python3-css_parser |
101 | Requires: python3-cssselect >= %{cssselect_ver} | |
102 | Requires: python3-cssutils >= %{cssutils_ver} | |
103 | Requires: python3-dateutil >= %{dateutil_ver} | |
104 | Requires: python3-dns >= %{dns_ver} | |
105 | #Requires: python3-genshi | |
106 | Requires: python3-html5-parser | |
ede0a15a | 107 | Requires: python3-jeepney |
2efc6790 | 108 | Requires: python3-lxml >= %{lxml_ver} |
b0d52b63 | 109 | Requires: python3-mechanize >= %{mechanize_ver} |
2efc6790 JR |
110 | Requires: python3-msgpack >= %{msgpack_ver} |
111 | Requires: python3-netifaces >= %{netifaces_ver} | |
b0d52b63 | 112 | Requires: python3-pillow >= %{pil_ver} |
2efc6790 JR |
113 | Requires: python3-psutil >= %{psutil_ver} |
114 | Requires: python3-regex | |
b0073032 | 115 | Suggests: ImageMagick-coder-jpeg |
116 | Suggests: ImageMagick-coder-png | |
400a540b PG |
117 | ### FIXME: libunrar.so is needed for rar-packed files |
118 | Suggests: libunrar-devel | |
b0073032 | 119 | Suggests: poppler-progs |
0e501b81 | 120 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
121 | ||
122 | %description | |
02229893 ER |
123 | Calibre is meant to be a complete e-library solution. It includes |
124 | library management, format conversion, news feeds to ebook conversion | |
125 | as well as e-book reader sync features. | |
126 | ||
127 | Calibre is primarily a ebook cataloging program. It manages your ebook | |
128 | collection for you. It is designed around the concept of the logical | |
129 | book, i.e. a single entry in the database that may correspond to | |
130 | ebooks in several formats. It also supports conversion to and from a | |
131 | dozen different ebook formats. | |
132 | ||
133 | Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, | |
134 | CBR, CBZ, RTF, TXT, PDF and LRS. | |
0e501b81 | 135 | |
cee72504 | 136 | %description -l pl.UTF-8 |
137 | Calibre to bardzo dobry i darmowy program do czytania e-książek. | |
138 | ||
139 | Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu | |
140 | formatów do ich postaci. Program obsługuje następujące typy plików: | |
141 | import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML | |
142 | eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza. | |
143 | ||
144 | Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i | |
145 | najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy | |
146 | dołączyli również aplikację, którą użytkownik może wykorzystać jako | |
147 | swój własny serwer darmowych książek. | |
148 | ||
888e3f00 JR |
149 | %package -n bash-completion-calibre |
150 | Summary: bash-completion for calibre | |
151 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre | |
152 | Group: Applications/Shells | |
153 | Requires: %{name} = %{version}-%{release} | |
154 | Requires: bash-completion | |
888e3f00 | 155 | BuildArch: noarch |
888e3f00 JR |
156 | |
157 | %description -n bash-completion-calibre | |
158 | bash-completion for calibre. | |
159 | ||
160 | %description -n bash-completion-calibre -l pl.UTF-8 | |
161 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre. | |
162 | ||
163 | %package -n zsh-completion-calibre | |
164 | Summary: zsh-completion for calibre | |
165 | Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh | |
166 | Group: Applications/Shells | |
167 | Requires: %{name} = %{version}-%{release} | |
168 | Requires: bash-completion | |
169 | ||
170 | %description -n zsh-completion-calibre | |
171 | zsh-completion for calibre. | |
172 | ||
173 | %description -n zsh-completion-calibre -l pl.UTF-8 | |
174 | Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh. | |
824729ab | 175 | |
0e501b81 | 176 | %prep |
6fa79409 | 177 | %setup -q |
0e501b81 | 178 | %patch0 -p1 |
ad58ec42 | 179 | %patch1 -p1 |
804e0619 | 180 | %patch2 -p1 |
270a5ef0 | 181 | %patch3 -p1 |
43b56935 | 182 | %patch4 -p1 |
f6f5b3d6 | 183 | |
d781633a JP |
184 | # 64bit target build fix |
185 | %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py | |
186 | ||
933d2d03 | 187 | # upstream decides to store locale files in a single zip file but we prefer separate .mo |
f6f5b3d6 | 188 | mkdir resources/localization/locales |
189 | unzip resources/localization/locales.zip -d resources/localization/locales | |
190 | chmod 755 resources/localization/locales/* | |
933d2d03 | 191 | rm -f resources/localization/locales.zip |
0e501b81 | 192 | |
193 | %build | |
5877892a | 194 | CC="%{__cc}" \ |
03edf045 | 195 | CXX=%{__cxx} \ |
cdcddff9 | 196 | OVERRIDE_CFLAGS="%{rpmcflags}" \ |
03edf045 | 197 | OVERRIDE_LDFLAGS="%{rpmldflags}" \ |
54faabcd | 198 | QMAKE="%{_bindir}/qmake-qt6" \ |
49a96cf0 | 199 | %{__python3} setup.py build |
0e501b81 | 200 | |
201 | %install | |
202 | rm -rf $RPM_BUILD_ROOT | |
3550e999 | 203 | # create directories for xdg-utils |
81537047 | 204 | install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \ |
43b56935 | 205 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},%{zsh_compdir}} |
0e501b81 | 206 | |
7b172d7e JR |
207 | export XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" |
208 | export XDG_UTILS_INSTALL_MODE="system" | |
209 | export LIBPATH="%{_libdir}" | |
49a96cf0 | 210 | %{__python3} setup.py install \ |
389ef12d | 211 | --no-compile \ |
389ef12d | 212 | --root=$RPM_BUILD_ROOT \ |
7b172d7e JR |
213 | --prefix=%{_prefix} \ |
214 | --bindir=%{_bindir} \ | |
215 | --libdir=%{_libdir} \ | |
216 | --sharedir=%{_datadir} | |
0e501b81 | 217 | |
b0d52b63 JR |
218 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \ |
219 | -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \ | |
220 | $RPM_BUILD_ROOT%{_bindir}/* \ | |
221 | $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}/devices/cli.py \ | |
222 | $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}/devices/mtp/unix/upstream/update.py | |
7261ec00 | 223 | |
81537047 JR |
224 | cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png |
225 | cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png | |
226 | ||
b0d52b63 JR |
227 | %py3_comp $RPM_BUILD_ROOT%{_libdir}/%{name} |
228 | %py3_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name} | |
e154a7c1 | 229 | |
270a5ef0 | 230 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir} |
f6f5b3d6 | 231 | |
232 | # set proper filenames for locales (TODO: switch to patch if possible) | |
81537047 | 233 | for file in $RPM_BUILD_ROOT%{_localedir}/*; do |
933d2d03 | 234 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:') |
81537047 | 235 | mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES |
7261ec00 | 236 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \ |
270a5ef0 | 237 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES |
933d2d03 | 238 | done; |
81537047 | 239 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do |
f6f5b3d6 | 240 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
7261ec00 | 241 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \ |
270a5ef0 | 242 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo |
f6f5b3d6 | 243 | done; |
81537047 | 244 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do |
f6f5b3d6 | 245 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
7261ec00 | 246 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \ |
270a5ef0 JR |
247 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo |
248 | done; | |
4d780bcf JR |
249 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso3166.mo; do |
250 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') | |
251 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso3166.mo \ | |
252 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso3166.mo | |
253 | done; | |
ddb4b081 | 254 | |
05198e10 | 255 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{km_KH,km} |
7261ec00 JB |
256 | # duplicates of bn,sl |
257 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{bn_BD,sl_SI} | |
f6f5b3d6 | 258 | # unsupported |
4602aede | 259 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{jv,ltg,uz@Latn} |
f6f5b3d6 | 260 | |
43b56935 | 261 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} |
d383d054 | 262 | |
933d2d03 | 263 | %find_lang %{name} --all-name |
7b172d7e JR |
264 | for file in $RPM_BUILD_ROOT%{_localedir}/*/lcdata.calibre_msgpack; do |
265 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/.*:\1:') | |
270a5ef0 JR |
266 | echo $file | %{__sed} "s:$RPM_BUILD_ROOT\(.*\):%lang($lang) \1:" >>%{name}.lang |
267 | done; | |
933d2d03 | 268 | |
0e501b81 | 269 | %clean |
270 | rm -rf $RPM_BUILD_ROOT | |
271 | ||
81537047 JR |
272 | %post |
273 | %update_desktop_database | |
274 | %update_mime_database | |
275 | %update_icon_cache hicolor | |
276 | ||
277 | %postun | |
278 | if [ $1 -eq 0 ] ; then | |
279 | %update_desktop_database | |
280 | %update_mime_database | |
281 | %update_icon_cache hicolor | |
282 | fi | |
283 | ||
933d2d03 | 284 | %files -f %{name}.lang |
0e501b81 | 285 | %defattr(644,root,root,755) |
b0d52b63 | 286 | %doc Changelog.txt COPYRIGHT README.md |
23304c7f | 287 | %attr(755,root,root) %{_bindir}/calibre |
288 | %attr(755,root,root) %{_bindir}/calibre-complete | |
289 | %attr(755,root,root) %{_bindir}/calibre-customize | |
290 | %attr(755,root,root) %{_bindir}/calibre-debug | |
d383d054 | 291 | %attr(755,root,root) %{_bindir}/calibre-mount-helper |
23304c7f | 292 | %attr(755,root,root) %{_bindir}/calibre-parallel |
293 | %attr(755,root,root) %{_bindir}/calibre-server | |
294 | %attr(755,root,root) %{_bindir}/calibre-smtp | |
295 | %attr(755,root,root) %{_bindir}/calibredb | |
296 | %attr(755,root,root) %{_bindir}/ebook-convert | |
297 | %attr(755,root,root) %{_bindir}/ebook-device | |
9ada6450 | 298 | %attr(755,root,root) %{_bindir}/ebook-edit |
23304c7f | 299 | %attr(755,root,root) %{_bindir}/ebook-meta |
cdcddff9 | 300 | %attr(755,root,root) %{_bindir}/ebook-polish |
23304c7f | 301 | %attr(755,root,root) %{_bindir}/ebook-viewer |
23304c7f | 302 | %attr(755,root,root) %{_bindir}/fetch-ebook-metadata |
23304c7f | 303 | %attr(755,root,root) %{_bindir}/lrf2lrs |
304 | %attr(755,root,root) %{_bindir}/lrfviewer | |
305 | %attr(755,root,root) %{_bindir}/lrs2lrf | |
306 | %attr(755,root,root) %{_bindir}/markdown-calibre | |
23304c7f | 307 | %attr(755,root,root) %{_bindir}/web2disk |
7261ec00 | 308 | %{_libdir}/%{name} |
0e501b81 | 309 | %{_datadir}/%{name} |
b0d52b63 JR |
310 | %{_datadir}/metainfo/calibre-ebook-edit.metainfo.xml |
311 | %{_datadir}/metainfo/calibre-ebook-viewer.metainfo.xml | |
312 | %{_datadir}/metainfo/calibre-gui.metainfo.xml | |
888e3f00 JR |
313 | %{_desktopdir}/calibre-ebook-edit.desktop |
314 | %{_desktopdir}/calibre-ebook-viewer.desktop | |
315 | %{_desktopdir}/calibre-gui.desktop | |
316 | %{_desktopdir}/calibre-lrfviewer.desktop | |
7261ec00 JB |
317 | %{_iconsdir}/hicolor/*x*/apps/calibre-*.png |
318 | %{_iconsdir}/hicolor/*x*/mimetypes/application-lrf.png | |
319 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-kindle-application.png | |
320 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobi8-ebook.png | |
321 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobipocket-ebook.png | |
322 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-topaz-ebook.png | |
323 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-lrf.png | |
324 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-kindle-application.png | |
325 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobi8-ebook.png | |
326 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobipocket-ebook.png | |
327 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-topaz-ebook.png | |
328 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-text-lrs.png | |
329 | %{_iconsdir}/hicolor/*x*/mimetypes/text-lrs.png | |
888e3f00 | 330 | %{_datadir}/mime/packages/calibre-mimetypes.xml |
7261ec00 | 331 | %{_pixmapsdir}/calibre-gui.png |
81537047 | 332 | %{_pixmapsdir}/calibre-viewer.png |
2eeb7ef1 | 333 | |
888e3f00 JR |
334 | %files -n bash-completion-calibre |
335 | %defattr(644,root,root,755) | |
fe8c5b5e ŁM |
336 | %{bash_compdir}/* |
337 | ||
888e3f00 JR |
338 | %files -n zsh-completion-calibre |
339 | %defattr(644,root,root,755) | |
43b56935 | 340 | %{zsh_compdir}/_calibre |