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