%global with_python3 1
%global srcname emcee
%global common_description \
emcee is a stable, well tested Python implementation of the affine-invariant \
ensemble sampler for Markov chain Monte Carlo (MCMC) proposed by \
Goodman & Weare (2010). The code is open source and has already been \
used in several published projects in the Astrophysics literature.
Name: python-%{srcname}
Version: 2.2.1
Release: 9%{?dist}
Summary: The Python ensemble sampling toolkit for affine-invariant MCMC
License: MIT
URL: http://dan.iel.fm/emcee/current/
Source0: https://pypi.io/packages/source/e/emcee/emcee-%{version}.tar.gz
BuildRequires: python2-devel
BuildRequires: python2-nose python2-numpy
BuildArch: noarch
%{?python_provide:%python_provide python-%{srcname}}
%global _description\
%{common_description}
%description %_description
%package -n python2-%{srcname}
Summary: %summary
Requires: python2-numpy
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname} %_description
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: The Python ensemble sampling toolkit for affine-invariant MCMC
BuildRequires: python3-devel
BuildRequires: python3-nose python3-numpy
Requires: python3-numpy
%description -n python3-%{srcname}
%{common_description}
%endif # with_python3
%prep
%setup -qn %{srcname}-%{version}
# Delete first line if it starts with shebang
pushd emcee
find -name '*.py' | xargs sed -i '1{/^#!/d}' __init__.py
popd
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
%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
pushd %{buildroot}/%{python2_sitelib}
nosetests-%{python2_version} -v emcee
popd
%if 0%{?with_python3}
pushd %{buildroot}/%{python3_sitelib}
nosetests-%{python3_version} -v emcee
popd
%endif # with_python3
%files -n python2-%{srcname}
%doc AUTHORS.rst HISTORY.rst README.rst
%license LICENSE
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-%{srcname}
%doc AUTHORS.rst HISTORY.rst README.rst
%license LICENSE
%{python3_sitelib}/*
%endif # with_python3
%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.1-8
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 16 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.2.1-6
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.1-5
- Python 2 binary package renamed to python2-emcee
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.2.1-2
- Rebuild for Python 3.6
* Wed Jul 27 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.1-1
- New upstream source (2.2.1)
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Jul 14 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.0-2
- Remove reference to patch in specfile
* Wed Jul 13 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.0-1
- New upstream source (2.2.0)
- Update pypi url
- Remove numpy 1.11 patch (upstream fixed it)
* Tue Mar 29 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 2.1.0-5
- Provide python2 package
- Fix problem with numpy 1.11
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Jun 15 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 2.1.0-1
- Initial spec