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