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