]> git.pld-linux.org Git - packages/calibre.git/blame - calibre.spec
- fix path to ImageMagick 6.8.x headers
[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...
70031606 4# - -locales.patch needs love
b856ebb4 5#
17e051e1 6# NOTE:
7# Upstream packages some unfree fonts which we cannot redistribute,
8# so when upgrading calibre we should download upstream tarball by hand from
3c9d3d2b 9# http://downloads.sourceforge.net/calibre and run generate-tarball.sh script
10# included as SourceX.
17e051e1 11#
02229893 12Summary: E-book converter and library management
cee72504 13Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków
0e501b81 14Name: calibre
6b37bdf6 15Version: 0.9.35
cdcddff9 16Release: 1
6d15f615 17License: GPL v3+
02229893 18Group: Applications/Multimedia
23304c7f 19Source0: %{name}-%{version}-nofonts.tar.xz
6b37bdf6 20# Source0-md5: 587fe0f85603067c0f11f0e3318fa3c6
3c9d3d2b 21Source1: generate-tarball.sh
5cf7f03b 22Source2: %{name}-mount-helper
0e501b81 23Patch0: %{name}-prefix.patch
152a1c03
JR
24Patch1: %{name}-no-update.patch
25Patch2: %{name}-env_module.patch
26Patch3: %{name}-locales.patch
27Patch4: shebang-python-fix.patch
cdcddff9
JR
28Patch5: imagemagick-6.8.patch
29Patch6: qt4-private.patch
02229893 30URL: http://www.calibre-ebook.com/
3b8cf9a9 31BuildRequires: ImageMagick-devel >= 6.6.4.7
591b7d3d
MB
32BuildRequires: QtGui-devel
33BuildRequires: QtSvg-devel
34BuildRequires: chmlib-devel >= 0.40
212c1324 35BuildRequires: libicu-devel
591b7d3d
MB
36BuildRequires: libmtp-devel >= 1.1.5
37BuildRequires: libwmf-devel >= 0.2.8
f0879852 38BuildRequires: pkgconfig
591b7d3d
MB
39BuildRequires: podofo-devel >= 0.8.2
40BuildRequires: poppler-Qt-devel >= 0.20.2
41BuildRequires: poppler-glib-devel >= 0.20.2
bdbd4238 42BuildRequires: python-BeautifulSoup
307ba398 43BuildRequires: python-PIL
0e501b81 44BuildRequires: python-PyQt4-devel
18642ddc 45BuildRequires: python-PyQt4-devel-tools
251db223 46BuildRequires: python-cssutils >= 1:0.9.9
307ba398 47BuildRequires: python-dateutil
72cd9da3 48BuildRequires: python-devel >= 1:2.7.1
0e501b81 49BuildRequires: python-lxml
50BuildRequires: python-mechanize
6d15f615 51BuildRequires: python-modules-sqlite
0e501b81 52BuildRequires: python-sip-devel
6b37bdf6 53BuildRequires: qt4-devel-private
0e501b81 54BuildRequires: rpm-pythonprov
23304c7f 55BuildRequires: rpmbuild(macros) >= 1.586
ddb4b081 56BuildRequires: sed >= 4.0
212c1324 57BuildRequires: sqlite3-devel
23304c7f 58BuildRequires: tar >= 1:1.22
f6f5b3d6 59BuildRequires: unzip
3c9d3d2b 60BuildRequires: xdg-utils
23304c7f 61BuildRequires: xz >= 1:4.999.7
591b7d3d
MB
62Requires: python-BeautifulSoup >= 3.0.5
63Requires: python-PIL >= 1.1.6
64Requires: python-PyQt4 >= 4.9.1
65Requires: python-cssselect >= 0.7.1
251db223 66Requires: python-cssutils >= 1:0.9.9
591b7d3d
MB
67Requires: python-dateutil >= 1.4.1
68Requires: python-dns >= 1.6.0
69Requires: python-genshi
70Requires: python-lxml >= 2.2.1
71Requires: python-mechanize >= 0.1.11
6d15f615 72Requires: python-modules-sqlite
591b7d3d
MB
73Requires: python-netifaces >= 0.8
74Requires: python-psutil >= 0.6.1
b0073032 75Suggests: ImageMagick-coder-jpeg
76Suggests: ImageMagick-coder-png
400a540b
PG
77### FIXME: libunrar.so is needed for rar-packed files
78Suggests: libunrar-devel
b0073032 79Suggests: poppler-progs
0e501b81 80BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81
82%description
02229893
ER
83Calibre is meant to be a complete e-library solution. It includes
84library management, format conversion, news feeds to ebook conversion
85as well as e-book reader sync features.
86
87Calibre is primarily a ebook cataloging program. It manages your ebook
88collection for you. It is designed around the concept of the logical
89book, i.e. a single entry in the database that may correspond to
90ebooks in several formats. It also supports conversion to and from a
91dozen different ebook formats.
92
93Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML,
94CBR, CBZ, RTF, TXT, PDF and LRS.
0e501b81 95
cee72504 96%description -l pl.UTF-8
97Calibre to bardzo dobry i darmowy program do czytania e-książek.
98
99Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu
100formatów do ich postaci. Program obsługuje następujące typy plików:
101import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML
102eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza.
103
104Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i
105najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy
106dołączyli również aplikację, którą użytkownik może wykorzystać jako
107swój własny serwer darmowych książek.
108
62c1bf99 109%package -n bash-completion-calibre
110Summary: bash-completion for calibre
111Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre
112Group: Applications/Shells
113Requires: %{name} = %{version}-%{release}
956f97d9 114Requires: bash-completion
62c1bf99 115
116%description -n bash-completion-calibre
117bash-completion for calibre.
118
119%description -n bash-completion-calibre -l pl.UTF-8
120Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre.
121
0e501b81 122%prep
123%setup -q -n %{name}
124%patch0 -p1
152a1c03 125%patch1 -p1
804e0619 126%patch2 -p1
73a1f5ed 127%patch3 -p1
ddb4b081 128%patch4 -p1
cdcddff9
JR
129%patch5 -p1
130%patch6 -p1
f6f5b3d6 131
d781633a
JP
132# 64bit target build fix
133%{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py
134
933d2d03 135# upstream decides to store locale files in a single zip file but we prefer separate .mo
f6f5b3d6 136mkdir resources/localization/locales
137unzip resources/localization/locales.zip -d resources/localization/locales
138chmod 755 resources/localization/locales/*
933d2d03 139rm -f resources/localization/locales.zip
0e501b81 140
141%build
5877892a 142CC="%{__cc}" \
03edf045 143CXX=%{__cxx} \
cdcddff9 144OVERRIDE_CFLAGS="%{rpmcflags}" \
03edf045 145OVERRIDE_LDFLAGS="%{rpmldflags}" \
5c163f25 146%{__python} setup.py build
0e501b81 147
148%install
149rm -rf $RPM_BUILD_ROOT
3550e999 150# create directories for xdg-utils
81537047
JR
151install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \
152 $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
0e501b81 153
3550e999
JR
154XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" \
155XDG_UTILS_INSTALL_MODE="system" \
156LIBPATH="%{_libdir}" \
0e501b81 157%{__python} setup.py install \
9c8cebf1 158 --root=$RPM_BUILD_ROOT \
ab1a9c7b 159 --libdir="%{_libdir}"
0e501b81 160
81537047
JR
161cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png
162cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png
163
e154a7c1
JP
164%py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name}
165%py_comp $RPM_BUILD_ROOT%{_libdir}/%{name}
166%py_postclean %{_libdir}/%{name}
167
81537047 168mv $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir}
f6f5b3d6 169
170# set proper filenames for locales (TODO: switch to patch if possible)
81537047 171for file in $RPM_BUILD_ROOT%{_localedir}/*; do
933d2d03 172 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:')
81537047
JR
173 mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
174 mv $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \
175 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
933d2d03 176done;
81537047 177for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do
f6f5b3d6 178 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
81537047
JR
179 mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \
180 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo
f6f5b3d6 181done;
81537047 182for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do
f6f5b3d6 183 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
81537047
JR
184 mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \
185 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo
f6f5b3d6 186done;
ddb4b081 187
e9035516 188%{__rm} $RPM_BUILD_ROOT%{_bindir}/%{name}-uninstall
ddb4b081 189
f6f5b3d6 190# unsupported
591b7d3d
MB
191%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ber
192%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/jv
81537047
JR
193%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ltg
194%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/en_AU
f6f5b3d6 195
d383d054
MM
196install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
197
933d2d03 198%find_lang %{name} --all-name
199
0e501b81 200%clean
201rm -rf $RPM_BUILD_ROOT
202
81537047
JR
203%post
204%update_desktop_database
205%update_mime_database
206%update_icon_cache hicolor
207
208%postun
209if [ $1 -eq 0 ] ; then
210 %update_desktop_database
211 %update_mime_database
212 %update_icon_cache hicolor
213fi
214
933d2d03 215%files -f %{name}.lang
0e501b81 216%defattr(644,root,root,755)
cdcddff9 217%doc Changelog.yaml COPYRIGHT README.md
23304c7f 218%attr(755,root,root) %{_bindir}/calibre
219%attr(755,root,root) %{_bindir}/calibre-complete
220%attr(755,root,root) %{_bindir}/calibre-customize
221%attr(755,root,root) %{_bindir}/calibre-debug
d383d054 222%attr(755,root,root) %{_bindir}/calibre-mount-helper
23304c7f 223%attr(755,root,root) %{_bindir}/calibre-parallel
224%attr(755,root,root) %{_bindir}/calibre-server
225%attr(755,root,root) %{_bindir}/calibre-smtp
226%attr(755,root,root) %{_bindir}/calibredb
227%attr(755,root,root) %{_bindir}/ebook-convert
228%attr(755,root,root) %{_bindir}/ebook-device
229%attr(755,root,root) %{_bindir}/ebook-meta
cdcddff9 230%attr(755,root,root) %{_bindir}/ebook-polish
23304c7f 231%attr(755,root,root) %{_bindir}/ebook-viewer
23304c7f 232%attr(755,root,root) %{_bindir}/fetch-ebook-metadata
23304c7f 233%attr(755,root,root) %{_bindir}/lrf2lrs
234%attr(755,root,root) %{_bindir}/lrfviewer
235%attr(755,root,root) %{_bindir}/lrs2lrf
236%attr(755,root,root) %{_bindir}/markdown-calibre
23304c7f 237%attr(755,root,root) %{_bindir}/web2disk
0e501b81 238%{_datadir}/%{name}
239%{_libdir}/%{name}
81537047
JR
240%{_desktopdir}/calibre-ebook-viewer.desktop
241%{_desktopdir}/calibre-gui.desktop
242%{_desktopdir}/calibre-lrfviewer.desktop
591b7d3d 243%{_iconsdir}/hicolor/*/*/*.png
cdcddff9 244%{_datadir}/mime/application/*.xml
81537047
JR
245%{_datadir}/mime/packages/calibre-mimetypes.xml
246%{_pixmapsdir}/%{name}-gui.png
247%{_pixmapsdir}/calibre-viewer.png
62c1bf99 248
249%files -n bash-completion-calibre
250%defattr(644,root,root,755)
251%{_sysconfdir}/bash_completion.d/*
This page took 0.15045 seconds and 4 git commands to generate.