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