source: projects/specs/trunk/c/calibre/calibre-vl.spec @ 1741

Revision 1741, 11.0 KB checked in by munepi, 14 years ago (diff)

NEW calibre: updated/added calibre's dependencies

Line 
1%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
2
3Name:           calibre
4Version:        0.7.15
5Release:        1%{?dist}
6Summary:        E-book converter and library management
7Group:          Applications/Multimedia
8License:        GPLv3
9URL:            http://calibre-ebook.com/
10
11# SourceURL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
12
13# Upstream packages some unfree fonts which we cannot redistribute.
14# While we're at it, also delete the liberation fonts which we already have.
15#
16# Download the upstream tarball and invoke this script while in the tarball's
17# directory:
18# ./generate-tarball.sh %{version}
19Source0:        %{name}-%{version}-nofonts.tar.xz
20Source1:        generate-tarball.sh
21Patch0:         %{name}-manpages.patch
22Patch1:         %{name}-no-update.patch
23Patch2:         %{name}-0.6.53-mounthelper.patch
24Patch3:         %{name}-0.6.47-python-fix.patch
25BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
26
27BuildRequires:  python >= 2.6
28BuildRequires:  python-devel >= 2.6
29BuildRequires:  ImageMagick-devel >= 6.5.9
30BuildRequires:  python-setuptools
31BuildRequires:  qt4-devel >= 4.6.0
32BuildRequires:  PyQt4-devel >= 4.7.0
33BuildRequires:  poppler-qt4-devel >= 0.12
34BuildRequires:  podofo-devel
35BuildRequires:  desktop-file-utils
36BuildRequires:  python-mechanize >= 0.1.1
37BuildRequires:  python-lxml >= 2.2.1
38BuildRequires:  python-cssutils >= 0.9.6
39BuildRequires:  python-dateutil >= 1.4.1
40BuildRequires:  python-imaging >= 1.1.6
41BuildRequires:  xdg-utils >= 1.0.2
42BuildRequires:  python-BeautifulSoup >= 3.0.5
43BuildRequires:  xz
44BuildRequires:  unzip
45BuildRequires:  libwmf-devel >= 0.2.8
46BuildRequires:  chmlib-devel >= 0.40
47
48Requires:       PyQt4
49Requires:       pyPdf
50Requires:       python-cherrypy
51Requires:       python-cssutils
52Requires:       ImageMagick
53Requires:       python-odf
54Requires:       python-django-tagging
55Requires:       python-lxml
56Requires:       python-imaging
57Requires:       python-mechanize
58Requires:       python-dateutil
59Requires:       python-genshi
60Requires:       python-BeautifulSoup
61
62## vine
63Requires:       TrueType-liberation
64
65%description
66Calibre is meant to be a complete e-library solution. It includes library
67management, format conversion, news feeds to ebook conversion as well as
68e-book reader sync features.
69
70Calibre is primarily a ebook cataloging program. It manages your ebook
71collection for you. It is designed around the concept of the logical book,
72i.e. a single entry in the database that may correspond to ebooks in several
73formats. It also supports conversion to and from a dozen different ebook
74formats.
75
76Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ,
77RTF, TXT, PDF and LRS.
78
79%prep
80%setup -q -n %{name}
81
82# # remove redundant / non-free fonts
83# %__rm -rf resources/fonts/*
84
85# don't append calibre1 to the name of the manpages. No need to compress either
86# upstream won't fix: http://bugs.calibre-ebook.com/ticket/3770#comment:7
87%patch0 -p1 -b .manpages
88
89# don't check for new upstream version (that's what packagers do)
90%patch1 -p1 -b .no-update
91
92# Enable mount helper
93%patch2 -p1 -b .mounthelper
94#% patch3 -p1 -b .python-fix
95
96# dos2unix newline conversion
97%{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/*
98
99# remove shebangs
100%{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*/*.py
101%{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*.py
102%{__sed} -i -e '/^#![ ]*\//, 1d' src/calibre/*/*.py
103%{__sed} -i -e '/^#!\//, 1d' src/calibre/*.py
104%{__sed} -i -e '/^#!\//, 1d' resources/recipes/*
105%{__sed} -i -e '/^#!\//, 1d' resources/default_tweaks.py
106
107%{__chmod} -x src/calibre/*/*/*/*.py
108%{__chmod} -x src/calibre/*/*/*.py
109%{__chmod} -x src/calibre/*/*.py
110%{__chmod} -x src/calibre/*.py
111%{__chmod} -x resources/recipes/*
112
113%build
114OVERRIDE_CFLAGS="%{optflags}" QMAKE=%{_libdir}/qt4/bin/qmake python setup.py build
115
116%install
117%__rm -rf %{buildroot}
118
119%__mkdir -p %{buildroot}%{_datadir}
120
121# create directories for xdg-utils
122%__mkdir_p %{buildroot}%{_datadir}/icons
123%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor
124%__mkdir_p %{buildroot}%{_datadir}/packages
125%__mkdir_p %{buildroot}%{_datadir}/mime
126%__mkdir_p %{buildroot}%{_datadir}/mime/packages
127%__mkdir_p %{buildroot}%{_datadir}/applications
128%__mkdir_p %{buildroot}%{_datadir}/desktop-directories
129
130# create directory for calibre environment module
131# the install script assumes it's there.
132%__mkdir_p %{buildroot}%{python_sitelib}
133
134XDG_DATA_DIRS="%{buildroot}%{_datadir}" \
135XDG_UTILS_INSTALL_MODE="system" \
136LIBPATH="%{_libdir}" \
137python setup.py install --root=%{buildroot}%{_prefix} \
138                        --prefix=%{_prefix} \
139                        --libdir=%{_libdir} \
140                        --staging-libdir=%{buildroot}%{_libdir}
141
142# remove shebang from init_calibre.py here because
143# it just got spawned by the install script
144%{__sed} -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/init_calibre.py
145
146# icons
147%__mkdir_p %{buildroot}%{_datadir}/pixmaps/
148%__cp -p resources/images/library.png \
149        %{buildroot}%{_datadir}/pixmaps/%{name}-gui.png
150%__cp -p resources/images/viewer.svg \
151        %{buildroot}%{_datadir}/pixmaps/calibre-viewer.svg
152
153# every file is empty here
154find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs %__rm -f
155
156# packages aren't allowed to register mimetypes like this
157%__rm -f %{buildroot}%{_datadir}/applications/{defaults.list,mimeinfo.cache}
158
159desktop-file-validate \
160    %{buildroot}%{_datadir}/applications/calibre-ebook-viewer.desktop
161desktop-file-validate \
162    %{buildroot}%{_datadir}/applications/calibre-gui.desktop
163desktop-file-validate \
164    %{buildroot}%{_datadir}/applications/calibre-lrfviewer.desktop
165
166
167%__mv %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes \
168    %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes.xml
169
170# mimetype icon for lrf
171%__rm -rf %{buildroot}%{_datadir}/icons/hicolor/128x128
172%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable
173%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes
174%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
175%__cp -p resources/images/mimetypes/lrf.svg \
176    %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.svg
177%__cp -p resources/images/viewer.svg \
178    %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.svg
179
180# don't put bash completions in /usr/etc
181%__mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot}
182
183# these are provided as separate packages
184%__rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,cssutils}
185%__rm -rf %{buildroot}%{_libdir}/%{name}/cal/utils/genshi
186%__rm -rf %{buildroot}%{_libdir}/%{name}/cal/trac
187
188# link to system fonts after we have deleted (see Source0) the non-free ones
189# http://bugs.calibre-ebook.com/ticket/3832
190%__mkdir_p %{buildroot}%{_datadir}/%{name}/fonts/prs500/
191%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSans-Regular.ttf \
192        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf
193%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSerif-Regular.ttf \
194        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf
195%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationMono-Regular.ttf \
196        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf
197
198# http://bugs.calibre-ebook.com/ticket/3770#comment:7
199# man pages
200%__mv %{buildroot}%{_datadir}/%{name}/man %{buildroot}%{_mandir}
201
202# move locales
203%__mv %{buildroot}%{_datadir}/%{name}/localization/locales \
204    %{buildroot}%{_datadir}/locale
205for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/messages.mo; do
206    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
207    %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/messages.mo \
208        %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.mo
209done;
210for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do
211    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
212    %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \
213        %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo
214done;
215for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/qt.qm; do
216    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
217    %__mv $file %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_$lang.qm
218done;
219
220%find_lang %{name} --with-qt --all-name
221
222# locales should be looked for in the proper place
223%{__sed} -i -e "s:P('localization/locales:('/usr/share/locale:" \
224        -e "s/messages.mo/calibre.mo/" \
225        -e "s/iso639.mo/calibre_iso639.mo/" \
226        %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py
227
228%{__rm} -f %{buildroot}%{_bindir}/%{name}-uninstall   
229
230%clean
231%{__rm} -rf %{buildroot}
232
233%post
234update-desktop-database &> /dev/null ||:
235update-mime-database %{_datadir}/mime &> /dev/null || :
236touch --no-create %{_datadir}/icons/hicolor || :
237if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
238    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
239fi
240
241%postun
242update-desktop-database &> /dev/null ||:
243update-mime-database %{_datadir}/mime &> /dev/null || :
244touch --no-create %{_datadir}/icons/hicolor || :
245if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
246    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
247fi
248
249%files -f %{name}.lang
250
251%defattr(-,root,root,-)
252%doc COPYRIGHT LICENSE Changelog.yaml
253%{_bindir}/*
254%config(noreplace) %{_sysconfdir}/bash_completion.d/
255%{_libdir}/%{name}
256%{_datadir}/%{name}
257%{_datadir}/pixmaps/*
258%{_datadir}/applications/*
259%{_datadir}/mime/packages/*
260%{_datadir}/icons/hicolor/scalable/mimetypes/*
261%{_datadir}/icons/hicolor/scalable/apps/*
262%{python_sitelib}/init_calibre.py*
263%{_mandir}/man1/*
264
265%changelog
266* Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.7.15-1
267- initial build based on Fedora development
268
269* Sun Aug 08 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.13-1mdv2010.1
270+ Revision: 567781
271- update to 0.7.13
272
273* Fri Aug 06 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.12-1mdv2011.0
274+ Revision: 567146
275- update to 0.7.12
276
277* Thu Aug 05 2010 Funda Wang <fwang@mandriva.org> 0.7.10-3mdv2011.0
278+ Revision: 566253
279- rebuild for new poppler
280
281* Fri Jul 30 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.10-2mdv2011.0
282+ Revision: 563265
283- update manpage and no-update patches (from Fedora)
284- drop SOURCE1 and python-cssutils hack, it's not needed anymore as
285  python-cssutils has been updated to 0.9.7b3
286- build with optflags
287- delete mimeinfo.cache too
288
289  + Juan Luis Baptiste <juancho@mandriva.org>
290    - Updated to 0.7.10, redo diff calibre-no-update.patch.
291
292* Sat Jul 10 2010 Funda Wang <fwang@mandriva.org> 0.6.54-2mdv2011.0
293+ Revision: 549995
294- rebuild for new imagemagick
295
296  + Tomas Kindl <supp@mandriva.org>
297    - various minor SPEC fixes and clean-ups
298
299  + Juan Luis Baptiste <juancho@mandriva.org>
300    - Updated to 0.6.54.
301
302* Tue Apr 20 2010 Tomas Kindl <supp@mandriva.org> 0.6.48-1mdv2010.1
303+ Revision: 537127
304- update to 0.6.48
305- fix python-odf and python-django-tagging dependency'
306
307* Tue Apr 20 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-3mdv2010.1
308+ Revision: 536983
309- fix incorrect odf-py require & bump release
310- fix incorrect odf-py require
311
312* Mon Apr 19 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-2mdv2010.1
313+ Revision: 536555
314- enable PoDoFo dependency as we have PoDoFo in MDV now
315
316* Sun Apr 18 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-1mdv2010.1
317+ Revision: 536529
318- initial import containing all pertinent fixes to ensure it will build on Mandriva...
319- create calibre
320
Note: See TracBrowser for help on using the repository browser.