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