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