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

Revision 1970, 15.9 KB checked in by munepi, 14 years ago (diff)

updated calibre-vl.spec

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.18
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
24BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
25
26BuildRequires:  python >= 2.6
27BuildRequires:  python-devel >= 2.6
28BuildRequires:  ImageMagick-devel >= 6.5.9
29BuildRequires:  python-setuptools
30BuildRequires:  qt4-devel >= 4.6.0
31BuildRequires:  PyQt4-devel >= 4.7.0
32BuildRequires:  poppler-qt4-devel >= 0.12
33BuildRequires:  podofo-devel
34BuildRequires:  desktop-file-utils
35BuildRequires:  python-mechanize >= 0.1.1
36BuildRequires:  python-lxml >= 2.2.1
37BuildRequires:  python-cssutils >= 0.9.6
38BuildRequires:  python-dateutil >= 1.4.1
39BuildRequires:  python-imaging >= 1.1.6
40BuildRequires:  xdg-utils >= 1.0.2
41BuildRequires:  python-BeautifulSoup >= 3.0.5
42BuildRequires:  xz
43BuildRequires:  unzip
44BuildRequires:  libwmf-devel >= 0.2.8
45BuildRequires:  chmlib-devel >= 0.40
46
47Requires:       PyQt4
48Requires:       pyPdf
49Requires:       python-cherrypy
50Requires:       python-cssutils
51Requires:       ImageMagick
52Requires:       python-odf
53Requires:       python-django-tagging
54Requires:       python-lxml
55Requires:       python-imaging
56Requires:       python-mechanize
57Requires:       python-dateutil
58Requires:       python-genshi
59Requires:       python-BeautifulSoup
60
61## vine
62Requires:       TrueType-liberation
63
64%description
65Calibre is meant to be a complete e-library solution. It includes library
66management, format conversion, news feeds to ebook conversion as well as
67e-book reader sync features.
68
69Calibre is primarily a ebook cataloging program. It manages your ebook
70collection for you. It is designed around the concept of the logical book,
71i.e. a single entry in the database that may correspond to ebooks in several
72formats. It also supports conversion to and from a dozen different ebook
73formats.
74
75Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ,
76RTF, TXT, PDF and LRS.
77
78%prep
79%setup -q -n %{name}
80
81# don't append calibre1 to the name of the manpages. No need to compress either
82# upstream won't fix: http://bugs.calibre-ebook.com/ticket/3770#comment:7
83%patch0 -p1 -b .manpages
84
85# don't check for new upstream version (that's what packagers do)
86%patch1 -p1 -b .no-update
87
88# Enable mount helper
89%patch2 -p1 -b .mounthelper
90
91# dos2unix newline conversion
92%{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/*
93
94# remove shebangs
95%{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*/*.py
96%{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*.py
97%{__sed} -i -e '/^#![ ]*\//, 1d' src/calibre/*/*.py
98%{__sed} -i -e '/^#!\//, 1d' src/calibre/*.py
99%{__sed} -i -e '/^#!\//, 1d' resources/recipes/*
100%{__sed} -i -e '/^#!\//, 1d' resources/default_tweaks.py
101
102%{__chmod} -x src/calibre/*/*/*/*.py
103%{__chmod} -x src/calibre/*/*/*.py
104%{__chmod} -x src/calibre/*/*.py
105%{__chmod} -x src/calibre/*.py
106%{__chmod} -x resources/recipes/*
107
108%build
109OVERRIDE_CFLAGS="%{optflags}" QMAKE=%{_libdir}/qt4/bin/qmake python setup.py build
110
111%install
112%__rm -rf %{buildroot}
113
114%__mkdir -p %{buildroot}%{_datadir}
115
116# create directories for xdg-utils
117%__mkdir_p %{buildroot}%{_datadir}/icons
118%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor
119%__mkdir_p %{buildroot}%{_datadir}/packages
120%__mkdir_p %{buildroot}%{_datadir}/mime
121%__mkdir_p %{buildroot}%{_datadir}/mime/packages
122%__mkdir_p %{buildroot}%{_datadir}/applications
123%__mkdir_p %{buildroot}%{_datadir}/desktop-directories
124
125# create directory for calibre environment module
126# the install script assumes it's there.
127%__mkdir_p %{buildroot}%{python_sitelib}
128
129XDG_DATA_DIRS="%{buildroot}%{_datadir}" \
130XDG_UTILS_INSTALL_MODE="system" \
131LIBPATH="%{_libdir}" \
132python setup.py install --root=%{buildroot}%{_prefix} \
133                        --prefix=%{_prefix} \
134                        --libdir=%{_libdir} \
135                        --staging-libdir=%{buildroot}%{_libdir}
136
137# remove shebang from init_calibre.py here because
138# it just got spawned by the install script
139%{__sed} -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/init_calibre.py
140
141# icons
142%__mkdir_p %{buildroot}%{_datadir}/pixmaps/
143%__cp -p resources/images/library.png \
144        %{buildroot}%{_datadir}/pixmaps/%{name}-gui.png
145%__cp -p resources/images/viewer.png \
146        %{buildroot}%{_datadir}/pixmaps/calibre-viewer.png
147
148# every file is empty here
149find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs %__rm -f
150
151# packages aren't allowed to register mimetypes like this
152%__rm -f %{buildroot}%{_datadir}/applications/{defaults.list,mimeinfo.cache}
153
154desktop-file-validate \
155    %{buildroot}%{_datadir}/applications/calibre-ebook-viewer.desktop
156desktop-file-validate \
157    %{buildroot}%{_datadir}/applications/calibre-gui.desktop
158desktop-file-validate \
159    %{buildroot}%{_datadir}/applications/calibre-lrfviewer.desktop
160
161
162%__mv %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes \
163    %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes.xml
164
165# mimetype icon for lrf
166%__rm -rf %{buildroot}%{_datadir}/icons/hicolor/128x128
167%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable
168%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes
169%__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
170%__cp -p resources/images/mimetypes/lrf.png \
171    %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.png
172%__cp -p resources/images/viewer.png \
173    %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.png
174
175# don't put bash completions in /usr/etc
176%__mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot}
177
178# these are provided as separate packages
179%__rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,cssutils}
180%__rm -rf %{buildroot}%{_libdir}/%{name}/cal/utils/genshi
181%__rm -rf %{buildroot}%{_libdir}/%{name}/cal/trac
182
183# link to system fonts after we have deleted (see Source0) the non-free ones
184# http://bugs.calibre-ebook.com/ticket/3832
185%__mkdir_p %{buildroot}%{_datadir}/%{name}/fonts/prs500/
186%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSans-Regular.ttf \
187        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf
188%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSerif-Regular.ttf \
189        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf
190%__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationMono-Regular.ttf \
191        %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf
192
193# http://bugs.calibre-ebook.com/ticket/3770#comment:7
194# man pages
195%__mv %{buildroot}%{_datadir}/%{name}/man %{buildroot}%{_mandir}
196
197# move locales
198%__mv %{buildroot}%{_datadir}/%{name}/localization/locales \
199    %{buildroot}%{_datadir}/locale
200for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/messages.mo; do
201    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
202    %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/messages.mo \
203        %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.mo
204done;
205for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do
206    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
207    %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \
208        %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo
209done;
210for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/qt.qm; do
211    lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
212    %__mv $file %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_$lang.qm
213done;
214
215%find_lang %{name} --with-qt --all-name
216
217# locales should be looked for in the proper place
218%{__sed} -i -e "s:P('localization/locales:('/usr/share/locale:" \
219        -e "s/messages.mo/calibre.mo/" \
220        -e "s/iso639.mo/calibre_iso639.mo/" \
221        %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py
222
223%{__rm} -f %{buildroot}%{_bindir}/%{name}-uninstall   
224
225%clean
226%{__rm} -rf %{buildroot}
227
228%post
229update-desktop-database &> /dev/null ||:
230update-mime-database %{_datadir}/mime &> /dev/null || :
231touch --no-create %{_datadir}/icons/hicolor || :
232if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
233    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
234fi
235
236%postun
237update-desktop-database &> /dev/null ||:
238update-mime-database %{_datadir}/mime &> /dev/null || :
239touch --no-create %{_datadir}/icons/hicolor || :
240if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
241    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
242fi
243
244%files -f %{name}.lang
245
246%defattr(-,root,root,-)
247%doc COPYRIGHT LICENSE Changelog.yaml
248%{_bindir}/*
249%config(noreplace) %{_sysconfdir}/bash_completion.d/
250%{_libdir}/%{name}
251%{_datadir}/%{name}
252%{_datadir}/pixmaps/*
253%{_datadir}/applications/*
254%{_datadir}/mime/packages/*
255%{_datadir}/icons/hicolor/scalable/mimetypes/*
256%{_datadir}/icons/hicolor/scalable/apps/*
257%{python_sitelib}/init_calibre.py*
258%{_mandir}/man1/*
259
260%changelog
261* Wed Sep 29 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.7.18-1
262- new upstream release
263- Fix svg/png changes.
264
265* Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 0.7.15-1
266- initial build based on Fedora development
267
268
269* Sat Aug 21 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.15-1
270- Update to 0.7.15
271
272* Thu Aug 19 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.7.14-2
273- rebuild (poppler)
274
275* Fri Aug 13 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.14-1
276- Update to 0.7.14
277
278* Fri Aug 06 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.13-1
279- Update to 0.7.13
280
281* Mon Aug 02 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.12-1
282- Update to 0.7.12
283
284* Fri Jul 30 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.11-1
285- Update to 0.7.11
286
287* Fri Jul 30 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.10-2
288- Rebuilt for python2.7
289
290* Fri Jul 23 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.10-1
291- Update to 0.7.10
292
293* Sat Jul 17 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.9-1
294- Update to 0.7.9
295
296* Sun Jul 11 2010 Michal Nowak <mnowak@redhat.com> - 0.7.8-1
297- Update to 0.7.8
298- build tar.xz instead of tar.bz2
299
300* Fri Jul 02 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.7-1
301- Update to 0.7.7
302
303* Wed Jun 30 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.6-1
304- Update to 0.7.6
305
306* Fri Jun 25 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.5-1
307- Update to 0.7.5
308
309* Sun Jun 20 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.4-1
310- Update to 0.7.4
311
312* Tue Jun 08 2010 Dan Horák <dan@danny.cz> - 0.7.1-2
313- rebuilt with podofo 0.8.1
314
315* Mon Jun 07 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.1-1
316- Update to 0.7.1
317- Added versioned dep on python-cssutils to make sure at least 0.9.6 is installed.
318
319* Fri Jun 04 2010 Kevin Fenzi <kevin@tummy.com> - 0.7.0-1
320- Update to 0.7.0
321
322* Fri May 28 2010 Kevin Fenzi <kevin@tummy.com> - 0.6.55-1
323- Update to 0.6.55
324
325* Fri May 21 2010 Kevin Fenzi <kevin@tummy.com> - 0.6.54-1
326- Update to 0.6.54
327
328* Fri May 21 2010 Kevin Fenzi <kevin@tummy.com> - 0.6.53-1
329- Update to 0.6.53
330
331* Wed May  5 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.6.47-2
332- Rebuild against new poppler
333
334* Sat Apr 10 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.47-1
335- new upstream release 0.6.47
336- new chmlib requirement
337- create directory for calibre's environment module
338- use bzip2 instead of gzip when preparing tarball in generate-tarball.sh
339- remove cssutils patches (we now have python-cssutils 0.9.6 in Fedora)
340
341* Fri Feb 26 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.42-1
342- new upstream release 0.6.42
343- remove shebang from default_tweaks.py
344
345* Mon Feb  1 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.37-1
346- new upstream release 0.6.37
347
348* Fri Jan 29 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.36-1
349- new upstream release 0.6.36
350- fixed a cssprofiles issue with loading the profiles
351
352* Tue Jan 26 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.35-3
353- added -cssprofiles patch to cvs
354
355* Tue Jan 26 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.35-2
356- remove python-cssutils 0.9.6 dependency
357
358* Mon Jan 25 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.35-1
359- new upstream release
360- fedora includes cssutils >= 0.9.6 now; removed the cssprofiles patch
361- removed -executables patch, upstream fixed it: http://bugs.calibre-ebook.com/ticket/4437
362
363* Wed Jan  6 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.32-2
364- fix for package tagged without adding new patch to cvs
365
366* Wed Jan  6 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.32-1
367- new upstream release 0.6.32
368- project website has changed
369- added python-BeautifulSoup BuildRequire
370- new patch to fix full buildpath in binary files
371
372* Sun Dec  6 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.26-1
373- New upstream version
374- Regenerated no-update patch because of code relocation
375
376* Wed Dec  2 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.25-1
377- New upstream release
378
379* Wed Nov 18 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.24-1
380- New upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.2416Nov2009
381
382* Mon Nov 16 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.23-1
383- new upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.2313Nov2009
384- patch to stop checking for new upstream version
385
386* Sat Nov  7 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.21-1
387- new upstream version: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.2106Nov2009
388- added python-BeautifulSoup requirement
389
390* Wed Nov  4 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> - 0.6.20-1
391- new upstream version:
392http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.2030Oct2009
393- upstream now ships correct .desktop files
394- fixed missing dependency: PyQt4
395- fixed calibre-gui icon
396
397* Thu Oct 22 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.19-3
398- removed unfree fonts from source package
399
400* Thu Oct 22 2009 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.19-2
401- readability enhancements
402- added python-genshi requires
403- removed libwmf require since ImageMagick provides libwmf-lite as a
404  dependency and that's what we actually need
405
406* Wed Oct 21 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> - 0.6.19-1
407- new upstream version:
408  http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.1920Oct2009
409- delete fonts, calibre can find the system fonts
410- specify libdir as an install option, so calibre will link properly
411  even on 64bit
412
413* Mon Oct 19 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> - 0.6.18-1
414- updated requires list
415- new upstream release
416- can override CFLAGS now
417- removed trac and genshi duplicates
418- use xdg env variables to do desktop integration in the buildroot
419- added xdg-utils buildrequire
420- install udev rules in /usr/lib even on 64bit and don't own the whole dir
421- removed wrongly used Version field from .desktop files
422
423* Mon Oct 12 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> - 0.6.17-2
424- mimick what calibre's desktop-integration script does (mimetypes, icons etc.)
425- removed unneeded INSTALL file
426- marked bash completion file as config(noreplace) and take ownership of the dir
427
428* Sat Oct 10 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> - 0.6.17-1
429- new upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.1709Oct2009
430- the install process changed significantly
431- locales were added
432
433* Thu Sep 10 2009 Ionuț Arțăriși <mapleoin@lavabit.com> - 0.6.11-1
434- new upstream release: http://calibre.kovidgoyal.net/wiki/Changelog#Version0.6.1104Sep2009
435- minor path fixes
436- rearranged files section
437
438* Fri Aug 28 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> 0.6.10-1
439- handle desktop files
440- don't compress manpages and don't list them as duplicates
441- added lrfviewer icon
442
443* Tue Aug 25 2009 Ionuț Arțăriși <mapleoin@fedoraproject.org> 0.6.8-1
444- Initial RPM release
Note: See TracBrowser for help on using the repository browser.