%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global pypi_name reno
%if 0%{?fedora}
%global with_python3 1
%endif
# Currently, we cannot generate reno docs from a tarball due to
# https://bugs.launchpad.net/reno/+bug/1520096
%global with_docs 0
# Only reason to choose 24 is that that's what was in development when we made
# the switch for this package. Fedora Policy was to have made this switch for
# Fedora 22.
%if 0%{?fedora} >= 24
%global default_python 3
%else
%global default_python 2
%endif
%global common_desc \
Reno is a release notes manager for storing \
release notes in a git repository and then building documentation from them. \
\
Managing release notes for a complex project over a long period \
of time with many releases can be time consuming and error prone. Reno \
helps automate the hard parts.
Name: python-%{pypi_name}
Version: 2.0.3
Release: 5%{?dist}
Summary: RElease NOtes manager
License: ASL 2.0
URL: http://www.openstack.org/
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{pypi_name}
Summary: RElease NOtes manager
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python2-devel
BuildRequires: python2-dulwich
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
BuildRequires: python2-babel
BuildRequires: python2-sphinx
%if 0%{?fedora} > 27
BuildRequires: python2-pyyaml
# Until https://src.fedoraproject.org/rpms/python-dulwich/pull-request/3 is merged, we need this
BuildRequires: python2-certifi
%else
BuildRequires: PyYAML
%endif
BuildRequires: git
Requires: python2-pbr
Requires: python2-babel
Requires: python2-dulwich
%if 0%{?fedora} > 27
Requires: python2-pyyaml
# Until https://src.fedoraproject.org/rpms/python-dulwich/pull-request/3 is merged, we need this
Requires: python2-certifi
%else
Requires: PyYAML
%endif
Requires: python2-six
Requires: git
%description -n python2-%{pypi_name}
%{common_desc}
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: RElease NOtes manager
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-dulwich
# Until https://src.fedoraproject.org/rpms/python-dulwich/pull-request/3 is merged, we need this
BuildRequires: python3-certifi
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-babel
BuildRequires: python3-sphinx
BuildRequires: python3-PyYAML
BuildRequires: git
Requires: python3-pbr
Requires: python3-babel
Requires: python3-dulwich
# Until https://src.fedoraproject.org/rpms/python-dulwich/pull-request/3 is merged, we need this
Requires: python3-certifi
Requires: python3-PyYAML
Requires: python3-six
Requires: git
%description -n python3-%{pypi_name}
%{common_desc}
%endif
%package -n python-%{pypi_name}-doc
Summary: Reno documentation
%description -n python-%{pypi_name}-doc
Documentation for Reno
%prep
%autosetup -n %{pypi_name}-%{upstream_version}
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
mv %{buildroot}%{_bindir}/%{pypi_name} %{buildroot}%{_bindir}/python2-%{pypi_name}
%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/%{pypi_name} %{buildroot}%{_bindir}/python3-%{pypi_name}
%endif
%if 0%{?default_python} >= 3
ln -s %{_bindir}/python3-%{pypi_name} %{buildroot}%{_bindir}/%{pypi_name}
%else
ln -s %{_bindir}/python2-%{pypi_name} %{buildroot}%{_bindir}/%{pypi_name}
%endif
%if 0%{?with_docs}
# generate html docs
sphinx-build doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%endif
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%if 0%{?default_python} <= 2
%{_bindir}/%{pypi_name}
%endif
%{_bindir}/python2-%{pypi_name}
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-*.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%if 0%{?default_python} >= 3
%{_bindir}/%{pypi_name}
%endif
%{_bindir}/python3-%{pypi_name}
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-*.egg-info
%endif
%files -n python-%{pypi_name}-doc
%if 0%{?with_docs}
%doc html
%endif
%license LICENSE
%changelog
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.3-5
- 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> - 2.0.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Dec 23 2016 Alan Pevec <alan.pevec@redhat.com> 2.0.3-1
- Update to 2.0.3
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.8.0-2
- Rebuild for Python 3.6
* Tue Sep 13 2016 Alan Pevec <alan.pevec@redhat.com> 1.8.0-1
- Update to 1.8.0
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Apr 07 2016 Haikel Guemar <hguemar@fedoraproject.org> 1.6.2-1
- Update to 1.6.2
* Tue Mar 15 2016 Paul Belanger <pabelanger@redhat.com> - 1.6.0-1
- New upstream 1.6.0 release
* Thu Feb 18 2016 Paul Belanger <pabelanger@redhat.com> - 1.5.0-1
- New upstream 1.5.0 release
- Fix rpmlint spelling-error warnings
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sun Jan 24 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.3.1-2
- Simplify macros and reno CLI generation
- Fix build on EL7
* Fri Jan 22 2016 Paul Belanger <pabelanger@redhat.com> 1.3.1-1
- New upstream 1.3.1 release
- Switch to setup.py build_sphinx to keep inline with upstream documentation
builds
- Various rpmlint fixes
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Nov 5 2015 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1.0-3
- Ship the reno script against python3 to comply with the python guidelines and
solve the issue of the python3 package depending on /usr/bin/python2
* Wed Sep 30 2015 Chandan Kumar <chkumar246@gmail.com> -0.1.0-2
- Some cosmetic changes in spec file
* Wed Sep 30 2015 Chandan Kumar <chkumar246@gmail.com> - 0.1.0-1
- Initial Package