%if 0%{?fedora}
%global with_python3 1
%endif
%{!?_licensedir: %global license %%doc}
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
%global modname stuf
Name: python-stuf
Version: 0.9.16
Release: 14%{?dist}
Summary: Fancy python dictionary types
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/stuf
Source0: https://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
%if 0%{?fedora} && 0%{?fedora} > 22
BuildRequires: python2-setuptools
%else
BuildRequires: python2-setuptools
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%description
A collection of Python dictionary types that support attribute-style
access. Includes *defaultdict*, *OrderedDict*, restricted, *ChainMap*,
*Counter*, and frozen implementations plus miscellaneous utilities for
writing Python software.
%package -n python2-%{modname}
Summary: Fancy python dictionary types
%{?python_provide:%python_provide python2-%{modname}}
Requires: python2-parse
%description -n python2-%{modname}
A collection of Python dictionary types that support attribute-style
access. Includes *defaultdict*, *OrderedDict*, restricted, *ChainMap*,
*Counter*, and frozen implementations plus miscellaneous utilities for
writing Python software.
%if 0%{?with_python3}
%package -n python3-%{modname}
Summary: Fancy python dictionary types
%{?python_provide:%python_provide python3-%{modname}}
Requires: python3-parse
%description -n python3-%{modname}
A collection of Python dictionary types that support attribute-style
access. Includes *defaultdict*, *OrderedDict*, restricted, *ChainMap*,
*Counter*, and frozen implementations plus miscellaneous utilities for
writing Python software.
%endif
%prep
%autosetup -n %{modname}-%{version}
# Make this egg-level requirement less specific for EPEL7.
# https://bugzilla.redhat.com/show_bug.cgi?id=1335144#c13
sed -i 's/parse>=1.6.6/parse/g' reqs/requires.txt
# Remove upstreams egg info
rm -rf *.egg*
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
# https://bitbucket.org/lcrees/stuf/issues/9/find_packages-should-exclude-tests
rm -rf %{buildroot}%{python2_sitelib}/tests/
%if 0%{?with_python3}
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/tests/
%endif
%files -n python2-%{modname}
%doc README.rst
%license LICENSE.txt
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*
%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst
%license LICENSE.txt
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*
%endif
%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.16-14
- Rebuilt for Python 3.7
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.9.16-13
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.9.16-9
- Rebuild for Python 3.6
* Tue Jul 05 2016 Ralph Bean <rbean@redhat.com> - 0.9.16-8
- Loosen up python-parse dependency for epel7.
* Tue Jun 28 2016 Ralph Bean <rbean@redhat.com> - 0.9.16-7
- Rebundle six, since it is highly customized, #1335144.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.16-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Dec 02 2015 Ralph Bean <rbean@redhat.com> - 0.9.16-5
- Fix python2-setuptools dep on F22 and older.
* Wed Dec 02 2015 Ralph Bean <rbean@redhat.com> - 0.9.16-4
- Specbump (to test a local dev tool).
* Tue Dec 01 2015 Ralph Bean <rbean@redhat.com> - 0.9.16-3
- Fix python3-six unbundling as per review.
* Mon Nov 30 2015 Ralph Bean <rbean@redhat.com> - 0.9.16-2
- Fixed initial changelog entry.
- Rename dep from python2-parse to python-parse
- Unbundle and add dep on python-six and python3-six.
- Fix python_provide usage.
* Fri Nov 13 2015 Ralph Bean <rbean@redhat.com> - 0.9.16-1
- Initial packaging for Fedora.