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