4a68c1b
# what it's called on pypi
4a68c1b
%global srcname python-multipart
4a68c1b
# what it's imported as
4a68c1b
%global libname multipart
4a68c1b
# name of egg info directory
4a68c1b
%global eggname python_multipart
4a68c1b
# package name fragment
4a68c1b
%global pkgname %{libname}
4a68c1b
4a68c1b
%global _description \
4a68c1b
python-multipart is an Apache2 licensed streaming multipart parser for Python.
4a68c1b
4a68c1b
%if %{defined rhel}
4a68c1b
%bcond_without python2
4a68c1b
%bcond_without python2_tests
4a68c1b
%bcond_without python3_other
4a68c1b
%bcond_with    python3_other_tests
4a68c1b
%endif
4a68c1b
4a68c1b
%bcond_without python3
4a68c1b
%bcond_without python3_tests
4a68c1b
4a68c1b
4a68c1b
Name:           python-%{pkgname}
4a68c1b
Version:        0.0.5
b61b148
Release:        9%{?dist}
4a68c1b
Summary:        A streaming multipart parser for Python
4a68c1b
License:        ASL 2.0
4a68c1b
URL:            https://github.com/andrew-d/python-multipart
4a68c1b
Source0:        %pypi_source
4a68c1b
# https://github.com/andrew-d/python-multipart/pull/18
4a68c1b
Patch0:         use-standard-library-mock-when-available.patch
4a68c1b
BuildArch:      noarch
4a68c1b
4a68c1b
4a68c1b
%description %{_description}
4a68c1b
4a68c1b
4a68c1b
%if %{with python2}
4a68c1b
%package -n python2-%{pkgname}
4a68c1b
Summary:        %{summary}
4a68c1b
BuildRequires:  python2-devel
4a68c1b
BuildRequires:  python2-setuptools
4a68c1b
%if %{with python2_tests}
4a68c1b
BuildRequires:  python2-pytest
4a68c1b
BuildRequires:  python2-mock
4a68c1b
BuildRequires:  python2-pyyaml
4a68c1b
BuildRequires:  python2-six
4a68c1b
%endif
4a68c1b
Requires:       python2-six
4a68c1b
%{?python_provide:%python_provide python2-%{pkgname}}
4a68c1b
4a68c1b
4a68c1b
%description -n python2-%{pkgname} %{_description}
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%if %{with python3}
4a68c1b
%package -n python%{python3_pkgversion}-%{pkgname}
4a68c1b
Summary:        %{summary}
4a68c1b
BuildRequires:  python%{python3_pkgversion}-devel
4a68c1b
BuildRequires:  python%{python3_pkgversion}-setuptools
4a68c1b
%if %{with python3_tests}
4a68c1b
BuildRequires:  python%{python3_pkgversion}-pytest
4a68c1b
BuildRequires:  python%{python3_pkgversion}-PyYAML
4a68c1b
BuildRequires:  python%{python3_pkgversion}-six
4a68c1b
%endif
4a68c1b
Requires:       python%{python3_pkgversion}-six
4a68c1b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}
4a68c1b
4a68c1b
4a68c1b
%description -n python%{python3_pkgversion}-%{pkgname} %{_description}
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%if %{with python3_other}
4a68c1b
%package -n python%{python3_other_pkgversion}-%{pkgname}
4a68c1b
Summary:        %{summary}
4a68c1b
BuildRequires:  python%{python3_other_pkgversion}-devel
4a68c1b
BuildRequires:  python%{python3_other_pkgversion}-setuptools
4a68c1b
%if %{with python3_other_tests}
4a68c1b
BuildRequires:  python%{python3_other_pkgversion}-pytest
4a68c1b
BuildRequires:  python%{python3_other_pkgversion}-PyYAML
4a68c1b
BuildRequires:  python%{python3_other_pkgversion}-six
4a68c1b
%endif
4a68c1b
Requires:       python%{python3_other_pkgversion}-six
4a68c1b
4a68c1b
4a68c1b
%description -n python%{python3_other_pkgversion}-%{pkgname} %{_description}
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%prep
4a68c1b
%autosetup -n %{srcname}-%{version} -p 1
4a68c1b
rm -rf %{eggname}.egg-info
4a68c1b
4a68c1b
4a68c1b
%build
4a68c1b
%{?with_python2:%py2_build}
4a68c1b
%{?with_python3:%py3_build}
4a68c1b
%{?with_python3_other:%py3_other_build}
4a68c1b
4a68c1b
4a68c1b
%install
4a68c1b
%{?with_python2:%py2_install}
4a68c1b
%{?with_python3:%py3_install}
4a68c1b
%{?with_python3_other:%py3_other_install}
4a68c1b
4a68c1b
4a68c1b
%check
4a68c1b
%{?with_python2_tests:PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} --verbose multipart/tests}
4a68c1b
%{?with_python3_tests:PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} --verbose multipart/tests}
4a68c1b
%{?with_python3_other_tests:PYTHONPATH=%{buildroot}%{python3_other_sitelib} py.test-%{python3_other_version} --verbose multipart/tests}
4a68c1b
4a68c1b
4a68c1b
%if %{with python2}
4a68c1b
%files -n python2-%{pkgname}
4a68c1b
%license LICENSE.txt
4a68c1b
%doc README.rst
4a68c1b
%{python2_sitelib}/%{libname}
4a68c1b
%exclude %{python2_sitelib}/%{libname}/tests
4a68c1b
%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%if %{with python3}
4a68c1b
%files -n python%{python3_pkgversion}-%{pkgname}
4a68c1b
%license LICENSE.txt
4a68c1b
%doc README.rst
4a68c1b
%{python3_sitelib}/%{libname}
4a68c1b
%exclude %{python3_sitelib}/%{libname}/tests
4a68c1b
%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%if %{with python3_other}
4a68c1b
%files -n python%{python3_other_pkgversion}-%{pkgname}
4a68c1b
%license LICENSE.txt
4a68c1b
%doc README.rst
4a68c1b
%{python3_other_sitelib}/%{libname}
4a68c1b
%exclude %{python3_other_sitelib}/%{libname}/tests
4a68c1b
%{python3_other_sitelib}/%{eggname}-%{version}-py%{python3_other_version}.egg-info
4a68c1b
%endif
4a68c1b
4a68c1b
4a68c1b
%changelog
b61b148
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-9
b61b148
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b61b148
a7bec0a
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.0.5-8
a7bec0a
- Rebuilt for Python 3.9
a7bec0a
fd92f24
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-7
fd92f24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
fd92f24
db63311
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.0.5-6
db63311
- Rebuilt for Python 3.8.0rc1 (#1748018)
db63311
9de2f66
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.0.5-5
9de2f66
- Rebuilt for Python 3.8
9de2f66
783f9e7
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-4
783f9e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
783f9e7
5586bd0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-3
5586bd0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5586bd0
4a68c1b
* Mon Oct 15 2018 Carl George <carl@george.computer> - 0.0.5-2
4a68c1b
- Only build python2 subpackage on RHEL
4a68c1b
4a68c1b
* Sun Oct 14 2018 Carl George <carl@george.computer> - 0.0.5-1
4a68c1b
- Initial package