Build py3 version

Also install READMEs and similar files.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-05-28 15:37:49 -04:00
commit 1e2f6e9af6

View file

@ -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 <zbyszek@in.waw.pl> - 1.2.7-1