2 # TODO: - rewrite generate-tarball.sh script to provide locales.zip handling (if needed)
3 # - make separate server package with init-scripts, etc...
4 # - -locales.patch needs love
7 # Upstream packages some unfree fonts which we cannot redistribute,
8 # so when upgrading calibre we should download upstream tarball by hand from
9 # http://downloads.sourceforge.net/calibre and run generate-tarball.sh script
10 # included as SourceX.
12 Summary: E-book converter and library management
13 Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków
18 Group: Applications/Multimedia
19 Source0: %{name}-%{version}-nofonts.tar.xz
20 # Source0-md5: 433058a748441237f42cc78e4fceeaff
21 Source1: generate-tarball.sh
22 Source2: %{name}-mount-helper
23 Patch0: %{name}-prefix.patch
24 Patch1: %{name}-no-update.patch
25 Patch2: %{name}-env_module.patch
26 Patch3: %{name}-locales.patch
27 Patch4: shebang-python-fix.patch
28 Patch5: imagemagick-6.8.patch
29 Patch6: qt4-private.patch
30 URL: http://www.calibre-ebook.com/
31 BuildRequires: ImageMagick-devel >= 6.6.4.7
32 BuildRequires: QtCore-devel
33 BuildRequires: QtDBus-devel
34 BuildRequires: QtGui-devel
35 BuildRequires: QtSvg-devel
36 BuildRequires: chmlib-devel >= 0.40
37 BuildRequires: libicu-devel
38 BuildRequires: libmtp-devel >= 1.1.5
39 BuildRequires: libwmf-devel >= 0.2.8
40 BuildRequires: pkgconfig
41 BuildRequires: podofo-devel >= 0.8.2
42 BuildRequires: poppler-Qt-devel >= 0.20.2
43 BuildRequires: poppler-glib-devel >= 0.20.2
44 BuildRequires: python-BeautifulSoup
45 BuildRequires: python-PIL
46 BuildRequires: python-PyQt4-devel
47 BuildRequires: python-PyQt4-devel-tools
48 BuildRequires: python-cssutils >= 1:0.9.9
49 BuildRequires: python-dateutil
50 BuildRequires: python-devel >= 1:2.7.1
51 BuildRequires: python-lxml
52 BuildRequires: python-mechanize
53 BuildRequires: python-modules-sqlite
54 BuildRequires: python-sip-devel
55 BuildRequires: qt4-devel-private
56 BuildRequires: rpm-pythonprov
57 BuildRequires: rpmbuild(macros) >= 1.586
58 BuildRequires: sed >= 4.0
59 BuildRequires: sqlite3-devel
60 BuildRequires: tar >= 1:1.22
62 BuildRequires: xdg-utils
63 BuildRequires: xz >= 1:4.999.7
64 Requires: python-BeautifulSoup >= 3.0.5
65 Requires: python-PIL >= 1.1.6
66 Requires: python-PyQt4 >= 4.9.1
68 Requires: python-cssselect >= 0.7.1
69 Requires: python-cssutils >= 1:0.9.9
70 Requires: python-dateutil >= 1.4.1
71 Requires: python-dns >= 1.6.0
72 Requires: python-genshi
73 Requires: python-lxml >= 2.2.1
74 Requires: python-mechanize >= 0.1.11
75 Requires: python-modules-sqlite
76 Requires: python-netifaces >= 0.8
77 Requires: python-psutil >= 0.6.1
78 Suggests: ImageMagick-coder-jpeg
79 Suggests: ImageMagick-coder-png
80 ### FIXME: libunrar.so is needed for rar-packed files
81 Suggests: libunrar-devel
82 Suggests: poppler-progs
83 Obsoletes: bash-completion-calibre < 1.1.0-1
84 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87 Calibre is meant to be a complete e-library solution. It includes
88 library management, format conversion, news feeds to ebook conversion
89 as well as e-book reader sync features.
91 Calibre is primarily a ebook cataloging program. It manages your ebook
92 collection for you. It is designed around the concept of the logical
93 book, i.e. a single entry in the database that may correspond to
94 ebooks in several formats. It also supports conversion to and from a
95 dozen different ebook formats.
97 Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML,
98 CBR, CBZ, RTF, TXT, PDF and LRS.
100 %description -l pl.UTF-8
101 Calibre to bardzo dobry i darmowy program do czytania e-książek.
103 Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu
104 formatów do ich postaci. Program obsługuje następujące typy plików:
105 import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML
106 eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza.
108 Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i
109 najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy
110 dołączyli również aplikację, którą użytkownik może wykorzystać jako
111 swój własny serwer darmowych książek.
123 # 64bit target build fix
124 %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py
126 # upstream decides to store locale files in a single zip file but we prefer separate .mo
127 mkdir resources/localization/locales
128 unzip resources/localization/locales.zip -d resources/localization/locales
129 chmod 755 resources/localization/locales/*
130 rm -f resources/localization/locales.zip
135 OVERRIDE_CFLAGS="%{rpmcflags}" \
136 OVERRIDE_LDFLAGS="%{rpmldflags}" \
137 %{__python} setup.py build
140 rm -rf $RPM_BUILD_ROOT
141 # create directories for xdg-utils
142 install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \
143 $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
145 XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" \
146 XDG_UTILS_INSTALL_MODE="system" \
147 LIBPATH="%{_libdir}" \
148 %{__python} setup.py install \
149 --root=$RPM_BUILD_ROOT \
150 --libdir="%{_libdir}"
152 cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png
153 cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png
155 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name}
156 %py_comp $RPM_BUILD_ROOT%{_libdir}/%{name}
157 %py_postclean %{_libdir}/%{name}
159 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir}
161 # set proper filenames for locales (TODO: switch to patch if possible)
162 for file in $RPM_BUILD_ROOT%{_localedir}/*; do
163 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:')
164 mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
165 mv $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \
166 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
168 for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do
169 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
170 mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \
171 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo
173 for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do
174 lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
175 mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \
176 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo
179 %{__rm} $RPM_BUILD_ROOT%{_bindir}/%{name}-uninstall
182 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ber
183 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/jv
184 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ltg
185 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/en_AU
187 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
189 %find_lang %{name} --all-name
192 rm -rf $RPM_BUILD_ROOT
195 %update_desktop_database
196 %update_mime_database
197 %update_icon_cache hicolor
200 if [ $1 -eq 0 ] ; then
201 %update_desktop_database
202 %update_mime_database
203 %update_icon_cache hicolor
206 %files -f %{name}.lang
207 %defattr(644,root,root,755)
208 %doc Changelog.yaml COPYRIGHT README.md
209 %attr(755,root,root) %{_bindir}/calibre
210 %attr(755,root,root) %{_bindir}/calibre-complete
211 %attr(755,root,root) %{_bindir}/calibre-customize
212 %attr(755,root,root) %{_bindir}/calibre-debug
213 %attr(755,root,root) %{_bindir}/calibre-mount-helper
214 %attr(755,root,root) %{_bindir}/calibre-parallel
215 %attr(755,root,root) %{_bindir}/calibre-server
216 %attr(755,root,root) %{_bindir}/calibre-smtp
217 %attr(755,root,root) %{_bindir}/calibredb
218 %attr(755,root,root) %{_bindir}/ebook-convert
219 %attr(755,root,root) %{_bindir}/ebook-device
220 %attr(755,root,root) %{_bindir}/ebook-meta
221 %attr(755,root,root) %{_bindir}/ebook-polish
222 %attr(755,root,root) %{_bindir}/ebook-viewer
223 %attr(755,root,root) %{_bindir}/fetch-ebook-metadata
224 %attr(755,root,root) %{_bindir}/lrf2lrs
225 %attr(755,root,root) %{_bindir}/lrfviewer
226 %attr(755,root,root) %{_bindir}/lrs2lrf
227 %attr(755,root,root) %{_bindir}/markdown-calibre
228 %attr(755,root,root) %{_bindir}/web2disk
231 %{_desktopdir}/calibre-ebook-viewer.desktop
232 %{_desktopdir}/calibre-gui.desktop
233 %{_desktopdir}/calibre-lrfviewer.desktop
234 %{_iconsdir}/hicolor/*/*/*.png
235 %{_datadir}/mime/application/*.xml
236 %{_datadir}/mime/text/*.xml
237 %{_datadir}/mime/packages/calibre-mimetypes.xml
238 %{_pixmapsdir}/%{name}-gui.png
239 %{_pixmapsdir}/calibre-viewer.png