diff --git a/.gitignore b/.gitignore index e69de29..3379220 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/dill-0.2.1.tgz diff --git a/python-dill.spec b/python-dill.spec new file mode 100644 index 0000000..d4deecd --- /dev/null +++ b/python-dill.spec @@ -0,0 +1,121 @@ +%global upname dill +%global with_python3 1 + +Name: python-%{upname} +Version: 0.2.1 +Release: 2%{?dist} +Summary: Serialize all of Python + +License: BSD + +URL: http://trac.mystic.cacr.caltech.edu/project/pathos/wiki/dill +Source0: https://pypi.python.org/packages/source/d/dill/dill-%{version}.tgz + +BuildArch: noarch +BuildRequires: python2-devel +# For tests +BuildRequires: numpy + +%description +Dill extends python's 'pickle' module for serializing and de-serializing +python objects to the majority of the built-in python types. +Dill provides the user the same interface as the 'pickle' module, and also +includes some additional features. In addition to pickling python objects, dill +provides the ability to save the state of an interpreter session in a single +command. + +%if 0%{?with_python3} +%package -n python3-%{upname} +Summary: Describing statistical models in Python using symbolic formulas +BuildRequires: python3-devel +# For tests +BuildRequires: python3-numpy + +%description -n python3-%{upname} +Dill extends python's 'pickle' module for serializing and de-serializing +python objects to the majority of the built-in python types. +Dill provides the user the same interface as the 'pickle' module, and also +includes some additional features. In addition to pickling python objects, dill +provides the ability to save the state of an interpreter session in a single +command. + +%endif # with_python3 + +%prep +%setup -q -n %{upname}-%{version} +# Remove shebangs +pushd dill + for i in $(grep -l -r "/usr/bin/env"); do + sed -i -e '1d' $i; + done +popd + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + +%install +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif # with_python3 + +%{__python2} setup.py install --skip-build --root %{buildroot} + +%check +export PYTHONPATH=%{buildroot}%{python2_sitelib} +for test in tests/test_* +do + %{__python2} $test +done + +%if 0%{?with_python3} +pushd %{py3dir} +PYTHONPATH=%{buildroot}%{python3_sitelib} +for test in tests/test_* + do + %{__python3} $test +done +popd +%endif # with_python3 + +%files +%doc README +%license LICENSE +%exclude %{_bindir}/* +%{python2_sitelib}/* + +%if 0%{?with_python3} +%files -n python3-%{upname} +%doc README +%license LICENSE +%exclude %{_bindir}/* +%{python3_sitelib}/* +%endif # with_python3 + +%changelog +* Fri Sep 12 2014 Sergio Pascual - 0.2.1-2 +- Add license macro +- Run tests +- Add numpy build req for tests + +* Thu Sep 11 2014 Sergio Pascual - 0.2.1-1 +- New upstream (0.2.1) + +* Fri Dec 13 2013 Sergio Pascual - 0.2-0.1b1 +- Initial specfile + diff --git a/sources b/sources index e69de29..1f756c5 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +66f4d8fff8724568bde03e421bf520bb dill-0.2.1.tgz