]>
Commit | Line | Data |
---|---|---|
17e051e1 | 1 | # |
81537047 | 2 | # TODO: - rewrite generate-tarball.sh script to provide locales.zip handling (if needed) |
4279cd82 | 3 | # - make separate server package with init-scripts, etc... |
70031606 | 4 | # - -locales.patch needs love |
b856ebb4 | 5 | # |
17e051e1 | 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 | |
3c9d3d2b | 9 | # http://downloads.sourceforge.net/calibre and run generate-tarball.sh script |
10 | # included as SourceX. | |
17e051e1 | 11 | # |
02229893 | 12 | Summary: E-book converter and library management |
cee72504 | 13 | Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków |
0e501b81 | 14 | Name: calibre |
9db9fce2 | 15 | Version: 1.6.0 |
bf629b77 | 16 | Release: 1 |
6d15f615 | 17 | License: GPL v3+ |
02229893 | 18 | Group: Applications/Multimedia |
23304c7f | 19 | Source0: %{name}-%{version}-nofonts.tar.xz |
9db9fce2 | 20 | # Source0-md5: 817edf5bf3d54f53ead7c059c4937e1f |
3c9d3d2b | 21 | Source1: generate-tarball.sh |
5cf7f03b | 22 | Source2: %{name}-mount-helper |
0e501b81 | 23 | Patch0: %{name}-prefix.patch |
152a1c03 JR |
24 | Patch1: %{name}-no-update.patch |
25 | Patch2: %{name}-env_module.patch | |
26 | Patch3: %{name}-locales.patch | |
27 | Patch4: shebang-python-fix.patch | |
cdcddff9 JR |
28 | Patch5: imagemagick-6.8.patch |
29 | Patch6: qt4-private.patch | |
02229893 | 30 | URL: http://www.calibre-ebook.com/ |
824729ab AF |
31 | %define baeutifulsoup_ver 3.0.5 |
32 | %define pil_ver 1.1.6 | |
33 | %define pyqt4_ver 4.9.1 | |
34 | %define apsw_ver 3.8.0.1 | |
35 | %define cssselect_ver 0.7.1 | |
36 | %define cssutils_ver 1:0.9.9 | |
37 | %define dateutil_ver 1.4.1 | |
38 | %define dns_ver 1.6.0 | |
39 | %define lxml_ver 2.2.1 | |
40 | %define mechanize_ver 0.1.11 | |
41 | %define netifaces_ver 0.8 | |
42 | %define psutil_ver 0.6.1 | |
3b8cf9a9 | 43 | BuildRequires: ImageMagick-devel >= 6.6.4.7 |
a6ec5715 JP |
44 | BuildRequires: QtCore-devel |
45 | BuildRequires: QtDBus-devel | |
591b7d3d MB |
46 | BuildRequires: QtGui-devel |
47 | BuildRequires: QtSvg-devel | |
48 | BuildRequires: chmlib-devel >= 0.40 | |
212c1324 | 49 | BuildRequires: libicu-devel |
591b7d3d MB |
50 | BuildRequires: libmtp-devel >= 1.1.5 |
51 | BuildRequires: libwmf-devel >= 0.2.8 | |
f0879852 | 52 | BuildRequires: pkgconfig |
591b7d3d MB |
53 | BuildRequires: podofo-devel >= 0.8.2 |
54 | BuildRequires: poppler-Qt-devel >= 0.20.2 | |
55 | BuildRequires: poppler-glib-devel >= 0.20.2 | |
824729ab AF |
56 | BuildRequires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
57 | BuildRequires: python-PIL >= %{pil_ver} | |
58 | BuildRequires: python-PyQt4 >= %{pyqt4_ver} | |
59 | BuildRequires: python-PyQt4-devel >= %{pyqt4_ver} | |
60 | BuildRequires: python-PyQt4-devel-tools >= %{pyqt4_ver} | |
61 | BuildRequires: python-apsw >= %{apsw_ver} | |
62 | BuildRequires: python-cssselect >= %{cssselect_ver} | |
63 | BuildRequires: python-cssutils >= %{cssutils_ver} | |
64 | BuildRequires: python-dateutil >= %{dateutil_ver} | |
72cd9da3 | 65 | BuildRequires: python-devel >= 1:2.7.1 |
824729ab AF |
66 | BuildRequires: python-dns >= %{dns_ver} |
67 | BuildRequires: python-genshi | |
68 | BuildRequires: python-lxml >= %{lxml_ver} | |
69 | BuildRequires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 70 | BuildRequires: python-modules-sqlite |
824729ab AF |
71 | BuildRequires: python-netifaces >= %{netifaces_ver} |
72 | BuildRequires: python-psutil >= %{psutil_ver} | |
0e501b81 | 73 | BuildRequires: python-sip-devel |
6b37bdf6 | 74 | BuildRequires: qt4-devel-private |
0e501b81 | 75 | BuildRequires: rpm-pythonprov |
23304c7f | 76 | BuildRequires: rpmbuild(macros) >= 1.586 |
ddb4b081 | 77 | BuildRequires: sed >= 4.0 |
212c1324 | 78 | BuildRequires: sqlite3-devel |
23304c7f | 79 | BuildRequires: tar >= 1:1.22 |
f6f5b3d6 | 80 | BuildRequires: unzip |
3c9d3d2b | 81 | BuildRequires: xdg-utils |
23304c7f | 82 | BuildRequires: xz >= 1:4.999.7 |
824729ab AF |
83 | Requires: python-BeautifulSoup >= %{baeutifulsoup_ver} |
84 | Requires: python-PIL >= %{pil_ver} | |
85 | Requires: python-PyQt4 >= %{pyqt4_ver} | |
86 | Requires: python-apsw >= %{apsw_ver} | |
87 | Requires: python-cssselect >= %{cssselect_ver} | |
88 | Requires: python-cssutils >= %{cssutils_ver} | |
89 | Requires: python-dateutil >= %{dateutil_ver} | |
90 | Requires: python-dns >= %{dns_ver} | |
591b7d3d | 91 | Requires: python-genshi |
824729ab AF |
92 | Requires: python-lxml >= %{lxml_ver} |
93 | Requires: python-mechanize >= %{mechanize_ver} | |
6d15f615 | 94 | Requires: python-modules-sqlite |
824729ab AF |
95 | Requires: python-netifaces >= %{netifaces_ver} |
96 | Requires: python-psutil >= %{psutil_ver} | |
b0073032 | 97 | Suggests: ImageMagick-coder-jpeg |
98 | Suggests: ImageMagick-coder-png | |
400a540b PG |
99 | ### FIXME: libunrar.so is needed for rar-packed files |
100 | Suggests: libunrar-devel | |
b0073032 | 101 | Suggests: poppler-progs |
0e501b81 | 102 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
103 | ||
104 | %description | |
02229893 ER |
105 | Calibre is meant to be a complete e-library solution. It includes |
106 | library management, format conversion, news feeds to ebook conversion | |
107 | as well as e-book reader sync features. | |
108 | ||
109 | Calibre is primarily a ebook cataloging program. It manages your ebook | |
110 | collection for you. It is designed around the concept of the logical | |
111 | book, i.e. a single entry in the database that may correspond to | |
112 | ebooks in several formats. It also supports conversion to and from a | |
113 | dozen different ebook formats. | |
114 | ||
115 | Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, | |
116 | CBR, CBZ, RTF, TXT, PDF and LRS. | |
0e501b81 | 117 | |
cee72504 | 118 | %description -l pl.UTF-8 |
119 | Calibre to bardzo dobry i darmowy program do czytania e-książek. | |
120 | ||
121 | Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu | |
122 | formatów do ich postaci. Program obsługuje następujące typy plików: | |
123 | import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML | |
124 | eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza. | |
125 | ||
126 | Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i | |
127 | najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy | |
128 | dołączyli również aplikację, którą użytkownik może wykorzystać jako | |
129 | swój własny serwer darmowych książek. | |
130 | ||
2eeb7ef1 AF |
131 | %package -n bash-completion-calibre |
132 | Summary: bash-completion for calibre | |
133 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre | |
134 | Group: Applications/Shells | |
135 | Requires: %{name} = %{version}-%{release} | |
136 | Requires: bash-completion | |
137 | ||
138 | %description -n bash-completion-calibre | |
139 | bash-completion for calibre. | |
140 | ||
141 | %description -n bash-completion-calibre -l pl.UTF-8 | |
142 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre. | |
143 | ||
824729ab AF |
144 | %package -n zsh-completion-calibre |
145 | Summary: zsh-completion for calibre | |
146 | Summary(pl.UTF-8): uzupełnianie nazw dla calibre w powłoce zsh | |
147 | Group: Applications/Shells | |
148 | Requires: %{name} = %{version}-%{release} | |
149 | Requires: bash-completion | |
150 | ||
141d57d9 AF |
151 | %description -n zsh-completion-calibre |
152 | zsh-completion for calibre. | |
824729ab | 153 | |
141d57d9 | 154 | %description -n zsh-completion-calibre -l pl.UTF-8 |
824729ab AF |
155 | Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh. |
156 | ||
0e501b81 | 157 | %prep |
158 | %setup -q -n %{name} | |
159 | %patch0 -p1 | |
152a1c03 | 160 | %patch1 -p1 |
804e0619 | 161 | %patch2 -p1 |
73a1f5ed | 162 | %patch3 -p1 |
ddb4b081 | 163 | %patch4 -p1 |
cdcddff9 JR |
164 | %patch5 -p1 |
165 | %patch6 -p1 | |
f6f5b3d6 | 166 | |
d781633a JP |
167 | # 64bit target build fix |
168 | %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py | |
169 | ||
933d2d03 | 170 | # upstream decides to store locale files in a single zip file but we prefer separate .mo |
f6f5b3d6 | 171 | mkdir resources/localization/locales |
172 | unzip resources/localization/locales.zip -d resources/localization/locales | |
173 | chmod 755 resources/localization/locales/* | |
933d2d03 | 174 | rm -f resources/localization/locales.zip |
0e501b81 | 175 | |
176 | %build | |
5877892a | 177 | CC="%{__cc}" \ |
03edf045 | 178 | CXX=%{__cxx} \ |
cdcddff9 | 179 | OVERRIDE_CFLAGS="%{rpmcflags}" \ |
03edf045 | 180 | OVERRIDE_LDFLAGS="%{rpmldflags}" \ |
5c163f25 | 181 | %{__python} setup.py build |
0e501b81 | 182 | |
183 | %install | |
184 | rm -rf $RPM_BUILD_ROOT | |
3550e999 | 185 | # create directories for xdg-utils |
81537047 | 186 | install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \ |
824729ab | 187 | $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/usr/share/zsh/site-functions} |
0e501b81 | 188 | |
3550e999 JR |
189 | XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" \ |
190 | XDG_UTILS_INSTALL_MODE="system" \ | |
191 | LIBPATH="%{_libdir}" \ | |
0e501b81 | 192 | %{__python} setup.py install \ |
9c8cebf1 | 193 | --root=$RPM_BUILD_ROOT \ |
ab1a9c7b | 194 | --libdir="%{_libdir}" |
0e501b81 | 195 | |
81537047 JR |
196 | cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png |
197 | cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png | |
198 | ||
e154a7c1 JP |
199 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name} |
200 | %py_comp $RPM_BUILD_ROOT%{_libdir}/%{name} | |
201 | %py_postclean %{_libdir}/%{name} | |
202 | ||
81537047 | 203 | mv $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir} |
f6f5b3d6 | 204 | |
205 | # set proper filenames for locales (TODO: switch to patch if possible) | |
81537047 | 206 | for file in $RPM_BUILD_ROOT%{_localedir}/*; do |
933d2d03 | 207 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:') |
81537047 JR |
208 | mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES |
209 | mv $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \ | |
210 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES | |
933d2d03 | 211 | done; |
81537047 | 212 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do |
f6f5b3d6 | 213 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
81537047 JR |
214 | mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \ |
215 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo | |
f6f5b3d6 | 216 | done; |
81537047 | 217 | for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do |
f6f5b3d6 | 218 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
81537047 JR |
219 | mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \ |
220 | $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo | |
f6f5b3d6 | 221 | done; |
ddb4b081 | 222 | |
e9035516 | 223 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/%{name}-uninstall |
ddb4b081 | 224 | |
f6f5b3d6 | 225 | # unsupported |
591b7d3d MB |
226 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ber |
227 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/jv | |
81537047 JR |
228 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ltg |
229 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/en_AU | |
f6f5b3d6 | 230 | |
d383d054 MM |
231 | install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} |
232 | ||
933d2d03 | 233 | %find_lang %{name} --all-name |
234 | ||
0e501b81 | 235 | %clean |
236 | rm -rf $RPM_BUILD_ROOT | |
237 | ||
81537047 JR |
238 | %post |
239 | %update_desktop_database | |
240 | %update_mime_database | |
241 | %update_icon_cache hicolor | |
242 | ||
243 | %postun | |
244 | if [ $1 -eq 0 ] ; then | |
245 | %update_desktop_database | |
246 | %update_mime_database | |
247 | %update_icon_cache hicolor | |
248 | fi | |
249 | ||
933d2d03 | 250 | %files -f %{name}.lang |
0e501b81 | 251 | %defattr(644,root,root,755) |
cdcddff9 | 252 | %doc Changelog.yaml COPYRIGHT README.md |
23304c7f | 253 | %attr(755,root,root) %{_bindir}/calibre |
254 | %attr(755,root,root) %{_bindir}/calibre-complete | |
255 | %attr(755,root,root) %{_bindir}/calibre-customize | |
256 | %attr(755,root,root) %{_bindir}/calibre-debug | |
d383d054 | 257 | %attr(755,root,root) %{_bindir}/calibre-mount-helper |
23304c7f | 258 | %attr(755,root,root) %{_bindir}/calibre-parallel |
259 | %attr(755,root,root) %{_bindir}/calibre-server | |
260 | %attr(755,root,root) %{_bindir}/calibre-smtp | |
261 | %attr(755,root,root) %{_bindir}/calibredb | |
262 | %attr(755,root,root) %{_bindir}/ebook-convert | |
263 | %attr(755,root,root) %{_bindir}/ebook-device | |
264 | %attr(755,root,root) %{_bindir}/ebook-meta | |
cdcddff9 | 265 | %attr(755,root,root) %{_bindir}/ebook-polish |
23304c7f | 266 | %attr(755,root,root) %{_bindir}/ebook-viewer |
23304c7f | 267 | %attr(755,root,root) %{_bindir}/fetch-ebook-metadata |
23304c7f | 268 | %attr(755,root,root) %{_bindir}/lrf2lrs |
269 | %attr(755,root,root) %{_bindir}/lrfviewer | |
270 | %attr(755,root,root) %{_bindir}/lrs2lrf | |
271 | %attr(755,root,root) %{_bindir}/markdown-calibre | |
23304c7f | 272 | %attr(755,root,root) %{_bindir}/web2disk |
0e501b81 | 273 | %{_datadir}/%{name} |
274 | %{_libdir}/%{name} | |
81537047 JR |
275 | %{_desktopdir}/calibre-ebook-viewer.desktop |
276 | %{_desktopdir}/calibre-gui.desktop | |
277 | %{_desktopdir}/calibre-lrfviewer.desktop | |
591b7d3d | 278 | %{_iconsdir}/hicolor/*/*/*.png |
cdcddff9 | 279 | %{_datadir}/mime/application/*.xml |
fe3c8b7b | 280 | %{_datadir}/mime/text/*.xml |
81537047 JR |
281 | %{_datadir}/mime/packages/calibre-mimetypes.xml |
282 | %{_pixmapsdir}/%{name}-gui.png | |
283 | %{_pixmapsdir}/calibre-viewer.png | |
2eeb7ef1 AF |
284 | |
285 | %files -n bash-completion-calibre | |
286 | %defattr(644,root,root,755) | |
287 | %{_sysconfdir}/bash_completion.d/* | |
824729ab AF |
288 | |
289 | %files -n zsh-completion-calibre | |
290 | %defattr(644,root,root,755) | |
291 | %{_datadir}/zsh/site-functions/* |