]>
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 |
ba02fb3e | 14 | Version: 4.1.0 |
394abe07 | 15 | Release: 1 |
6d15f615 | 16 | License: GPL v3+ |
02229893 | 17 | Group: Applications/Multimedia |
1068761e | 18 | Source0: %{name}-%{version}-nofonts.tar.xz |
ba02fb3e | 19 | # Source0-md5: 9aa5823e828ad0e7ff29d8178080e449 |
3c9d3d2b | 20 | Source1: generate-tarball.sh |
5cf7f03b | 21 | Source2: %{name}-mount-helper |
0e501b81 | 22 | Patch0: %{name}-prefix.patch |
ad58ec42 LM |
23 | Patch1: %{name}-env_module.patch |
24 | Patch2: %{name}-locales.patch | |
25 | Patch3: shebang-python-fix.patch | |
26 | Patch4: desktop-integration.patch | |
02229893 | 27 | URL: http://www.calibre-ebook.com/ |
824729ab AF |
28 | %define baeutifulsoup_ver 3.0.5 |
29 | %define pil_ver 1.1.6 | |
ace8b165 | 30 | %define pyqt5_ver 5.3.1 |
824729ab AF |
31 | %define apsw_ver 3.8.0.1 |
32 | %define cssselect_ver 0.7.1 | |
33 | %define cssutils_ver 1:0.9.9 | |
34 | %define dateutil_ver 1.4.1 | |
35 | %define dns_ver 1.6.0 | |
36 | %define lxml_ver 2.2.1 | |
37 | %define mechanize_ver 0.1.11 | |
38 | %define netifaces_ver 0.8 | |
39 | %define psutil_ver 0.6.1 | |
3b8cf9a9 | 40 | BuildRequires: ImageMagick-devel >= 6.6.4.7 |
ace8b165 JR |
41 | BuildRequires: Qt5Core-devel |
42 | BuildRequires: Qt5DBus-devel | |
8a61eab7 JR |
43 | BuildRequires: Qt5EventDispatcherSupport-devel |
44 | BuildRequires: Qt5FontDatabaseSupport-devel | |
ace8b165 | 45 | BuildRequires: Qt5Gui-devel |
8a61eab7 JR |
46 | BuildRequires: Qt5ServiceSupport-devel |
47 | BuildRequires: Qt5ThemeSupport-devel | |
f4da95e9 | 48 | BuildRequires: Qt5Widgets-devel |
591b7d3d | 49 | BuildRequires: chmlib-devel >= 0.40 |
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 LM |
57 | BuildRequires: poppler-qt5-devel >= 0.28.1 |
58 | BuildRequires: poppler-glib-devel >= 0.28.1 | |
824729ab AF |
59 | BuildRequires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
60 | BuildRequires: python-PIL >= %{pil_ver} | |
1c3d35d0 | 61 | BuildRequires: python-PyQt5 >= %{pyqt5_ver} |
1c3d35d0 JR |
62 | BuildRequires: python-PyQt5-devel-tools >= %{pyqt5_ver} |
63 | BuildRequires: python-PyQt5-uic >= %{pyqt5_ver} | |
88a99788 | 64 | BuildRequires: python-PyQtWebEngine >= %{pyqt5_ver} |
824729ab | 65 | BuildRequires: python-apsw >= %{apsw_ver} |
7b172d7e | 66 | BuildRequires: python-bs4 |
824729ab | 67 | BuildRequires: python-cssselect >= %{cssselect_ver} |
7b172d7e | 68 | BuildRequires: python-css_parser |
824729ab AF |
69 | BuildRequires: python-cssutils >= %{cssutils_ver} |
70 | BuildRequires: python-dateutil >= %{dateutil_ver} | |
72cd9da3 | 71 | BuildRequires: python-devel >= 1:2.7.1 |
824729ab AF |
72 | BuildRequires: python-dns >= %{dns_ver} |
73 | BuildRequires: python-genshi | |
8a61eab7 | 74 | BuildRequires: python-html5-parser |
824729ab AF |
75 | BuildRequires: python-lxml >= %{lxml_ver} |
76 | BuildRequires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 77 | BuildRequires: python-modules-sqlite |
8a61eab7 | 78 | BuildRequires: python-msgpack |
824729ab AF |
79 | BuildRequires: python-netifaces >= %{netifaces_ver} |
80 | BuildRequires: python-psutil >= %{psutil_ver} | |
8a61eab7 | 81 | BuildRequires: python-regex |
0e501b81 | 82 | BuildRequires: python-sip-devel |
fb57c0a5 | 83 | BuildRequires: qt5-build |
f4da95e9 | 84 | BuildRequires: qt5-qmake |
0e501b81 | 85 | BuildRequires: rpm-pythonprov |
c0c82cf2 | 86 | BuildRequires: rpmbuild(macros) >= 1.710 |
ddb4b081 | 87 | BuildRequires: sed >= 4.0 |
212c1324 | 88 | BuildRequires: sqlite3-devel |
f4da95e9 | 89 | BuildRequires: sip-PyQt5 |
23304c7f | 90 | BuildRequires: tar >= 1:1.22 |
f6f5b3d6 | 91 | BuildRequires: unzip |
3c9d3d2b | 92 | BuildRequires: xdg-utils |
23304c7f | 93 | BuildRequires: xz >= 1:4.999.7 |
e4bd4d10 | 94 | Requires: Qt5Svg |
fb57c0a5 | 95 | Requires: Qt5WebKit |
824729ab AF |
96 | Requires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
97 | Requires: python-PIL >= %{pil_ver} | |
ace8b165 | 98 | Requires: python-PyQt5 >= %{pyqt5_ver} |
824729ab | 99 | Requires: python-apsw >= %{apsw_ver} |
7b172d7e | 100 | Requires: python-bs4 |
824729ab | 101 | Requires: python-cssselect >= %{cssselect_ver} |
7b172d7e | 102 | Requires: python-css_parser |
824729ab AF |
103 | Requires: python-cssutils >= %{cssutils_ver} |
104 | Requires: python-dateutil >= %{dateutil_ver} | |
105 | Requires: python-dns >= %{dns_ver} | |
591b7d3d | 106 | Requires: python-genshi |
8a61eab7 | 107 | Requires: python-html5-parser |
824729ab AF |
108 | Requires: python-lxml >= %{lxml_ver} |
109 | Requires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 110 | Requires: python-modules-sqlite |
8a61eab7 | 111 | Requires: python-msgpack |
824729ab AF |
112 | Requires: python-netifaces >= %{netifaces_ver} |
113 | Requires: python-psutil >= %{psutil_ver} | |
8a61eab7 | 114 | Requires: python-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 | |
155 | %if "%{_rpmversion}" >= "5" | |
156 | BuildArch: noarch | |
157 | %endif | |
158 | ||
159 | %description -n bash-completion-calibre | |
160 | bash-completion for calibre. | |
161 | ||
162 | %description -n bash-completion-calibre -l pl.UTF-8 | |
163 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre. | |
164 | ||
165 | %package -n zsh-completion-calibre | |
166 | Summary: zsh-completion for calibre | |
167 | Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh | |
168 | Group: Applications/Shells | |
169 | Requires: %{name} = %{version}-%{release} | |
170 | Requires: bash-completion | |
171 | ||
172 | %description -n zsh-completion-calibre | |
173 | zsh-completion for calibre. | |
174 | ||
175 | %description -n zsh-completion-calibre -l pl.UTF-8 | |
176 | Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh. | |
824729ab | 177 | |
0e501b81 | 178 | %prep |
6fa79409 | 179 | %setup -q |
0e501b81 | 180 | %patch0 -p1 |
ad58ec42 | 181 | %patch1 -p1 |
804e0619 | 182 | %patch2 -p1 |
270a5ef0 | 183 | %patch3 -p1 |
ddb4b081 | 184 | %patch4 -p1 |
f6f5b3d6 | 185 | |
d781633a JP |
186 | # 64bit target build fix |
187 | %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py | |
188 | ||
933d2d03 | 189 | # upstream decides to store locale files in a single zip file but we prefer separate .mo |
f6f5b3d6 | 190 | mkdir resources/localization/locales |
191 | unzip resources/localization/locales.zip -d resources/localization/locales | |
192 | chmod 755 resources/localization/locales/* | |
933d2d03 | 193 | rm -f resources/localization/locales.zip |
0e501b81 | 194 | |
195 | %build | |
5877892a | 196 | CC="%{__cc}" \ |
03edf045 | 197 | CXX=%{__cxx} \ |
cdcddff9 | 198 | OVERRIDE_CFLAGS="%{rpmcflags}" \ |
03edf045 | 199 | OVERRIDE_LDFLAGS="%{rpmldflags}" \ |
f4da95e9 | 200 | QMAKE="%{_bindir}/qmake-qt5" \ |
389ef12d | 201 | %{__python} setup.py build |
0e501b81 | 202 | |
203 | %install | |
204 | rm -rf $RPM_BUILD_ROOT | |
3550e999 | 205 | # create directories for xdg-utils |
81537047 | 206 | install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \ |
824729ab | 207 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/usr/share/zsh/site-functions} |
0e501b81 | 208 | |
7b172d7e JR |
209 | export XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" |
210 | export XDG_UTILS_INSTALL_MODE="system" | |
211 | export LIBPATH="%{_libdir}" | |
389ef12d LM |
212 | %{__python} setup.py install \ |
213 | --no-compile \ | |
389ef12d | 214 | --root=$RPM_BUILD_ROOT \ |
7b172d7e JR |
215 | --prefix=%{_prefix} \ |
216 | --bindir=%{_bindir} \ | |
217 | --libdir=%{_libdir} \ | |
218 | --sharedir=%{_datadir} | |
0e501b81 | 219 | |
7261ec00 JB |
220 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_bindir}/* |
221 | ||
81537047 JR |
222 | cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png |
223 | cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png | |
224 | ||
e154a7c1 | 225 | %py_comp $RPM_BUILD_ROOT%{_libdir}/%{name} |
7261ec00 | 226 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name} |
e154a7c1 JP |
227 | %py_postclean %{_libdir}/%{name} |
228 | ||
270a5ef0 | 229 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir} |
f6f5b3d6 | 230 | |
231 | # set proper filenames for locales (TODO: switch to patch if possible) | |
81537047 | 232 | for file in $RPM_BUILD_ROOT%{_localedir}/*; do |
933d2d03 | 233 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:') |
81537047 | 234 | mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES |
7261ec00 | 235 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \ |
270a5ef0 | 236 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES |
933d2d03 | 237 | done; |
81537047 | 238 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do |
f6f5b3d6 | 239 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
7261ec00 | 240 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \ |
270a5ef0 | 241 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo |
f6f5b3d6 | 242 | done; |
81537047 | 243 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do |
f6f5b3d6 | 244 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
7261ec00 | 245 | %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \ |
270a5ef0 JR |
246 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo |
247 | done; | |
ddb4b081 | 248 | |
05198e10 | 249 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{km_KH,km} |
7261ec00 JB |
250 | # duplicates of bn,sl |
251 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{bn_BD,sl_SI} | |
f6f5b3d6 | 252 | # unsupported |
7261ec00 | 253 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{jv,ltg} |
f6f5b3d6 | 254 | |
d383d054 MM |
255 | install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} |
256 | ||
933d2d03 | 257 | %find_lang %{name} --all-name |
7b172d7e JR |
258 | for file in $RPM_BUILD_ROOT%{_localedir}/*/lcdata.calibre_msgpack; do |
259 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/.*:\1:') | |
270a5ef0 JR |
260 | echo $file | %{__sed} "s:$RPM_BUILD_ROOT\(.*\):%lang($lang) \1:" >>%{name}.lang |
261 | done; | |
933d2d03 | 262 | |
0e501b81 | 263 | %clean |
264 | rm -rf $RPM_BUILD_ROOT | |
265 | ||
81537047 JR |
266 | %post |
267 | %update_desktop_database | |
268 | %update_mime_database | |
269 | %update_icon_cache hicolor | |
270 | ||
271 | %postun | |
272 | if [ $1 -eq 0 ] ; then | |
273 | %update_desktop_database | |
274 | %update_mime_database | |
275 | %update_icon_cache hicolor | |
276 | fi | |
277 | ||
933d2d03 | 278 | %files -f %{name}.lang |
0e501b81 | 279 | %defattr(644,root,root,755) |
cdcddff9 | 280 | %doc Changelog.yaml COPYRIGHT README.md |
23304c7f | 281 | %attr(755,root,root) %{_bindir}/calibre |
282 | %attr(755,root,root) %{_bindir}/calibre-complete | |
283 | %attr(755,root,root) %{_bindir}/calibre-customize | |
284 | %attr(755,root,root) %{_bindir}/calibre-debug | |
d383d054 | 285 | %attr(755,root,root) %{_bindir}/calibre-mount-helper |
23304c7f | 286 | %attr(755,root,root) %{_bindir}/calibre-parallel |
287 | %attr(755,root,root) %{_bindir}/calibre-server | |
288 | %attr(755,root,root) %{_bindir}/calibre-smtp | |
289 | %attr(755,root,root) %{_bindir}/calibredb | |
290 | %attr(755,root,root) %{_bindir}/ebook-convert | |
291 | %attr(755,root,root) %{_bindir}/ebook-device | |
9ada6450 | 292 | %attr(755,root,root) %{_bindir}/ebook-edit |
23304c7f | 293 | %attr(755,root,root) %{_bindir}/ebook-meta |
cdcddff9 | 294 | %attr(755,root,root) %{_bindir}/ebook-polish |
23304c7f | 295 | %attr(755,root,root) %{_bindir}/ebook-viewer |
23304c7f | 296 | %attr(755,root,root) %{_bindir}/fetch-ebook-metadata |
23304c7f | 297 | %attr(755,root,root) %{_bindir}/lrf2lrs |
298 | %attr(755,root,root) %{_bindir}/lrfviewer | |
299 | %attr(755,root,root) %{_bindir}/lrs2lrf | |
300 | %attr(755,root,root) %{_bindir}/markdown-calibre | |
23304c7f | 301 | %attr(755,root,root) %{_bindir}/web2disk |
7261ec00 | 302 | %{_libdir}/%{name} |
0e501b81 | 303 | %{_datadir}/%{name} |
8a61eab7 JR |
304 | %{_datadir}/metainfo/calibre-ebook-edit.appdata.xml |
305 | %{_datadir}/metainfo/calibre-ebook-viewer.appdata.xml | |
306 | %{_datadir}/metainfo/calibre-gui.appdata.xml | |
888e3f00 JR |
307 | %{_desktopdir}/calibre-ebook-edit.desktop |
308 | %{_desktopdir}/calibre-ebook-viewer.desktop | |
309 | %{_desktopdir}/calibre-gui.desktop | |
310 | %{_desktopdir}/calibre-lrfviewer.desktop | |
7261ec00 JB |
311 | %{_iconsdir}/hicolor/*x*/apps/calibre-*.png |
312 | %{_iconsdir}/hicolor/*x*/mimetypes/application-lrf.png | |
313 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-kindle-application.png | |
314 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobi8-ebook.png | |
315 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-mobipocket-ebook.png | |
316 | %{_iconsdir}/hicolor/*x*/mimetypes/application-x-topaz-ebook.png | |
317 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-lrf.png | |
318 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-kindle-application.png | |
319 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobi8-ebook.png | |
320 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-mobipocket-ebook.png | |
321 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-application-x-topaz-ebook.png | |
322 | %{_iconsdir}/hicolor/*x*/mimetypes/gnome-mime-text-lrs.png | |
323 | %{_iconsdir}/hicolor/*x*/mimetypes/text-lrs.png | |
888e3f00 | 324 | %{_datadir}/mime/packages/calibre-mimetypes.xml |
7261ec00 | 325 | %{_pixmapsdir}/calibre-gui.png |
81537047 | 326 | %{_pixmapsdir}/calibre-viewer.png |
2eeb7ef1 | 327 | |
888e3f00 JR |
328 | %files -n bash-completion-calibre |
329 | %defattr(644,root,root,755) | |
330 | %{bash_compdir}/calibre | |
824729ab | 331 | |
888e3f00 JR |
332 | %files -n zsh-completion-calibre |
333 | %defattr(644,root,root,755) | |
7261ec00 | 334 | %{_datadir}/zsh/site-functions/_calibre |