X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=calibre.spec;h=04d4a9db5385f1c5dce917c0c7eb908b4e4fd11a;hb=b007303226e610663522d59761d8a4c9f4308cc5;hp=6d31daf619179b428c2fc066656cb23ceaf07de1;hpb=96e3ed54dd5aa71d034082fdb209df6a35227ae6;p=packages%2Fcalibre.git diff --git a/calibre.spec b/calibre.spec index 6d31daf..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,18 +11,20 @@ Summary: E-book converter and library management Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków Name: calibre -Version: 0.7.36 +Version: 0.8.12 Release: 1 License: GPL v3+ Group: Applications/Multimedia Source0: %{name}-%{version}-nofonts.tar.xz -# Source0-md5: 417fb4db7d5ee4f232425d9d6a9428de +# 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 @@ -32,8 +35,10 @@ 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 @@ -43,10 +48,9 @@ BuildRequires: rpmbuild(macros) >= 1.586 BuildRequires: sed >= 4.0 BuildRequires: sqlite3-devel BuildRequires: tar >= 1:1.22 +BuildRequires: unzip BuildRequires: xdg-utils BuildRequires: xz >= 1:4.999.7 -Requires: ImageMagick-coder-jpeg -Requires: ImageMagick-coder-png Requires: python-BeautifulSoup Requires: python-PIL Requires: python-cssutils @@ -54,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 @@ -88,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. @@ -102,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 @@ -113,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 \ @@ -128,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 @@ -147,6 +181,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -157,7 +192,6 @@ rm -rf $RPM_BUILD_ROOT %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}/librarything %attr(755,root,root) %{_bindir}/lrf2lrs %attr(755,root,root) %{_bindir}/lrfviewer %attr(755,root,root) %{_bindir}/lrs2lrf