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