diff --git a/.gitignore b/.gitignore index e69de29..43550ec 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pyeclib-1.0.9.tar.gz diff --git a/python-pyeclib.spec b/python-pyeclib.spec new file mode 100644 index 0000000..c38fe35 --- /dev/null +++ b/python-pyeclib.spec @@ -0,0 +1,101 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + +Name: python-pyeclib +Version: 1.0.9 +Release: 1%{?dist} +Summary: Python interface to erasure codes + +License: BSD +URL: https://bitbucket.org/kmgreen2/pyeclib/ +# Bitbucket's naming is like the old github (== awful), so we pull +# the tag using git CLI. Save the current command for Source0 below. +# git archive -o ../pyeclib-1.0.9.tar.gz --prefix=pyeclib-1.0.9/ v1.0.9 +Source0: pyeclib-%{version}.tar.gz +#Patch1: pyeclib-1.0.7-fixups.patch + +BuildRequires: python2-devel +%if 0%{?with_python3} +BuildRequires: python3-devel +%endif +BuildRequires: python-setuptools +BuildRequires: liberasurecode-devel >= 1.0.9 + +Requires: liberasurecode >= 1.0.9 + +%description +This library provides a simple Python interface for implementing erasure +codes. A number of back-end implementations is supported either directly +or through the C interface liberasurecode. + +%if 0%{?with_python3} +%package -n python3-pyeclib +Summary: Python 3 interface to erasure codes + +%description -n python3-pyeclib +This library provides a simple Python 3 interface for implementing erasure +codes. A number of back-end implementations is supported either directly +or through the C interface liberasurecode. +%endif + +%prep +%setup -q -n pyeclib-%{version} +#patch1 -p1 + +%if 0%{?with_python3} +# The {py3dir} is a convenience built-in that Fedora provides in F13 +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' +%endif + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + +%install +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +popd +%endif + +%files +%license License.txt +%doc README +%{_libdir}/python2*/site-packages/* +# There is no __python2_sitearch on F21 +#{__python_sitearch}/* + +%if 0%{?with_python3} +%files -n python3-pyeclib +%license License.txt +%doc README +%{_libdir}/python3*/site-packages/* +# There is no __python3_sitearch on F21 +#{__python3_sitearch}/* +%endif + +%changelog +* Sun Oct 11 2015 Pete Zaitcev 1.0.9-1 +- Update to upstream 1.0.9 +- Make py3 conditional for old system releases + +* Tue Apr 21 2015 Pete Zaitcev 1.0.7-2 +- Correct the reported version from 1.0.5 to 1.0.7 +- Address Haikel's comments (#1212148) +- Add BuildRequires: python-setuptools + +* Wed Apr 15 2015 Pete Zaitcev 1.0.7-1 +- Update to upstream 1.0.7 (asked by Swift with EC and follow-up fixups) + +* Thu Apr 02 2015 Pete Zaitcev 1.0.6-1 +- Initial release diff --git a/sources b/sources index e69de29..8a63b45 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +bdfaec41e9556373dbb6f7aecfc546ff pyeclib-1.0.9.tar.gz