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