]> git.pld-linux.org Git - packages/calibre.git/blobdiff - calibre.spec
- 0.8.24
[packages/calibre.git] / calibre.spec
index fede153b062b91f5eb1c1eb3dcebb569521b0368..42410c10ab52733e964e34e0488760600c5e1fec 100644 (file)
@@ -1,5 +1,7 @@
 #
 # 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
+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
 Patch1:                %{name}-manpages.patch
 Patch2:                %{name}-no-update.patch
 Patch3:                %{name}-env_module.patch
-Patch4:                shebang-python-fix.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
@@ -33,6 +36,7 @@ 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
@@ -45,17 +49,20 @@ 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-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
@@ -105,8 +112,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
@@ -122,15 +143,40 @@ rm -rf $RPM_BUILD_ROOT
 
 # 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 \
+       $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/%{name}.mo
+done;
+for file in $RPM_BUILD_ROOT%{_datadir}/locale/*/LC_MESSAGES/iso639.mo; do
+       lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
+       mv $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/iso639.mo \
+       $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_iso639.mo
+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
This page took 0.037048 seconds and 4 git commands to generate.