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