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