%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global pypi_name os-testr
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{pypi_name}
Version: 0.8.0
Release: 8%{?dist}
Summary: A testr wrapper to provide functionality for OpenStack projects
License: ASL 2.0
URL: http://git.openstack.org/cgit/openstack/%{pypi_name}
Source0: http://tarballs.openstack.org/os-testr/os-testr-%{upstream_version}.tar.gz
BuildArch: noarch
%global _description\
ostestr is a testr wrapper that uses subunit-trace for output and builds\
some helpful extra functionality around testr.
%description %_description
%package -n python2-%{pypi_name}
Summary: %summary
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-setuptools
Requires: python2-pbr
Requires: python2-babel
Requires: python2-testrepository
Requires: python2-subunit
Requires: python2-testtools
Requires: python2-setuptools
Provides: python2-os-testr
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name} %_description
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: A testr wrapper to provide functionality for OpenStack projects
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
Requires: python3-pbr
Requires: python3-babel
Requires: python3-testrepository
Requires: python3-subunit
Requires: python3-testtools
Requires: python3-setuptools
%description -n python3-%{pypi_name}
ostestr is a testr wrapper that uses subunit-trace for output and builds
some helpful extra functionality around testr.
%endif
%package doc
Summary: Documentation for ostestr module
%if %{with python3}
BuildRequires: python3-sphinx
BuildRequires: python3-oslo-sphinx
%else
BuildRequires: python2-sphinx
BuildRequires: python2-oslo-sphinx
%endif
Provides: python3-%{pypi_name}-doc = %{version}-%{release}
Obsoletes: python3-%{pypi_name}-doc < 0.8.0-8
%description doc
Documentation for ostestr module
%prep
%setup -q -n %{pypi_name}-%{upstream_version}
# Let RPM handle the dependencies
rm -f test-requirements.txt requirements.txt
# delete shebangs
find -name '*.py' | xargs sed -i -e '1 {/^#!/d}'
%build
%py2_build
%{?with_python3:%py3_build}
sphinx-build%{?with_python3:-3} -b html -d build/doctrees doc/source doc/build/html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.buildinfo
# Fix this rpmlint warning
sed -i "s|\r||g" doc/build/html/_static/jquery.js
%install
%py2_install
for file in $RPM_BUILD_ROOT%{python2_sitelib}/os_testr/{subunit_trace,ostestr,subunit2html}.py; do
chmod a+x $file
done
%if 0%{?with_python3}
%py3_install
for file in $RPM_BUILD_ROOT%{python3_sitelib}/os_testr/{subunit_trace,ostestr,subunit2html}.py;do
chmod a+x $file
done
%endif
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%if ! 0%{?with_python3}
%{_bindir}/generate-subunit
%{_bindir}/ostestr
%{_bindir}/subunit-trace
%{_bindir}/subunit2html
%endif
%{python2_sitelib}/os_testr
%{python2_sitelib}/os_testr-*.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{_bindir}/generate-subunit
%{_bindir}/ostestr
%{_bindir}/subunit-trace
%{_bindir}/subunit2html
%{python3_sitelib}/os_testr
%{python3_sitelib}/os_testr-*.egg-info
%endif
%files doc
%license LICENSE
%doc doc/build/html
%changelog
* Wed Dec 12 2018 Carl George <carl@george.computer> - 0.8.0-8
- Remove all shebangs to prevent incorrect dependencies rhbz#1391119
- Remove python3-os-testr-doc subpackage (duplicate content of python-os-testr-doc)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.0-6
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Jan 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.8.0-4
- 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> - 0.8.0-3
- Python 2 binary package renamed to python2-os-testr
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Sep 29 2016 Chandan Kumar <chkumar@redhat.com> 0.8.0-1
- Update to 0.8.0
* Sun Sep 11 2016 Haikel Guemar <hguemar@fedoraproject.org> 0.7.0-1
- Update to 0.7.0