]> git.pld-linux.org Git - packages/calibre.git/blame - calibre.spec
- fetch 5.44.0, requires python3 now
[packages/calibre.git] / calibre.spec
CommitLineData
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 11Summary: E-book converter and library management
cee72504 12Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków
0e501b81 13Name: calibre
fd5ce78b
JR
14Version: 5.44.0
15Release: 0.1
6d15f615 16License: GPL v3+
02229893 17Group: Applications/Multimedia
1068761e 18Source0: %{name}-%{version}-nofonts.tar.xz
fd5ce78b 19# Source0-md5: 7cbc2603d8bebf7c69747282f604092d
3c9d3d2b 20Source1: generate-tarball.sh
5cf7f03b 21Source2: %{name}-mount-helper
0e501b81 22Patch0: %{name}-prefix.patch
fe8c5b5e
ŁM
23Patch1: %{name}-locales.patch
24Patch2: shebang-python-fix.patch
25Patch3: desktop-integration.patch
43b56935 26Patch4: %{name}-env_module.patch
a117af97 27Patch5: icu68.patch
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
43b56935 38%define msgpack_ver 1.0.0
824729ab
AF
39%define netifaces_ver 0.8
40%define psutil_ver 0.6.1
43b56935 41URL: http://www.calibre-ebook.com/
3b8cf9a9 42BuildRequires: ImageMagick-devel >= 6.6.4.7
ace8b165
JR
43BuildRequires: Qt5Core-devel
44BuildRequires: Qt5DBus-devel
8a61eab7
JR
45BuildRequires: Qt5EventDispatcherSupport-devel
46BuildRequires: Qt5FontDatabaseSupport-devel
ace8b165 47BuildRequires: Qt5Gui-devel
8a61eab7
JR
48BuildRequires: Qt5ServiceSupport-devel
49BuildRequires: Qt5ThemeSupport-devel
6be3ae07 50BuildRequires: Qt5WebEngine-devel
f4da95e9 51BuildRequires: Qt5Widgets-devel
591b7d3d 52BuildRequires: chmlib-devel >= 0.40
fe8c5b5e 53BuildRequires: hunspell-devel
4602aede 54BuildRequires: hyphen-devel
212c1324 55BuildRequires: libicu-devel
389ef12d 56BuildRequires: libinput-devel
591b7d3d
MB
57BuildRequires: libmtp-devel >= 1.1.5
58BuildRequires: libwmf-devel >= 0.2.8
f4da95e9 59BuildRequires: mtdev-devel
f0879852 60BuildRequires: pkgconfig
591b7d3d 61BuildRequires: podofo-devel >= 0.8.2
f4da95e9 62BuildRequires: poppler-glib-devel >= 0.28.1
43b56935 63BuildRequires: poppler-qt5-devel >= 0.28.1
fd5ce78b
JR
64BuildRequires: python3-BeautifulSoup >= %{baeutifulsoup_ver}
65BuildRequires: python3-PIL >= %{pil_ver}
66BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
67BuildRequires: python3-PyQt5-devel-tools >= %{pyqt5_ver}
68BuildRequires: python3-PyQt5-uic >= %{pyqt5_ver}
69BuildRequires: python3-PyQtWebEngine >= %{pyqt5_ver}
70BuildRequires: python3-apsw >= %{apsw_ver}
71BuildRequires: python3-bs4
72BuildRequires: python3-css_parser
73BuildRequires: python3-cssselect >= %{cssselect_ver}
74BuildRequires: python3-cssutils >= %{cssutils_ver}
75BuildRequires: python3-dateutil >= %{dateutil_ver}
76BuildRequires: python3-devel >= 1:2.7.1
77BuildRequires: python3-dns >= %{dns_ver}
78BuildRequires: python3-genshi
79BuildRequires: python3-html5-parser
80BuildRequires: python3-lxml >= %{lxml_ver}
81BuildRequires: python3-mechanize >= %{mechanize_ver}
82BuildRequires: python3-modules-sqlite
83BuildRequires: python3-msgpack >= %{msgpack_ver}
84BuildRequires: python3-netifaces >= %{netifaces_ver}
85BuildRequires: python3-psutil >= %{psutil_ver}
86BuildRequires: python3-regex
87BuildRequires: python3-sip-devel
fb57c0a5 88BuildRequires: qt5-build
f4da95e9 89BuildRequires: qt5-qmake
0e501b81 90BuildRequires: rpm-pythonprov
c0c82cf2 91BuildRequires: rpmbuild(macros) >= 1.710
ddb4b081 92BuildRequires: sed >= 4.0
f4da95e9 93BuildRequires: sip-PyQt5
43b56935 94BuildRequires: sqlite3-devel
23304c7f 95BuildRequires: tar >= 1:1.22
f6f5b3d6 96BuildRequires: unzip
3c9d3d2b 97BuildRequires: xdg-utils
23304c7f 98BuildRequires: xz >= 1:4.999.7
e4bd4d10 99Requires: Qt5Svg
fb57c0a5 100Requires: Qt5WebKit
c23a4fbe 101Requires: Qt5WebEngine
824729ab
AF
102Requires: python-BeautifulSoup >= %{baeutifulsoup_ver}
103Requires: python-PIL >= %{pil_ver}
ace8b165 104Requires: python-PyQt5 >= %{pyqt5_ver}
fe8c5b5e 105Requires: python-PyQtWebEngine >= %{pyqt5_ver}
824729ab 106Requires: python-apsw >= %{apsw_ver}
7b172d7e 107Requires: python-bs4
7b172d7e 108Requires: python-css_parser
43b56935 109Requires: python-cssselect >= %{cssselect_ver}
824729ab
AF
110Requires: python-cssutils >= %{cssutils_ver}
111Requires: python-dateutil >= %{dateutil_ver}
112Requires: python-dns >= %{dns_ver}
591b7d3d 113Requires: python-genshi
8a61eab7 114Requires: python-html5-parser
824729ab
AF
115Requires: python-lxml >= %{lxml_ver}
116Requires: python-mechanize >= %{mechanize_ver}
6d15f615 117Requires: python-modules-sqlite
43b56935 118Requires: python-msgpack >= %{msgpack_ver}
824729ab
AF
119Requires: python-netifaces >= %{netifaces_ver}
120Requires: python-psutil >= %{psutil_ver}
8a61eab7 121Requires: python-regex
b0073032 122Suggests: ImageMagick-coder-jpeg
123Suggests: ImageMagick-coder-png
400a540b
PG
124### FIXME: libunrar.so is needed for rar-packed files
125Suggests: libunrar-devel
b0073032 126Suggests: poppler-progs
0e501b81 127BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
128
129%description
02229893
ER
130Calibre is meant to be a complete e-library solution. It includes
131library management, format conversion, news feeds to ebook conversion
132as well as e-book reader sync features.
133
134Calibre is primarily a ebook cataloging program. It manages your ebook
135collection for you. It is designed around the concept of the logical
136book, i.e. a single entry in the database that may correspond to
137ebooks in several formats. It also supports conversion to and from a
138dozen different ebook formats.
139
140Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML,
141CBR, CBZ, RTF, TXT, PDF and LRS.
0e501b81 142
cee72504 143%description -l pl.UTF-8
144Calibre to bardzo dobry i darmowy program do czytania e-książek.
145
146Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu
147formatów do ich postaci. Program obsługuje następujące typy plików:
148import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML
149eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza.
150
151Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i
152najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy
153dołączyli również aplikację, którą użytkownik może wykorzystać jako
154swój własny serwer darmowych książek.
155
888e3f00
JR
156%package -n bash-completion-calibre
157Summary: bash-completion for calibre
158Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre
159Group: Applications/Shells
160Requires: %{name} = %{version}-%{release}
161Requires: bash-completion
888e3f00 162BuildArch: noarch
888e3f00
JR
163
164%description -n bash-completion-calibre
165bash-completion for calibre.
166
167%description -n bash-completion-calibre -l pl.UTF-8
168Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre.
169
170%package -n zsh-completion-calibre
171Summary: zsh-completion for calibre
172Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh
173Group: Applications/Shells
174Requires: %{name} = %{version}-%{release}
175Requires: bash-completion
176
177%description -n zsh-completion-calibre
178zsh-completion for calibre.
179
180%description -n zsh-completion-calibre -l pl.UTF-8
181Pakiet 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
a117af97 190%patch5 -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 196mkdir resources/localization/locales
197unzip resources/localization/locales.zip -d resources/localization/locales
198chmod 755 resources/localization/locales/*
933d2d03 199rm -f resources/localization/locales.zip
0e501b81 200
201%build
5877892a 202CC="%{__cc}" \
03edf045 203CXX=%{__cxx} \
cdcddff9 204OVERRIDE_CFLAGS="%{rpmcflags}" \
03edf045 205OVERRIDE_LDFLAGS="%{rpmldflags}" \
f4da95e9 206QMAKE="%{_bindir}/qmake-qt5" \
389ef12d 207%{__python} setup.py build
0e501b81 208
209%install
210rm -rf $RPM_BUILD_ROOT
3550e999 211# create directories for xdg-utils
81537047 212install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \
43b56935 213$RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},%{zsh_compdir}}
0e501b81 214
7b172d7e
JR
215export XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}"
216export XDG_UTILS_INSTALL_MODE="system"
217export LIBPATH="%{_libdir}"
389ef12d
LM
218%{__python} setup.py install \
219 --no-compile \
389ef12d 220 --root=$RPM_BUILD_ROOT \
7b172d7e
JR
221 --prefix=%{_prefix} \
222 --bindir=%{_bindir} \
223 --libdir=%{_libdir} \
224 --sharedir=%{_datadir}
0e501b81 225
7261ec00
JB
226%{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_bindir}/*
227
81537047
JR
228cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png
229cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png
230
e154a7c1 231%py_comp $RPM_BUILD_ROOT%{_libdir}/%{name}
7261ec00 232%py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name}
e154a7c1
JP
233%py_postclean %{_libdir}/%{name}
234
270a5ef0 235%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir}
f6f5b3d6 236
237# set proper filenames for locales (TODO: switch to patch if possible)
81537047 238for file in $RPM_BUILD_ROOT%{_localedir}/*; do
933d2d03 239 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:')
81537047 240 mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
7261ec00 241 %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \
270a5ef0 242 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
933d2d03 243done;
81537047 244for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do
f6f5b3d6 245 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
7261ec00 246 %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \
270a5ef0 247 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo
f6f5b3d6 248done;
81537047 249for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do
f6f5b3d6 250 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
7261ec00 251 %{__mv} $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \
270a5ef0
JR
252 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo
253done;
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 261cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
d383d054 262
933d2d03 263%find_lang %{name} --all-name
7b172d7e
JR
264for 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
267done;
933d2d03 268
0e501b81 269%clean
270rm -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
278if [ $1 -eq 0 ] ; then
279 %update_desktop_database
280 %update_mime_database
281 %update_icon_cache hicolor
282fi
283
933d2d03 284%files -f %{name}.lang
0e501b81 285%defattr(644,root,root,755)
cdcddff9 286%doc Changelog.yaml 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}
8a61eab7
JR
310%{_datadir}/metainfo/calibre-ebook-edit.appdata.xml
311%{_datadir}/metainfo/calibre-ebook-viewer.appdata.xml
312%{_datadir}/metainfo/calibre-gui.appdata.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
824729ab 338
888e3f00
JR
339%files -n zsh-completion-calibre
340%defattr(644,root,root,755)
43b56935 341%{zsh_compdir}/_calibre
This page took 0.195943 seconds and 4 git commands to generate.