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