]> git.pld-linux.org Git - packages/calibre.git/blobdiff - calibre.spec
- ImageMagick coders just suggested
[packages/calibre.git] / calibre.spec
index 541c2f3051b94a0ebe7c805bf67a2f9f74e49ea0..04d4a9db5385f1c5dce917c0c7eb908b4e4fd11a 100644 (file)
@@ -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,
 Summary:       E-book converter and library management
 Summary(pl.UTF-8):     Konwerter oraz biblioteka dla e-booków
 Name:          calibre
-Version:       0.7.48
-Release:       2
+Version:       0.8.12
+Release:       1
 License:       GPL v3+
 Group:         Applications/Multimedia
 Source0:       %{name}-%{version}-nofonts.tar.xz
-# Source0-md5: a9e18a37709900520e0e8b4178b61777
+# 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-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
@@ -103,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
@@ -114,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 \
@@ -129,14 +160,16 @@ 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
 
-%find_lang %{name} --all-name --with-qm
+# 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
 rm -rf $RPM_BUILD_ROOT
@@ -148,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
@@ -158,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
This page took 0.077367 seconds and 4 git commands to generate.