]> git.pld-linux.org Git - packages/calibre.git/blame - calibre.spec
- up to 6.10.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
ede0a15a 14Version: 6.10.0
13db37e2 15Release: 1
6d15f615 16License: GPL v3+
02229893 17Group: Applications/Multimedia
1068761e 18Source0: %{name}-%{version}-nofonts.tar.xz
ede0a15a 19# Source0-md5: f35bd1a5f0096413b0ccb3924754b340
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
54faabcd 29%define pyqt6_ver 6.3.1
88ce68b2 30%define apsw_ver 3.38.0
824729ab
AF
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
54faabcd
JR
42BuildRequires: Qt6Core-devel
43BuildRequires: Qt6DBus-devel
44BuildRequires: Qt6Gui-devel
45BuildRequires: Qt6WebEngine-devel
46BuildRequires: Qt6Widgets-devel
591b7d3d 47BuildRequires: chmlib-devel >= 0.40
fe8c5b5e 48BuildRequires: hunspell-devel
4602aede 49BuildRequires: hyphen-devel
212c1324 50BuildRequires: libicu-devel
389ef12d 51BuildRequires: libinput-devel
591b7d3d
MB
52BuildRequires: libmtp-devel >= 1.1.5
53BuildRequires: libwmf-devel >= 0.2.8
f4da95e9 54BuildRequires: mtdev-devel
f0879852 55BuildRequires: pkgconfig
591b7d3d 56BuildRequires: podofo-devel >= 0.8.2
f4da95e9 57BuildRequires: poppler-glib-devel >= 0.28.1
54faabcd
JR
58BuildRequires: poppler-qt6-devel >= 0.28.1
59BuildRequires: python3-PyQt6-devel-tools >= %{pyqt6_ver}
49a96cf0 60BuildRequires: python3-PyQt-builder
54faabcd
JR
61BuildRequires: python3-PyQt6 >= %{pyqt6_ver}
62BuildRequires: python3-PyQt6-uic >= %{pyqt6_ver}
63BuildRequires: python3-PyQt6-WebEngine
fd5ce78b 64BuildRequires: python3-apsw >= %{apsw_ver}
b0d52b63 65BuildRequires: python3-bs4 >= %{baeutifulsoup_ver}
fd5ce78b
JR
66BuildRequires: python3-css_parser
67BuildRequires: python3-cssselect >= %{cssselect_ver}
68BuildRequires: python3-cssutils >= %{cssutils_ver}
69BuildRequires: python3-dateutil >= %{dateutil_ver}
70BuildRequires: python3-devel >= 1:2.7.1
71BuildRequires: python3-dns >= %{dns_ver}
49a96cf0 72#BuildRequires: python3-genshi
fd5ce78b 73BuildRequires: python3-html5-parser
ede0a15a 74BuildRequires: python3-jeepney
fd5ce78b 75BuildRequires: python3-lxml >= %{lxml_ver}
b0d52b63 76BuildRequires: python3-mechanize >= %{mechanize_ver}
fd5ce78b
JR
77BuildRequires: python3-msgpack >= %{msgpack_ver}
78BuildRequires: python3-netifaces >= %{netifaces_ver}
b0d52b63 79BuildRequires: python3-pillow >= %{pil_ver}
fd5ce78b
JR
80BuildRequires: python3-psutil >= %{psutil_ver}
81BuildRequires: python3-regex
54faabcd 82BuildRequires: qt6-build
0e501b81 83BuildRequires: rpm-pythonprov
c0c82cf2 84BuildRequires: rpmbuild(macros) >= 1.710
ddb4b081 85BuildRequires: sed >= 4.0
b0d52b63 86BuildRequires: sip6
54faabcd 87BuildRequires: sip-PyQt6 >= %{pyqt6_ver}
43b56935 88BuildRequires: sqlite3-devel
23304c7f 89BuildRequires: tar >= 1:1.22
f6f5b3d6 90BuildRequires: unzip
3c9d3d2b 91BuildRequires: xdg-utils
23304c7f 92BuildRequires: xz >= 1:4.999.7
54faabcd
JR
93Requires: Qt6Svg
94Requires: Qt6WebEngine
95Requires: python3-PyQt6 >= %{pyqt6_ver}
96Requires: python3-PyQt6-WebEngine
2efc6790 97Requires: python3-apsw >= %{apsw_ver}
b0d52b63 98Requires: python3-bs4 >= %{baeutifulsoup_ver}
2efc6790
JR
99Requires: python3-css_parser
100Requires: python3-cssselect >= %{cssselect_ver}
101Requires: python3-cssutils >= %{cssutils_ver}
102Requires: python3-dateutil >= %{dateutil_ver}
103Requires: python3-dns >= %{dns_ver}
104#Requires: python3-genshi
105Requires: python3-html5-parser
ede0a15a 106Requires: python3-jeepney
2efc6790 107Requires: python3-lxml >= %{lxml_ver}
b0d52b63 108Requires: python3-mechanize >= %{mechanize_ver}
2efc6790
JR
109Requires: python3-msgpack >= %{msgpack_ver}
110Requires: python3-netifaces >= %{netifaces_ver}
b0d52b63 111Requires: python3-pillow >= %{pil_ver}
2efc6790
JR
112Requires: python3-psutil >= %{psutil_ver}
113Requires: python3-regex
b0073032 114Suggests: ImageMagick-coder-jpeg
115Suggests: ImageMagick-coder-png
400a540b
PG
116### FIXME: libunrar.so is needed for rar-packed files
117Suggests: libunrar-devel
b0073032 118Suggests: poppler-progs
0e501b81 119BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
120
121%description
02229893
ER
122Calibre is meant to be a complete e-library solution. It includes
123library management, format conversion, news feeds to ebook conversion
124as well as e-book reader sync features.
125
126Calibre is primarily a ebook cataloging program. It manages your ebook
127collection for you. It is designed around the concept of the logical
128book, i.e. a single entry in the database that may correspond to
129ebooks in several formats. It also supports conversion to and from a
130dozen different ebook formats.
131
132Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML,
133CBR, CBZ, RTF, TXT, PDF and LRS.
0e501b81 134
cee72504 135%description -l pl.UTF-8
136Calibre to bardzo dobry i darmowy program do czytania e-książek.
137
138Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu
139formatów do ich postaci. Program obsługuje następujące typy plików:
140import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML
141eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza.
142
143Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i
144najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy
145dołączyli również aplikację, którą użytkownik może wykorzystać jako
146swój własny serwer darmowych książek.
147
888e3f00
JR
148%package -n bash-completion-calibre
149Summary: bash-completion for calibre
150Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre
151Group: Applications/Shells
152Requires: %{name} = %{version}-%{release}
153Requires: bash-completion
888e3f00 154BuildArch: noarch
888e3f00
JR
155
156%description -n bash-completion-calibre
157bash-completion for calibre.
158
159%description -n bash-completion-calibre -l pl.UTF-8
160Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre.
161
162%package -n zsh-completion-calibre
163Summary: zsh-completion for calibre
164Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh
165Group: Applications/Shells
166Requires: %{name} = %{version}-%{release}
167Requires: bash-completion
168
169%description -n zsh-completion-calibre
170zsh-completion for calibre.
171
172%description -n zsh-completion-calibre -l pl.UTF-8
173Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh.
824729ab 174
0e501b81 175%prep
6fa79409 176%setup -q
0e501b81 177%patch0 -p1
ad58ec42 178%patch1 -p1
804e0619 179%patch2 -p1
270a5ef0 180%patch3 -p1
43b56935 181%patch4 -p1
f6f5b3d6 182
d781633a
JP
183# 64bit target build fix
184%{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py
185
933d2d03 186# upstream decides to store locale files in a single zip file but we prefer separate .mo
f6f5b3d6 187mkdir resources/localization/locales
188unzip resources/localization/locales.zip -d resources/localization/locales
189chmod 755 resources/localization/locales/*
933d2d03 190rm -f resources/localization/locales.zip
0e501b81 191
192%build
5877892a 193CC="%{__cc}" \
03edf045 194CXX=%{__cxx} \
cdcddff9 195OVERRIDE_CFLAGS="%{rpmcflags}" \
03edf045 196OVERRIDE_LDFLAGS="%{rpmldflags}" \
54faabcd 197QMAKE="%{_bindir}/qmake-qt6" \
49a96cf0 198%{__python3} setup.py build
0e501b81 199
200%install
201rm -rf $RPM_BUILD_ROOT
3550e999 202# create directories for xdg-utils
81537047 203install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \
43b56935 204$RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},%{zsh_compdir}}
0e501b81 205
7b172d7e
JR
206export XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}"
207export XDG_UTILS_INSTALL_MODE="system"
208export LIBPATH="%{_libdir}"
49a96cf0 209%{__python3} setup.py install \
389ef12d 210 --no-compile \
389ef12d 211 --root=$RPM_BUILD_ROOT \
7b172d7e
JR
212 --prefix=%{_prefix} \
213 --bindir=%{_bindir} \
214 --libdir=%{_libdir} \
215 --sharedir=%{_datadir}
0e501b81 216
b0d52b63
JR
217%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \
218 -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
219 $RPM_BUILD_ROOT%{_bindir}/* \
220 $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}/devices/cli.py \
221 $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}/devices/mtp/unix/upstream/update.py
7261ec00 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
b0d52b63
JR
226%py3_comp $RPM_BUILD_ROOT%{_libdir}/%{name}
227%py3_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name}
e154a7c1 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 232for 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 237done;
81537047 238for 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 242done;
81537047 243for 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
247done;
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
4602aede 253%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{jv,ltg,uz@Latn}
f6f5b3d6 254
43b56935 255cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
d383d054 256
933d2d03 257%find_lang %{name} --all-name
7b172d7e
JR
258for 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
261done;
933d2d03 262
0e501b81 263%clean
264rm -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
272if [ $1 -eq 0 ] ; then
273 %update_desktop_database
274 %update_mime_database
275 %update_icon_cache hicolor
276fi
277
933d2d03 278%files -f %{name}.lang
0e501b81 279%defattr(644,root,root,755)
b0d52b63 280%doc Changelog.txt 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}
b0d52b63
JR
304%{_datadir}/metainfo/calibre-ebook-edit.metainfo.xml
305%{_datadir}/metainfo/calibre-ebook-viewer.metainfo.xml
306%{_datadir}/metainfo/calibre-gui.metainfo.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)
fe8c5b5e
ŁM
330%{bash_compdir}/*
331
888e3f00
JR
332%files -n zsh-completion-calibre
333%defattr(644,root,root,755)
43b56935 334%{zsh_compdir}/_calibre
This page took 0.1662 seconds and 4 git commands to generate.