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