#
# TODO: - xdg stuff (put desktops and icons in proper place)
+# - rewrite generate-tarball.sh script to provide locales.zip handling (if needed)
+# - make separate server package with init-scripts, etc...
#
# 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.8.7
-Release: 0.1
+Version: 0.8.24
+Release: 1
License: GPL v3+
Group: Applications/Multimedia
Source0: %{name}-%{version}-nofonts.tar.xz
-# Source0-md5: f6243502d832893845d8f59bc847ce2f
+# Source0-md5: b17d6878b78f0a9479a0fe76780efb5b
Source1: generate-tarball.sh
Source2: %{name}-mount-helper
Patch0: %{name}-prefix.patch
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: 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-PyQt4
Requires: python-cssutils
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
%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
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 \
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
rm -rf $RPM_BUILD_ROOT
-%files
+%files -f %{name}.lang
%defattr(644,root,root,755)
%doc Changelog.yaml COPYRIGHT README
%attr(755,root,root) %{_bindir}/calibre