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