From 1e2f6e9af6d31a323cd85b267dfa27465b05ec71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 28 May 2015 15:37:49 -0400 Subject: [PATCH] Build py3 version Also install READMEs and similar files. --- python-blosc.spec | 55 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/python-blosc.spec b/python-blosc.spec index 3e22a3d..000725c 100644 --- a/python-blosc.spec +++ b/python-blosc.spec @@ -1,20 +1,35 @@ +%global with_python3 0%{?fedora} + %global __provides_filter_from ^%{python_sitearch}/.*\\.so$ +%global __provides_filter_from ^%{python3_sitearch}/.*\\.so$ -%global module blosc +%global module blosc -Summary: Python wrapper for the blosc high performance compressor -Name: python-%{module} -Version: 1.2.7 -Release: 1%{?dist} -License: MIT -URL: https://github.com/FrancescAlted/python-blosc -Source0: https://pypi.python.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz -BuildRequires: python2-devel blosc-devel +# Use the same directory of the main package for subpackage licence and docs +%global _docdir_fmt %{name} +Summary: Python wrapper for the blosc high performance compressor +Name: python-%{module} +Version: 1.2.7 +Release: 1%{?dist} +License: MIT +URL: https://github.com/FrancescAlted/python-blosc +Source0: https://pypi.python.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz +BuildRequires: blosc-devel +BuildRequires: python2-devel %description Python wrapper for the Blosc high performance compressor. +%if 0%{?with_python3} +%package -n python3-%{module} +Summary: Python wrapper for the blosc high performance compressor +BuildRequires: python3-devel + +%description -n python3-%{module} +Python wrapper for the Blosc high performance compressor. +%endif + %prep %setup -q -n %{module}-%{version} @@ -22,19 +37,35 @@ Python wrapper for the Blosc high performance compressor. sed -i "s|CFLAGS\.append(\"-msse2\")|pass|" setup.py %build -export BLOSC_DIR=%{_libdir}/blosc -CFLAGS="%{optflags}" %{__python2} setup.py build +export BLOSC_DIR=%{_libdir}/blosc CFLAGS="%{optflags}" +%{__python2} setup.py build +%if 0%{?with_python3} +%{__python3} setup.py build +%endif # Fix lib perms -find . -name "blosc_extension.so" -exec chmod 0755 {} \; +find . -name "blosc_extension.so" -exec chmod -v 0755 {} \; %install %{__python2} setup.py install --prefix=%{_prefix} -O1 --skip-build --root=%{buildroot} +%if 0%{?with_python3} +%{__python3} setup.py install --prefix=%{_prefix} -O1 --skip-build --root=%{buildroot} +%endif %files %{python2_sitearch}/blosc/ %{python2_sitearch}/blosc-%{version}*-py*.egg-info +%license LICENSES/PYTHON-BLOSC.txt +%doc README.rst RELEASE_NOTES.rst + +%if 0%{?with_python3} +%files -n python3-%{module} +%{python3_sitearch}/blosc/ +%{python3_sitearch}/blosc-%{version}*-py*.egg-info +%license LICENSES/PYTHON-BLOSC.txt +%doc README.rst RELEASE_NOTES.rst +%endif %changelog * Thu May 7 2015 Zbigniew Jędrzejewski-Szmek - 1.2.7-1