a55a25
%global pypi_name cotyledon
a55a25
ea0925
%if 0%{?fedora} || 0%{?rhel} > 7
ea0925
%bcond_with    python2
ea0925
%bcond_without python3
ea0925
%else
ea0925
%bcond_without python2
ea0925
%bcond_with    python3
a55a25
%endif
a55a25
a55a25
Name:           python-%{pypi_name}
ea0925
Version:        1.7.3
78b266
Release:        7%{?dist}
a55a25
Summary:        Cotyledon provides a framework for defining long-running services
a55a25
a55a25
License:        ASL 2.0
a55a25
URL:            https://cotyledon.readthedocs.io
a55a25
Source0:        https://pypi.io/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
a55a25
BuildArch:      noarch
a55a25
ea0925
%if %{with python2}
a55a25
%package -n python2-%{pypi_name}
a55a25
Summary:        Cotyledon provides a framework for defining long-running services
a55a25
%{?python_provide:%python_provide python2-cotyledon}
a55a25
a55a25
BuildRequires:  python2-devel
82a2ef
BuildRequires:  python2-setuptools
ea0925
BuildRequires:  python2-setuptools_scm
82a2ef
BuildRequires:  python2-pbr
a55a25
# For building documentation
82a2ef
BuildRequires:  python2-sphinx
ea0925
BuildRequires:  python-setproctitle
a55a25
ea0925
Requires:  python-setproctitle
a55a25
a55a25
%description -n python2-%{pypi_name}
a55a25
Cotyledon provides a framework for defining long-running services.
a55a25
a55a25
a55a25
%package -n python2-%{pypi_name}-tests
a55a25
Summary:          Cotyledon provides a framework for defining long-running services
82a2ef
Requires:         python2-%{pypi_name} = %{version}-%{release}
82a2ef
Requires:         python2-oslotest
82a2ef
Requires:         python2-testrepository
82a2ef
Requires:         python2-testscenarios
82a2ef
Requires:         python2-testtools
a55a25
a55a25
%description -n python2-%{pypi_name}-tests
a55a25
Cotyledon provides a framework for defining long-running services.
ea0925
%endif
a55a25
ea0925
%if %{with python3}
a55a25
%package -n python3-%{pypi_name}
a55a25
Summary:        Cotyledon provides a framework for defining long-running services
a55a25
BuildRequires:  python3-devel
a55a25
BuildRequires:  python3-setuptools
ea0925
BuildRequires:  python3-setuptools_scm
a55a25
BuildRequires:  python3-pbr
a55a25
# For building documentation
a55a25
BuildRequires:  python3-sphinx
a55a25
BuildRequires:  python3-setproctitle
a55a25
a55a25
Requires:  python3-setproctitle
a55a25
a55a25
%description -n python3-%{pypi_name}
a55a25
Cotyledon provides a framework for defining long-running services.
a55a25
a55a25
%package -n python3-%{pypi_name}-tests
a55a25
Summary:    Tests for %{name}
a55a25
Requires:         python3-%{pypi_name} = %{version}-%{release}
a55a25
Requires:         python3-oslotest
a55a25
Requires:         python3-testrepository
a55a25
Requires:         python3-testscenarios
a55a25
Requires:         python3-testtools
a55a25
a55a25
%description -n python3-%{pypi_name}-tests
a55a25
Cotyledon provides a framework for defining long-running services.
a55a25
a55a25
This package contains test files
a55a25
%endif
a55a25
a55a25
%package doc
a55a25
Summary:    Documentation for %{name}
a55a25
a55a25
%description doc
a55a25
Cotyledon provides a framework for defining long-running services.
a55a25
a55a25
This package contains documentation in HTML format.
a55a25
a55a25
%description
a55a25
Cotyledon provides a framework for defining long-running services.
a55a25
a55a25
%prep
a55a25
%setup -q -n %{pypi_name}-%{version}
a55a25
ea0925
%if %{with python3}
a55a25
rm -rf %{py3dir}
a55a25
cp -a . %{py3dir}
a55a25
%endif
a55a25
a55a25
# Let RPM handle the requirements
a55a25
rm -f {,test-}requirements.txt
a55a25
a55a25
%build
ea0925
%if %{with python2}
a55a25
%py2_build
ea0925
%endif
ea0925
%if %{with python3}
a55a25
pushd %{py3dir}
fc2ff9
%{__python3} setup.py build
a55a25
popd
a55a25
%endif
a55a25
ea0925
%if %{with python2}
a55a25
export PYTHONPATH="$( pwd ):$PYTHONPATH"
a55a25
sphinx-build -b html doc/source html
ea0925
%else
ea0925
export PYTHONPATH="$( pwd ):$PYTHONPATH"
ea0925
sphinx-build-3 -b html doc/source html
ea0925
%endif
a55a25
ea0925
# Fix hidden-file-or-dir warnings
ea0925
rm -rf html/.doctrees html/.buildinfo
a55a25
a55a25
%install
ea0925
%if %{with python2}
a55a25
%{__python2} setup.py install --skip-build --root %{buildroot}
ea0925
%endif
a55a25
ea0925
%if %{with python3}
a55a25
pushd %{py3dir}
a55a25
%{__python3} setup.py install --skip-build --root %{buildroot}
a55a25
popd
a55a25
%endif
a55a25
a55a25
%check
ea0925
%if %{with python3}
a55a25
%{__python3} setup.py test ||:
a55a25
rm -rf .testrepository
a55a25
%endif
ea0925
%if %{with python2}
a55a25
%{__python2} setup.py test ||:
ea0925
%endif
a55a25
ea0925
%if %{with python2}
6f9639
%files -n python2-%{pypi_name}
a55a25
%doc README.rst
a55a25
%license LICENSE
a55a25
%{python2_sitelib}/%{pypi_name}
a55a25
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
a55a25
ea0925
%files -n python2-%{pypi_name}-tests
ea0925
%license LICENSE
ea0925
%{python2_sitelib}/%{pypi_name}/tests/
ea0925
%endif
ea0925
ea0925
%if %{with python3}
a55a25
%files -n python3-%{pypi_name}
a55a25
%doc README.rst
a55a25
%license LICENSE
a55a25
%{python3_sitelib}/%{pypi_name}
512361
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
a55a25
a55a25
%files -n python3-%{pypi_name}-tests
a55a25
%license LICENSE
a55a25
%{python3_sitelib}/%{pypi_name}/tests
a55a25
a55a25
%endif
a55a25
a55a25
%files doc
a55a25
%doc html
a55a25
a55a25
%changelog
78b266
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-7
78b266
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
78b266
7e0e99
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.7.3-6
7e0e99
- Rebuilt for Python 3.9
7e0e99
56170b
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-5
56170b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
56170b
995033
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.7.3-4
995033
- Rebuilt for Python 3.8.0rc1 (#1748018)
995033
d17b37
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.7.3-3
d17b37
- Rebuilt for Python 3.8
d17b37
0de727
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-2
0de727
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0de727
ea0925
* Thu Jan 31 2019 Alfredo Moralejo <amoralej@redhat.com> - 1.7.3-1
ea0925
- Update to 1.7.3.
ea0925
- Remove python2 subpackages when building in Fedora.
ea0925
fc2ff9
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.6.7-9
fc2ff9
- Drop explicit locale setting
fc2ff9
  See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
fc2ff9
2d560f
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.7-8
2d560f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2d560f
dd95e0
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.6.7-7
dd95e0
- Rebuilt for Python 3.7
dd95e0
82a2ef
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.6.7-6
82a2ef
- Update Python 2 dependency declarations to new packaging standards
82a2ef
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
82a2ef
1c2e40
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.6.7-5
1c2e40
- Escape macros in %%changelog
1c2e40
a7f677
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.7-4
a7f677
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a7f677
849686
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.7-3
849686
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
849686
d191a0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.7-2
d191a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d191a0
3776d2
* Wed Feb 08 2017 Pradeep Kilambi <pkilambi@redhat.com> - 1.6.7-1
557600
- Rebase 1.6.7
557600
9310d4
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.6.3-2
9310d4
- Rebuild for Python 3.6
9310d4
21d80c
* Thu Dec  1 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.6.3-1
21d80c
- Upstream 1.6.3
21d80c
6f9639
* Fri Sep 02 2016 Alan Pevec <apevec AT redhat.com> - 1.2.7-2
6f9639
- python2 subpackage was missing
6f9639
a55a25
* Wed Aug 31 2016 Pradeep Kilambi <pkilambi@redhat.com> - 1.2.7-1
a55a25
- Rebase to 1.2.7
1c2e40
- move sphinx-build to %%build
a55a25
- move buildRequires/requires to python2-cotyledon 
a55a25
- run python3 tests
a55a25
a55a25
* Fri Jul 15 2016 Pradeep Kilambi <pkilambi@redhat.com> - 1.2.5-3
a55a25
- Add check section
a55a25
- added new test dependencies
a55a25
- fixed tests sub packages
a55a25
a55a25
* Thu Jul 14 2016 Pradeep Kilambi <pkilambi@redhat.com> - 1.2.5-2
a55a25
- Fix source url
a55a25
a55a25
* Wed Jul 6 2016 Mehdi Abaakouk <sileht@redhat.com> - 1.2.5-1
a55a25
- Initial package.