# Created by pyp2rpm-1.0.1
%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
%if 0%{?fedora} > 12
%global with_python3 1
%endif
%global pypi_name junitxml
Name: python-%{pypi_name}
Version: 0.7
Release: 13%{?dist}
Summary: PyJUnitXML, a pyunit extension to output JUnit compatible XML
License: LGPLv3
URL: https://launchpad.net/pyjunitxml
Source0: https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-devel
%global _description\
PyJUnitXML\
==========\
A Python unittest TestResult that outputs JUnit\
compatible XML.
%description %_description
%package -n python2-%{pypi_name}
Summary: %summary
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name} %_description
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: PyJUnitXML, a pyunit extension to output JUnit compatible XML
BuildRequires: python3-devel
%description -n python3-%{pypi_name}
PyJUnitXML
==========
A Python unittest TestResult that outputs JUnit
compatible XML.
%endif
%prep
%setup -q -n %{pypi_name}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
mv %{buildroot}%{_bindir}/pyjunitxml %{buildroot}%{_bindir}/pyjunitxml-%{python3_version}
ln -s ./pyjunitxml-%{python3_version} %{buildroot}%{_bindir}/pyjunitxml-3
%endif
%{__python2} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/pyjunitxml %{buildroot}%{_bindir}/pyjunitxml-%{python2_version}
ln -s ./pyjunitxml-%{python2_version} %{buildroot}%{_bindir}/pyjunitxml-2
ln -s ./pyjunitxml-2 %{buildroot}%{_bindir}/pyjunitxml
%files -n python2-%{pypi_name}
%doc COPYING
%{_bindir}/pyjunitxml
%{_bindir}/pyjunitxml-2
%{_bindir}/pyjunitxml-%{python2_version}
%{python_sitelib}/%{pypi_name}
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc COPYING
%{_bindir}/pyjunitxml-3
%{_bindir}/pyjunitxml-%{python3_version}
%{python3_sitelib}/*
%endif
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.7-12
- Python 2 binary package renamed to python2-junitxml
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Feb 16 2017 Iryna Shcherbina <ishcherb@redhat.com> - 0.7-10
- Fix python-junitxml dragging in both Python 3 and Python 2 (RHBZ#1422933)
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.7-8
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Tue Apr 29 2014 Steve Linabery <slinaber@redhat.com> - 0.7-1
- Initial package.