[1741] | 1 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
---|
| 2 | |
---|
| 3 | Name: calibre |
---|
| 4 | Version: 0.7.15 |
---|
| 5 | Release: 1%{?dist} |
---|
| 6 | Summary: E-book converter and library management |
---|
| 7 | Group: Applications/Multimedia |
---|
| 8 | License: GPLv3 |
---|
| 9 | URL: http://calibre-ebook.com/ |
---|
| 10 | |
---|
| 11 | # SourceURL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz |
---|
| 12 | |
---|
| 13 | # Upstream packages some unfree fonts which we cannot redistribute. |
---|
| 14 | # While we're at it, also delete the liberation fonts which we already have. |
---|
| 15 | # |
---|
| 16 | # Download the upstream tarball and invoke this script while in the tarball's |
---|
| 17 | # directory: |
---|
| 18 | # ./generate-tarball.sh %{version} |
---|
| 19 | Source0: %{name}-%{version}-nofonts.tar.xz |
---|
| 20 | Source1: generate-tarball.sh |
---|
| 21 | Patch0: %{name}-manpages.patch |
---|
| 22 | Patch1: %{name}-no-update.patch |
---|
| 23 | Patch2: %{name}-0.6.53-mounthelper.patch |
---|
| 24 | Patch3: %{name}-0.6.47-python-fix.patch |
---|
| 25 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
---|
| 26 | |
---|
| 27 | BuildRequires: python >= 2.6 |
---|
| 28 | BuildRequires: python-devel >= 2.6 |
---|
| 29 | BuildRequires: ImageMagick-devel >= 6.5.9 |
---|
| 30 | BuildRequires: python-setuptools |
---|
| 31 | BuildRequires: qt4-devel >= 4.6.0 |
---|
| 32 | BuildRequires: PyQt4-devel >= 4.7.0 |
---|
| 33 | BuildRequires: poppler-qt4-devel >= 0.12 |
---|
| 34 | BuildRequires: podofo-devel |
---|
| 35 | BuildRequires: desktop-file-utils |
---|
| 36 | BuildRequires: python-mechanize >= 0.1.1 |
---|
| 37 | BuildRequires: python-lxml >= 2.2.1 |
---|
| 38 | BuildRequires: python-cssutils >= 0.9.6 |
---|
| 39 | BuildRequires: python-dateutil >= 1.4.1 |
---|
| 40 | BuildRequires: python-imaging >= 1.1.6 |
---|
| 41 | BuildRequires: xdg-utils >= 1.0.2 |
---|
| 42 | BuildRequires: python-BeautifulSoup >= 3.0.5 |
---|
| 43 | BuildRequires: xz |
---|
| 44 | BuildRequires: unzip |
---|
| 45 | BuildRequires: libwmf-devel >= 0.2.8 |
---|
| 46 | BuildRequires: chmlib-devel >= 0.40 |
---|
| 47 | |
---|
| 48 | Requires: PyQt4 |
---|
| 49 | Requires: pyPdf |
---|
| 50 | Requires: python-cherrypy |
---|
| 51 | Requires: python-cssutils |
---|
| 52 | Requires: ImageMagick |
---|
| 53 | Requires: python-odf |
---|
| 54 | Requires: python-django-tagging |
---|
| 55 | Requires: python-lxml |
---|
| 56 | Requires: python-imaging |
---|
| 57 | Requires: python-mechanize |
---|
| 58 | Requires: python-dateutil |
---|
| 59 | Requires: python-genshi |
---|
| 60 | Requires: python-BeautifulSoup |
---|
| 61 | |
---|
| 62 | ## vine |
---|
| 63 | Requires: TrueType-liberation |
---|
| 64 | |
---|
| 65 | %description |
---|
| 66 | Calibre is meant to be a complete e-library solution. It includes library |
---|
| 67 | management, format conversion, news feeds to ebook conversion as well as |
---|
| 68 | e-book reader sync features. |
---|
| 69 | |
---|
| 70 | Calibre is primarily a ebook cataloging program. It manages your ebook |
---|
| 71 | collection for you. It is designed around the concept of the logical book, |
---|
| 72 | i.e. a single entry in the database that may correspond to ebooks in several |
---|
| 73 | formats. It also supports conversion to and from a dozen different ebook |
---|
| 74 | formats. |
---|
| 75 | |
---|
| 76 | Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML, CBR, CBZ, |
---|
| 77 | RTF, TXT, PDF and LRS. |
---|
| 78 | |
---|
| 79 | %prep |
---|
| 80 | %setup -q -n %{name} |
---|
| 81 | |
---|
| 82 | # # remove redundant / non-free fonts |
---|
| 83 | # %__rm -rf resources/fonts/* |
---|
| 84 | |
---|
| 85 | # don't append calibre1 to the name of the manpages. No need to compress either |
---|
| 86 | # upstream won't fix: http://bugs.calibre-ebook.com/ticket/3770#comment:7 |
---|
| 87 | %patch0 -p1 -b .manpages |
---|
| 88 | |
---|
| 89 | # don't check for new upstream version (that's what packagers do) |
---|
| 90 | %patch1 -p1 -b .no-update |
---|
| 91 | |
---|
| 92 | # Enable mount helper |
---|
| 93 | %patch2 -p1 -b .mounthelper |
---|
| 94 | #% patch3 -p1 -b .python-fix |
---|
| 95 | |
---|
| 96 | # dos2unix newline conversion |
---|
| 97 | %{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/* |
---|
| 98 | |
---|
| 99 | # remove shebangs |
---|
| 100 | %{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*/*.py |
---|
| 101 | %{__sed} -i -e '/^#!\//, 1d' src/calibre/*/*/*.py |
---|
| 102 | %{__sed} -i -e '/^#![ ]*\//, 1d' src/calibre/*/*.py |
---|
| 103 | %{__sed} -i -e '/^#!\//, 1d' src/calibre/*.py |
---|
| 104 | %{__sed} -i -e '/^#!\//, 1d' resources/recipes/* |
---|
| 105 | %{__sed} -i -e '/^#!\//, 1d' resources/default_tweaks.py |
---|
| 106 | |
---|
| 107 | %{__chmod} -x src/calibre/*/*/*/*.py |
---|
| 108 | %{__chmod} -x src/calibre/*/*/*.py |
---|
| 109 | %{__chmod} -x src/calibre/*/*.py |
---|
| 110 | %{__chmod} -x src/calibre/*.py |
---|
| 111 | %{__chmod} -x resources/recipes/* |
---|
| 112 | |
---|
| 113 | %build |
---|
| 114 | OVERRIDE_CFLAGS="%{optflags}" QMAKE=%{_libdir}/qt4/bin/qmake python setup.py build |
---|
| 115 | |
---|
| 116 | %install |
---|
| 117 | %__rm -rf %{buildroot} |
---|
| 118 | |
---|
| 119 | %__mkdir -p %{buildroot}%{_datadir} |
---|
| 120 | |
---|
| 121 | # create directories for xdg-utils |
---|
| 122 | %__mkdir_p %{buildroot}%{_datadir}/icons |
---|
| 123 | %__mkdir_p %{buildroot}%{_datadir}/icons/hicolor |
---|
| 124 | %__mkdir_p %{buildroot}%{_datadir}/packages |
---|
| 125 | %__mkdir_p %{buildroot}%{_datadir}/mime |
---|
| 126 | %__mkdir_p %{buildroot}%{_datadir}/mime/packages |
---|
| 127 | %__mkdir_p %{buildroot}%{_datadir}/applications |
---|
| 128 | %__mkdir_p %{buildroot}%{_datadir}/desktop-directories |
---|
| 129 | |
---|
| 130 | # create directory for calibre environment module |
---|
| 131 | # the install script assumes it's there. |
---|
| 132 | %__mkdir_p %{buildroot}%{python_sitelib} |
---|
| 133 | |
---|
| 134 | XDG_DATA_DIRS="%{buildroot}%{_datadir}" \ |
---|
| 135 | XDG_UTILS_INSTALL_MODE="system" \ |
---|
| 136 | LIBPATH="%{_libdir}" \ |
---|
| 137 | python setup.py install --root=%{buildroot}%{_prefix} \ |
---|
| 138 | --prefix=%{_prefix} \ |
---|
| 139 | --libdir=%{_libdir} \ |
---|
| 140 | --staging-libdir=%{buildroot}%{_libdir} |
---|
| 141 | |
---|
| 142 | # remove shebang from init_calibre.py here because |
---|
| 143 | # it just got spawned by the install script |
---|
| 144 | %{__sed} -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/init_calibre.py |
---|
| 145 | |
---|
| 146 | # icons |
---|
| 147 | %__mkdir_p %{buildroot}%{_datadir}/pixmaps/ |
---|
| 148 | %__cp -p resources/images/library.png \ |
---|
| 149 | %{buildroot}%{_datadir}/pixmaps/%{name}-gui.png |
---|
| 150 | %__cp -p resources/images/viewer.svg \ |
---|
| 151 | %{buildroot}%{_datadir}/pixmaps/calibre-viewer.svg |
---|
| 152 | |
---|
| 153 | # every file is empty here |
---|
| 154 | find %{buildroot}%{_datadir}/mime -maxdepth 1 -type f|xargs %__rm -f |
---|
| 155 | |
---|
| 156 | # packages aren't allowed to register mimetypes like this |
---|
| 157 | %__rm -f %{buildroot}%{_datadir}/applications/{defaults.list,mimeinfo.cache} |
---|
| 158 | |
---|
| 159 | desktop-file-validate \ |
---|
| 160 | %{buildroot}%{_datadir}/applications/calibre-ebook-viewer.desktop |
---|
| 161 | desktop-file-validate \ |
---|
| 162 | %{buildroot}%{_datadir}/applications/calibre-gui.desktop |
---|
| 163 | desktop-file-validate \ |
---|
| 164 | %{buildroot}%{_datadir}/applications/calibre-lrfviewer.desktop |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | %__mv %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes \ |
---|
| 168 | %{buildroot}%{_datadir}/mime/packages/calibre-mimetypes.xml |
---|
| 169 | |
---|
| 170 | # mimetype icon for lrf |
---|
| 171 | %__rm -rf %{buildroot}%{_datadir}/icons/hicolor/128x128 |
---|
| 172 | %__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable |
---|
| 173 | %__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes |
---|
| 174 | %__mkdir_p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps |
---|
| 175 | %__cp -p resources/images/mimetypes/lrf.svg \ |
---|
| 176 | %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-sony-bbeb.svg |
---|
| 177 | %__cp -p resources/images/viewer.svg \ |
---|
| 178 | %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/calibre-viewer.svg |
---|
| 179 | |
---|
| 180 | # don't put bash completions in /usr/etc |
---|
| 181 | %__mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot} |
---|
| 182 | |
---|
| 183 | # these are provided as separate packages |
---|
| 184 | %__rm -rf %{buildroot}%{_libdir}/%{name}/{odf,cherrypy,pyPdf,encutils,cssutils} |
---|
| 185 | %__rm -rf %{buildroot}%{_libdir}/%{name}/cal/utils/genshi |
---|
| 186 | %__rm -rf %{buildroot}%{_libdir}/%{name}/cal/trac |
---|
| 187 | |
---|
| 188 | # link to system fonts after we have deleted (see Source0) the non-free ones |
---|
| 189 | # http://bugs.calibre-ebook.com/ticket/3832 |
---|
| 190 | %__mkdir_p %{buildroot}%{_datadir}/%{name}/fonts/prs500/ |
---|
| 191 | %__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSans-Regular.ttf \ |
---|
| 192 | %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0003m_.ttf |
---|
| 193 | %__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationSerif-Regular.ttf \ |
---|
| 194 | %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0011m_.ttf |
---|
| 195 | %__ln_s %{_datadir}/fonts/TrueType-liberation/LiberationMono-Regular.ttf \ |
---|
| 196 | %{buildroot}%{_datadir}/%{name}/fonts/prs500/tt0419m_.ttf |
---|
| 197 | |
---|
| 198 | # http://bugs.calibre-ebook.com/ticket/3770#comment:7 |
---|
| 199 | # man pages |
---|
| 200 | %__mv %{buildroot}%{_datadir}/%{name}/man %{buildroot}%{_mandir} |
---|
| 201 | |
---|
| 202 | # move locales |
---|
| 203 | %__mv %{buildroot}%{_datadir}/%{name}/localization/locales \ |
---|
| 204 | %{buildroot}%{_datadir}/locale |
---|
| 205 | for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/messages.mo; do |
---|
| 206 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
---|
| 207 | %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/messages.mo \ |
---|
| 208 | %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.mo |
---|
| 209 | done; |
---|
| 210 | for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do |
---|
| 211 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
---|
| 212 | %__mv %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \ |
---|
| 213 | %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo |
---|
| 214 | done; |
---|
| 215 | for file in %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/qt.qm; do |
---|
| 216 | lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') |
---|
| 217 | %__mv $file %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_$lang.qm |
---|
| 218 | done; |
---|
| 219 | |
---|
| 220 | %find_lang %{name} --with-qt --all-name |
---|
| 221 | |
---|
| 222 | # locales should be looked for in the proper place |
---|
| 223 | %{__sed} -i -e "s:P('localization/locales:('/usr/share/locale:" \ |
---|
| 224 | -e "s/messages.mo/calibre.mo/" \ |
---|
| 225 | -e "s/iso639.mo/calibre_iso639.mo/" \ |
---|
| 226 | %{buildroot}%{_libdir}/%{name}/%{name}/utils/localization.py |
---|
| 227 | |
---|
| 228 | %{__rm} -f %{buildroot}%{_bindir}/%{name}-uninstall |
---|
| 229 | |
---|
| 230 | %clean |
---|
| 231 | %{__rm} -rf %{buildroot} |
---|
| 232 | |
---|
| 233 | %post |
---|
| 234 | update-desktop-database &> /dev/null ||: |
---|
| 235 | update-mime-database %{_datadir}/mime &> /dev/null || : |
---|
| 236 | touch --no-create %{_datadir}/icons/hicolor || : |
---|
| 237 | if [ -x %{_bindir}/gtk-update-icon-cache ] ; then |
---|
| 238 | %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : |
---|
| 239 | fi |
---|
| 240 | |
---|
| 241 | %postun |
---|
| 242 | update-desktop-database &> /dev/null ||: |
---|
| 243 | update-mime-database %{_datadir}/mime &> /dev/null || : |
---|
| 244 | touch --no-create %{_datadir}/icons/hicolor || : |
---|
| 245 | if [ -x %{_bindir}/gtk-update-icon-cache ] ; then |
---|
| 246 | %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : |
---|
| 247 | fi |
---|
| 248 | |
---|
| 249 | %files -f %{name}.lang |
---|
| 250 | |
---|
| 251 | %defattr(-,root,root,-) |
---|
| 252 | %doc COPYRIGHT LICENSE Changelog.yaml |
---|
| 253 | %{_bindir}/* |
---|
| 254 | %config(noreplace) %{_sysconfdir}/bash_completion.d/ |
---|
| 255 | %{_libdir}/%{name} |
---|
| 256 | %{_datadir}/%{name} |
---|
| 257 | %{_datadir}/pixmaps/* |
---|
| 258 | %{_datadir}/applications/* |
---|
| 259 | %{_datadir}/mime/packages/* |
---|
| 260 | %{_datadir}/icons/hicolor/scalable/mimetypes/* |
---|
| 261 | %{_datadir}/icons/hicolor/scalable/apps/* |
---|
| 262 | %{python_sitelib}/init_calibre.py* |
---|
| 263 | %{_mandir}/man1/* |
---|
| 264 | |
---|
| 265 | %changelog |
---|
| 266 | * Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.7.15-1 |
---|
| 267 | - initial build based on Fedora development |
---|
| 268 | |
---|
| 269 | * Sun Aug 08 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.13-1mdv2010.1 |
---|
| 270 | + Revision: 567781 |
---|
| 271 | - update to 0.7.13 |
---|
| 272 | |
---|
| 273 | * Fri Aug 06 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.12-1mdv2011.0 |
---|
| 274 | + Revision: 567146 |
---|
| 275 | - update to 0.7.12 |
---|
| 276 | |
---|
| 277 | * Thu Aug 05 2010 Funda Wang <fwang@mandriva.org> 0.7.10-3mdv2011.0 |
---|
| 278 | + Revision: 566253 |
---|
| 279 | - rebuild for new poppler |
---|
| 280 | |
---|
| 281 | * Fri Jul 30 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.10-2mdv2011.0 |
---|
| 282 | + Revision: 563265 |
---|
| 283 | - update manpage and no-update patches (from Fedora) |
---|
| 284 | - drop SOURCE1 and python-cssutils hack, it's not needed anymore as |
---|
| 285 | python-cssutils has been updated to 0.9.7b3 |
---|
| 286 | - build with optflags |
---|
| 287 | - delete mimeinfo.cache too |
---|
| 288 | |
---|
| 289 | + Juan Luis Baptiste <juancho@mandriva.org> |
---|
| 290 | - Updated to 0.7.10, redo diff calibre-no-update.patch. |
---|
| 291 | |
---|
| 292 | * Sat Jul 10 2010 Funda Wang <fwang@mandriva.org> 0.6.54-2mdv2011.0 |
---|
| 293 | + Revision: 549995 |
---|
| 294 | - rebuild for new imagemagick |
---|
| 295 | |
---|
| 296 | + Tomas Kindl <supp@mandriva.org> |
---|
| 297 | - various minor SPEC fixes and clean-ups |
---|
| 298 | |
---|
| 299 | + Juan Luis Baptiste <juancho@mandriva.org> |
---|
| 300 | - Updated to 0.6.54. |
---|
| 301 | |
---|
| 302 | * Tue Apr 20 2010 Tomas Kindl <supp@mandriva.org> 0.6.48-1mdv2010.1 |
---|
| 303 | + Revision: 537127 |
---|
| 304 | - update to 0.6.48 |
---|
| 305 | - fix python-odf and python-django-tagging dependency' |
---|
| 306 | |
---|
| 307 | * Tue Apr 20 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-3mdv2010.1 |
---|
| 308 | + Revision: 536983 |
---|
| 309 | - fix incorrect odf-py require & bump release |
---|
| 310 | - fix incorrect odf-py require |
---|
| 311 | |
---|
| 312 | * Mon Apr 19 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-2mdv2010.1 |
---|
| 313 | + Revision: 536555 |
---|
| 314 | - enable PoDoFo dependency as we have PoDoFo in MDV now |
---|
| 315 | |
---|
| 316 | * Sun Apr 18 2010 Tomas Kindl <supp@mandriva.org> 0.6.47-1mdv2010.1 |
---|
| 317 | + Revision: 536529 |
---|
| 318 | - initial import containing all pertinent fixes to ensure it will build on Mandriva... |
---|
| 319 | - create calibre |
---|
| 320 | |
---|