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