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

Revision 2051, 16.2 KB checked in by Takemikaduchi, 14 years ago (diff)

rebuild package

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