X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=calibre.spec;h=04d4a9db5385f1c5dce917c0c7eb908b4e4fd11a;hb=b007303226e610663522d59761d8a4c9f4308cc5;hp=8a9b015f03a285bef4cfe742f020b9813056ddf7;hpb=1fd63a091e7df0d67ea042800b3248eba57dab17;p=packages%2Fcalibre.git diff --git a/calibre.spec b/calibre.spec index 8a9b015..04d4a9d 100644 --- a/calibre.spec +++ b/calibre.spec @@ -1,5 +1,6 @@ # # TODO: - xdg stuff (put desktops and icons in proper place) +# - rewrite generate-tarball.sh script to provide locales.zip handling (if needed) # # NOTE: # Upstream packages some unfree fonts which we cannot redistribute, @@ -10,39 +11,46 @@ Summary: E-book converter and library management Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków Name: calibre -Version: 0.7.34 +Version: 0.8.12 Release: 1 License: GPL v3+ Group: Applications/Multimedia -Source0: %{name}-%{version}-nofonts.tar.bz2 -# Source0-md5: ced1ab0e656b6ce27fffc13f199ca2a9 +Source0: %{name}-%{version}-nofonts.tar.xz +# Source0-md5: eb4c1dffaa92b3e05b1557b7a8fb8531 Source1: generate-tarball.sh +Source2: %{name}-mount-helper Patch0: %{name}-prefix.patch Patch1: %{name}-manpages.patch Patch2: %{name}-no-update.patch Patch3: %{name}-env_module.patch Patch4: %{name}-locales.patch +Patch5: shebang-python-fix.patch URL: http://www.calibre-ebook.com/ BuildRequires: ImageMagick-devel >= 6.6.4.7 BuildRequires: chmlib-devel +BuildRequires: libicu-devel BuildRequires: pkgconfig BuildRequires: podofo-devel BuildRequires: poppler-Qt-devel BuildRequires: python-BeautifulSoup BuildRequires: python-PIL BuildRequires: python-PyQt4-devel -BuildRequires: python-cssutils >= 0.9.7b3 +BuildRequires: python-PyQt4-devel-tools +BuildRequires: python-cssutils >= 1:0.9.7 BuildRequires: python-dateutil +BuildRequires: python-devel >= 1:2.7.1 BuildRequires: python-lxml BuildRequires: python-mechanize BuildRequires: python-modules-sqlite BuildRequires: python-sip-devel BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.268 +BuildRequires: rpmbuild(macros) >= 1.586 BuildRequires: sed >= 4.0 +BuildRequires: sqlite3-devel +BuildRequires: tar >= 1:1.22 +BuildRequires: unzip BuildRequires: xdg-utils -Requires: ImageMagick-coder-jpeg -Requires: ImageMagick-coder-png +BuildRequires: xz >= 1:4.999.7 Requires: python-BeautifulSoup Requires: python-PIL Requires: python-cssutils @@ -50,6 +58,9 @@ Requires: python-dateutil Requires: python-lxml Requires: python-mechanize Requires: python-modules-sqlite +Suggests: ImageMagick-coder-jpeg +Suggests: ImageMagick-coder-png +Suggests: poppler-progs BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -84,6 +95,7 @@ Summary: bash-completion for calibre Summary(pl.UTF-8): bashowe uzupełnianie nazw dla calibre Group: Applications/Shells Requires: %{name} = %{version}-%{release} +Requires: bash-completion %description -n bash-completion-calibre bash-completion for calibre. @@ -98,8 +110,22 @@ Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 + +# 64bit target build fix +%{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py + +# upstream decides to store locale files in a single zip file but we prefer separate .mo +mkdir resources/localization/locales +unzip resources/localization/locales.zip -d resources/localization/locales +chmod 755 resources/localization/locales/* +rm -f resources/localization/locales.zip %build +CC=%{__cc} \ +CXX=%{__cxx} \ +OVERRIDE_CFLAGS="%{rpmcflags}" \ +OVERRIDE_LDFLAGS="%{rpmldflags}" \ %{__python} setup.py build %install @@ -109,11 +135,21 @@ rm -rf $RPM_BUILD_ROOT --root=$RPM_BUILD_ROOT \ --libdir="%{_libdir}" +%py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name} +%py_comp $RPM_BUILD_ROOT%{_libdir}/%{name} +%py_postclean %{_libdir}/%{name} + # move manpages and locales to proper place mv $RPM_BUILD_ROOT%{_datadir}/%{name}/man $RPM_BUILD_ROOT%{_mandir} mv $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_datadir}/locale # set proper filenames for locales (TODO: switch to patch if possible) +for file in $RPM_BUILD_ROOT%{_datadir}/locale/*; do + lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:') + mkdir $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES + mv $RPM_BUILD_ROOT%{_datadir}/locale/$lang/*.mo \ + $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES +done; for file in $RPM_BUILD_ROOT%{_datadir}/locale/*/LC_MESSAGES/messages.mo; do lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') mv $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/messages.mo \ @@ -124,13 +160,15 @@ for file in $RPM_BUILD_ROOT%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do mv $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \ $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo done; -for file in $RPM_BUILD_ROOT%{_datadir}/locale/*/LC_MESSAGES/qt.qm; do - lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:') - mv $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.$lang.qm -done; %{__rm} $RPM_BUILD_ROOT%{_bindir}/%{name}-uninstall +# unsupported +%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/ltg +%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/en_AU + +install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} + %find_lang %{name} --all-name %clean @@ -138,27 +176,29 @@ rm -rf $RPM_BUILD_ROOT %files -f %{name}.lang %defattr(644,root,root,755) -%doc COPYRIGHT README -%attr(755,root,root) %{_bindir}/* +%doc Changelog.yaml COPYRIGHT README +%attr(755,root,root) %{_bindir}/calibre +%attr(755,root,root) %{_bindir}/calibre-complete +%attr(755,root,root) %{_bindir}/calibre-customize +%attr(755,root,root) %{_bindir}/calibre-debug +%attr(755,root,root) %{_bindir}/calibre-mount-helper +%attr(755,root,root) %{_bindir}/calibre-parallel +%attr(755,root,root) %{_bindir}/calibre-server +%attr(755,root,root) %{_bindir}/calibre-smtp +%attr(755,root,root) %{_bindir}/calibredb +%attr(755,root,root) %{_bindir}/ebook-convert +%attr(755,root,root) %{_bindir}/ebook-device +%attr(755,root,root) %{_bindir}/ebook-meta +%attr(755,root,root) %{_bindir}/ebook-viewer +%attr(755,root,root) %{_bindir}/epub-fix +%attr(755,root,root) %{_bindir}/fetch-ebook-metadata +%attr(755,root,root) %{_bindir}/lrf2lrs +%attr(755,root,root) %{_bindir}/lrfviewer +%attr(755,root,root) %{_bindir}/lrs2lrf +%attr(755,root,root) %{_bindir}/markdown-calibre +%attr(755,root,root) %{_bindir}/pdfmanipulate +%attr(755,root,root) %{_bindir}/web2disk %{_datadir}/%{name} -%lang(ar) %{_datadir}/locale/ar/LC_MESSAGES/%{name}.ar.qm -%lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/%{name}.cs.qm -%lang(da) %{_datadir}/locale/da/LC_MESSAGES/%{name}.da.qm -%lang(de) %{_datadir}/locale/de/LC_MESSAGES/%{name}.de.qm -%lang(es) %{_datadir}/locale/es/LC_MESSAGES/%{name}.es.qm -%lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/%{name}.fr.qm -%lang(he) %{_datadir}/locale/he/LC_MESSAGES/%{name}.he.qm -%lang(hu) %{_datadir}/locale/hu/LC_MESSAGES/%{name}.hu.qm -%lang(ja) %{_datadir}/locale/ja/LC_MESSAGES/%{name}.ja.qm -%lang(pl) %{_datadir}/locale/pl/LC_MESSAGES/%{name}.pl.qm -%lang(pt) %{_datadir}/locale/pt/LC_MESSAGES/%{name}.pt.qm -%lang(ru) %{_datadir}/locale/ru/LC_MESSAGES/%{name}.ru.qm -%lang(sk) %{_datadir}/locale/sk/LC_MESSAGES/%{name}.sk.qm -%lang(sl) %{_datadir}/locale/sl/LC_MESSAGES/%{name}.sl.qm -%lang(sv) %{_datadir}/locale/sv/LC_MESSAGES/%{name}.sv.qm -%lang(uk) %{_datadir}/locale/uk/LC_MESSAGES/%{name}.uk.qm -%lang(zh_CN) %{_datadir}/locale/zh_CN/LC_MESSAGES/%{name}.zh_CN.qm -%lang(zh_TW) %{_datadir}/locale/zh_TW/LC_MESSAGES/%{name}.zh_TW.qm %{_libdir}/%{name} %{_mandir}/man1/*.1*