]>
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 |
fe8c5b5e | 14 | Version: 4.3.0 |
394abe07 | 15 | Release: 1 |
6d15f615 | 16 | License: GPL v3+ |
02229893 | 17 | Group: Applications/Multimedia |
1068761e | 18 | Source0: %{name}-%{version}-nofonts.tar.xz |
fe8c5b5e | 19 | # Source0-md5: 8bfe8d70899f3437626d6040be98020a |
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 | |
02229893 | 26 | URL: http://www.calibre-ebook.com/ |
824729ab AF |
27 | %define baeutifulsoup_ver 3.0.5 |
28 | %define pil_ver 1.1.6 | |
ace8b165 | 29 | %define pyqt5_ver 5.3.1 |
824729ab AF |
30 | %define apsw_ver 3.8.0.1 |
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 | |
37 | %define netifaces_ver 0.8 | |
38 | %define psutil_ver 0.6.1 | |
3b8cf9a9 | 39 | BuildRequires: ImageMagick-devel >= 6.6.4.7 |
ace8b165 JR |
40 | BuildRequires: Qt5Core-devel |
41 | BuildRequires: Qt5DBus-devel | |
8a61eab7 JR |
42 | BuildRequires: Qt5EventDispatcherSupport-devel |
43 | BuildRequires: Qt5FontDatabaseSupport-devel | |
ace8b165 | 44 | BuildRequires: Qt5Gui-devel |
8a61eab7 JR |
45 | BuildRequires: Qt5ServiceSupport-devel |
46 | BuildRequires: Qt5ThemeSupport-devel | |
6be3ae07 | 47 | BuildRequires: Qt5WebEngine-devel |
f4da95e9 | 48 | BuildRequires: Qt5Widgets-devel |
591b7d3d | 49 | BuildRequires: chmlib-devel >= 0.40 |
fe8c5b5e | 50 | BuildRequires: hunspell-devel |
212c1324 | 51 | BuildRequires: libicu-devel |
389ef12d | 52 | BuildRequires: libinput-devel |
591b7d3d MB |
53 | BuildRequires: libmtp-devel >= 1.1.5 |
54 | BuildRequires: libwmf-devel >= 0.2.8 | |
f4da95e9 | 55 | BuildRequires: mtdev-devel |
f0879852 | 56 | BuildRequires: pkgconfig |
591b7d3d | 57 | BuildRequires: podofo-devel >= 0.8.2 |
f4da95e9 LM |
58 | BuildRequires: poppler-qt5-devel >= 0.28.1 |
59 | BuildRequires: poppler-glib-devel >= 0.28.1 | |
824729ab AF |
60 | BuildRequires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
61 | BuildRequires: python-PIL >= %{pil_ver} | |
1c3d35d0 | 62 | BuildRequires: python-PyQt5 >= %{pyqt5_ver} |
1c3d35d0 JR |
63 | BuildRequires: python-PyQt5-devel-tools >= %{pyqt5_ver} |
64 | BuildRequires: python-PyQt5-uic >= %{pyqt5_ver} | |
88a99788 | 65 | BuildRequires: python-PyQtWebEngine >= %{pyqt5_ver} |
824729ab | 66 | BuildRequires: python-apsw >= %{apsw_ver} |
7b172d7e | 67 | BuildRequires: python-bs4 |
824729ab | 68 | BuildRequires: python-cssselect >= %{cssselect_ver} |
7b172d7e | 69 | BuildRequires: python-css_parser |
824729ab AF |
70 | BuildRequires: python-cssutils >= %{cssutils_ver} |
71 | BuildRequires: python-dateutil >= %{dateutil_ver} | |
72cd9da3 | 72 | BuildRequires: python-devel >= 1:2.7.1 |
824729ab AF |
73 | BuildRequires: python-dns >= %{dns_ver} |
74 | BuildRequires: python-genshi | |
8a61eab7 | 75 | BuildRequires: python-html5-parser |
824729ab AF |
76 | BuildRequires: python-lxml >= %{lxml_ver} |
77 | BuildRequires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 78 | BuildRequires: python-modules-sqlite |
8a61eab7 | 79 | BuildRequires: python-msgpack |
824729ab AF |
80 | BuildRequires: python-netifaces >= %{netifaces_ver} |
81 | BuildRequires: python-psutil >= %{psutil_ver} | |
8a61eab7 | 82 | BuildRequires: python-regex |
0e501b81 | 83 | BuildRequires: python-sip-devel |
fb57c0a5 | 84 | BuildRequires: qt5-build |
f4da95e9 | 85 | BuildRequires: qt5-qmake |
0e501b81 | 86 | BuildRequires: rpm-pythonprov |
c0c82cf2 | 87 | BuildRequires: rpmbuild(macros) >= 1.710 |
ddb4b081 | 88 | BuildRequires: sed >= 4.0 |
212c1324 | 89 | BuildRequires: sqlite3-devel |
f4da95e9 | 90 | BuildRequires: sip-PyQt5 |
23304c7f | 91 | BuildRequires: tar >= 1:1.22 |
f6f5b3d6 | 92 | BuildRequires: unzip |
3c9d3d2b | 93 | BuildRequires: xdg-utils |
23304c7f | 94 | BuildRequires: xz >= 1:4.999.7 |
e4bd4d10 | 95 | Requires: Qt5Svg |
fb57c0a5 | 96 | Requires: Qt5WebKit |
824729ab AF |
97 | Requires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
98 | Requires: python-PIL >= %{pil_ver} | |
ace8b165 | 99 | Requires: python-PyQt5 >= %{pyqt5_ver} |
fe8c5b5e | 100 | Requires: python-PyQtWebEngine >= %{pyqt5_ver} |
824729ab | 101 | Requires: python-apsw >= %{apsw_ver} |
7b172d7e | 102 | Requires: python-bs4 |
824729ab | 103 | Requires: python-cssselect >= %{cssselect_ver} |
7b172d7e | 104 | Requires: python-css_parser |
824729ab AF |
105 | Requires: python-cssutils >= %{cssutils_ver} |
106 | Requires: python-dateutil >= %{dateutil_ver} | |
107 | Requires: python-dns >= %{dns_ver} | |
591b7d3d | 108 | Requires: python-genshi |
8a61eab7 | 109 | Requires: python-html5-parser |
824729ab AF |
110 | Requires: python-lxml >= %{lxml_ver} |
111 | Requires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 112 | Requires: python-modules-sqlite |
8a61eab7 | 113 | Requires: python-msgpack |
824729ab AF |
114 | Requires: python-netifaces >= %{netifaces_ver} |
115 | Requires: python-psutil >= %{psutil_ver} | |
8a61eab7 | 116 | Requires: python-regex |
b0073032 | 117 | Suggests: ImageMagick-coder-jpeg |
118 | Suggests: ImageMagick-coder-png | |
400a540b PG |
119 | ### FIXME: libunrar.so is needed for rar-packed files |
120 | Suggests: libunrar-devel | |
b0073032 | 121 | Suggests: poppler-progs |
0e501b81 | 122 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
123 | ||
124 | %description | |
02229893 ER |
125 | Calibre is meant to be a complete e-library solution. It includes |
126 | library management, format conversion, news feeds to ebook conversion | |
127 | as well as e-book reader sync features. | |
128 | ||
129 | Calibre is primarily a ebook cataloging program. It manages your ebook | |
130 | collection for you. It is designed around the concept of the logical | |
131 | book, i.e. a single entry in the database that may correspond to | |
132 | ebooks in several formats. It also supports conversion to and from a | |
133 | dozen different ebook formats. | |
134 | ||
135 | Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, | |
136 | CBR, CBZ, RTF, TXT, PDF and LRS. | |
0e501b81 | 137 | |
cee72504 | 138 | %description -l pl.UTF-8 |
139 | Calibre to bardzo dobry i darmowy program do czytania e-książek. | |
140 | ||
141 | Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu | |
142 | formatów do ich postaci. Program obsługuje następujące typy plików: | |
143 | import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML | |
144 | eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza. | |
145 | ||
146 | Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i | |
147 | najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy | |
148 | dołączyli również aplikację, którą użytkownik może wykorzystać jako | |
149 | swój własny serwer darmowych książek. | |
150 | ||
888e3f00 JR |
151 | %package -n bash-completion-calibre |
152 | Summary: bash-completion for calibre | |
153 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre | |
154 | Group: Applications/Shells | |
155 | Requires: %{name} = %{version}-%{release} | |
156 | Requires: bash-completion | |
157 | %if "%{_rpmversion}" >= "5" | |
158 | BuildArch: noarch | |
159 | %endif | |
160 | ||
161 | %description -n bash-completion-calibre | |
162 | bash-completion for calibre. | |
163 | ||
164 | %description -n bash-completion-calibre -l pl.UTF-8 | |
165 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre. | |
166 | ||
167 | %package -n zsh-completion-calibre | |
168 | Summary: zsh-completion for calibre | |
169 | Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh | |
170 | Group: Applications/Shells | |
171 | Requires: %{name} = %{version}-%{release} | |
172 | Requires: bash-completion | |
173 | ||
174 | %description -n zsh-completion-calibre | |
175 | zsh-completion for calibre. | |
176 | ||
177 | %description -n zsh-completion-calibre -l pl.UTF-8 | |
178 | Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh. | |
824729ab | 179 | |
0e501b81 | 180 | %prep |
6fa79409 | 181 | %setup -q |
0e501b81 | 182 | %patch0 -p1 |
ad58ec42 | 183 | %patch1 -p1 |
804e0619 | 184 | %patch2 -p1 |
270a5ef0 | 185 | %patch3 -p1 |
f6f5b3d6 | 186 | |
d781633a JP |
187 | # 64bit target build fix |
188 | %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py | |
189 | ||
933d2d03 | 190 | # upstream decides to store locale files in a single zip file but we prefer separate .mo |
f6f5b3d6 | 191 | mkdir resources/localization/locales |
192 | unzip resources/localization/locales.zip -d resources/localization/locales | |
193 | chmod 755 resources/localization/locales/* | |
933d2d03 | 194 | rm -f resources/localization/locales.zip |
0e501b81 | 195 | |
196 | %build | |
5877892a | 197 | CC="%{__cc}" \ |
03edf045 | 198 | CXX=%{__cxx} \ |
cdcddff9 | 199 | OVERRIDE_CFLAGS="%{rpmcflags}" \ |
03edf045 | 200 | OVERRIDE_LDFLAGS="%{rpmldflags}" \ |
f4da95e9 | 201 | QMAKE="%{_bindir}/qmake-qt5" \ |
389ef12d | 202 | %{__python} setup.py build |
0e501b81 | 203 | |
204 | %install | |
205 | rm -rf $RPM_BUILD_ROOT | |
3550e999 | 206 | # create directories for xdg-utils |
81537047 | 207 | install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \ |
824729ab | 208 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/usr/share/zsh/site-functions} |
0e501b81 | 209 | |
7b172d7e JR |
210 | export XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" |
211 | export XDG_UTILS_INSTALL_MODE="system" | |
212 | export LIBPATH="%{_libdir}" | |
389ef12d LM |
213 | %{__python} setup.py install \ |
214 | --no-compile \ | |
389ef12d | 215 | --root=$RPM_BUILD_ROOT \ |
7b172d7e JR |
216 | --prefix=%{_prefix} \ |
217 | --bindir=%{_bindir} \ | |
218 | --libdir=%{_libdir} \ | |
219 | --sharedir=%{_datadir} | |
0e501b81 | 220 | |
7261ec00 JB |
221 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_bindir}/* |
222 | ||
81537047 JR |
223 | cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png |
224 | cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png | |
225 | ||
e154a7c1 | 226 | %py_comp $RPM_BUILD_ROOT%{_libdir}/%{name} |
7261ec00 | 227 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name} |
e154a7c1 JP |
228 | %py_postclean %{_libdir}/%{name} |
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; | |
ddb4b081 | 249 | |
05198e10 | 250 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{km_KH,km} |
7261ec00 JB |
251 | # duplicates of bn,sl |
252 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{bn_BD,sl_SI} | |
f6f5b3d6 | 253 | # unsupported |
7261ec00 | 254 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{jv,ltg} |
f6f5b3d6 | 255 | |
d383d054 MM |
256 | install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} |
257 | ||
933d2d03 | 258 | %find_lang %{name} --all-name |
7b172d7e JR |
259 | for file in $RPM_BUILD_ROOT%{_localedir}/*/lcdata.calibre_msgpack; do |
260 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/.*:\1:') | |
270a5ef0 JR |
261 | echo $file | %{__sed} "s:$RPM_BUILD_ROOT\(.*\):%lang($lang) \1:" >>%{name}.lang |
262 | done; | |
933d2d03 | 263 | |
0e501b81 | 264 | %clean |
265 | rm -rf $RPM_BUILD_ROOT | |
266 | ||
81537047 JR |
267 | %post |
268 | %update_desktop_database | |
269 | %update_mime_database | |
270 | %update_icon_cache hicolor | |
271 | ||
272 | %postun | |
273 | if [ $1 -eq 0 ] ; then | |
274 | %update_desktop_database | |
275 | %update_mime_database | |
276 | %update_icon_cache hicolor | |
277 | fi | |
278 | ||
933d2d03 | 279 | %files -f %{name}.lang |
0e501b81 | 280 | %defattr(644,root,root,755) |
cdcddff9 | 281 | %doc Changelog.yaml COPYRIGHT README.md |
23304c7f | 282 | %attr(755,root,root) %{_bindir}/calibre |
283 | %attr(755,root,root) %{_bindir}/calibre-complete | |
284 | %attr(755,root,root) %{_bindir}/calibre-customize | |
285 | %attr(755,root,root) %{_bindir}/calibre-debug | |
d383d054 | 286 | %attr(755,root,root) %{_bindir}/calibre-mount-helper |
23304c7f | 287 | %attr(755,root,root) %{_bindir}/calibre-parallel |
288 | %attr(755,root,root) %{_bindir}/calibre-server | |
289 | %attr(755,root,root) %{_bindir}/calibre-smtp | |
290 | %attr(755,root,root) %{_bindir}/calibredb | |
291 | %attr(755,root,root) %{_bindir}/ebook-convert | |
292 | %attr(755,root,root) %{_bindir}/ebook-device | |
9ada6450 | 293 | %attr(755,root,root) %{_bindir}/ebook-edit |
23304c7f | 294 | %attr(755,root,root) %{_bindir}/ebook-meta |
cdcddff9 | 295 | %attr(755,root,root) %{_bindir}/ebook-polish |
23304c7f | 296 | %attr(755,root,root) %{_bindir}/ebook-viewer |
23304c7f | 297 | %attr(755,root,root) %{_bindir}/fetch-ebook-metadata |
23304c7f | 298 | %attr(755,root,root) %{_bindir}/lrf2lrs |
299 | %attr(755,root,root) %{_bindir}/lrfviewer | |
300 | %attr(755,root,root) %{_bindir}/lrs2lrf | |
301 | %attr(755,root,root) %{_bindir}/markdown-calibre | |
23304c7f | 302 | %attr(755,root,root) %{_bindir}/web2disk |
7261ec00 | 303 | %{_libdir}/%{name} |
0e501b81 | 304 | %{_datadir}/%{name} |
8a61eab7 JR |
305 | %{_datadir}/metainfo/calibre-ebook-edit.appdata.xml |
306 | %{_datadir}/metainfo/calibre-ebook-viewer.appdata.xml | |
307 | %{_datadir}/metainfo/calibre-gui.appdata.xml | |
888e3f00 JR |
308 | %{_desktopdir}/calibre-ebook-edit.desktop |
309 | %{_desktopdir}/calibre-ebook-viewer.desktop | |
310 | %{_desktopdir}/calibre-gui.desktop | |
311 | %{_desktopdir}/calibre-lrfviewer.desktop | |
7261ec00 JB |
312 | %{_iconsdir}/hicolor/*x*/apps/calibre-*.png |
313 | %{_iconsdir}/hicolor/*x*/mimetypes/application-lrf.png | |
314 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-kindle-application.png | |
315 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobi8-ebook.png | |
316 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobipocket-ebook.png | |
317 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-topaz-ebook.png | |
318 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-lrf.png | |
319 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-kindle-application.png | |
320 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobi8-ebook.png | |
321 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobipocket-ebook.png | |
322 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-topaz-ebook.png | |
323 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-text-lrs.png | |
324 | %{_iconsdir}/hicolor/*x*/mimetypes/text-lrs.png | |
888e3f00 | 325 | %{_datadir}/mime/packages/calibre-mimetypes.xml |
7261ec00 | 326 | %{_pixmapsdir}/calibre-gui.png |
81537047 | 327 | %{_pixmapsdir}/calibre-viewer.png |
2eeb7ef1 | 328 | |
888e3f00 JR |
329 | %files -n bash-completion-calibre |
330 | %defattr(644,root,root,755) | |
fe8c5b5e ŁM |
331 | %{bash_compdir}/* |
332 | ||
824729ab | 333 | |
888e3f00 JR |
334 | %files -n zsh-completion-calibre |
335 | %defattr(644,root,root,755) | |
7261ec00 | 336 | %{_datadir}/zsh/site-functions/_calibre |