From 57dca060cc2729267099d3a58136a6772f6c5aee Mon Sep 17 00:00:00 2001 From: Alan Pevec Date: Jun 18 2018 16:50:53 +0000 Subject: Sync with RDO rpm-master distgit https://review.rdoproject.org/r/#/q/project:openstack/reno-distgit --- diff --git a/python-reno.spec b/python-reno.spec index f97a383..6798d5e 100644 --- a/python-reno.spec +++ b/python-reno.spec @@ -5,6 +5,10 @@ %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. @@ -14,6 +18,13 @@ %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 @@ -23,75 +34,74 @@ 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 -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. +%{common_desc} %package -n python2-%{pypi_name} Summary: RElease NOtes manager %{?python_provide:%python_provide python2-%{pypi_name}} -BuildRequires: git BuildRequires: python2-devel +BuildRequires: python2-dulwich BuildRequires: python2-setuptools BuildRequires: python2-pbr BuildRequires: python2-babel -BuildRequires: python2-dulwich -BuildRequires: python2-six BuildRequires: python2-sphinx -BuildRequires: python2-oslo-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 -Requires: python2-pyyaml -Requires: python2-six -Requires: 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} -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. +%{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-dulwich BuildRequires: python3-sphinx -BuildRequires: python3-oslo-sphinx BuildRequires: python3-PyYAML +BuildRequires: git -Requires: python3-pbr -Requires: python3-babel -Requires: python3-dulwich -Requires: python3-PyYAML -Requires: python3-six -Requires: 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} -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. +%{common_desc} %endif @@ -101,9 +111,7 @@ Summary: Reno documentation Documentation for Reno %prep -%autosetup -n %{pypi_name}-%{version} -S git -# https://bugs.launchpad.net/reno/+bug/1520096 -sed -i '/[Nn]ewton/d' doc/source/history.rst +%autosetup -n %{pypi_name}-%{upstream_version} %build %py2_build @@ -126,12 +134,15 @@ ln -s %{_bindir}/python3-%{pypi_name} %{buildroot}%{_bindir}/%{pypi_name} ln -s %{_bindir}/python2-%{pypi_name} %{buildroot}%{_bindir}/%{pypi_name} %endif +%if 0%{?with_docs} # generate html docs -%{__python2} setup.py build_sphinx -rm -rf doc/build/html/.{doctrees,buildinfo} doc/build/html/objects.inv +sphinx-build doc/source html +# remove the sphinx-build leftovers +rm -rf html/.{doctrees,buildinfo} +%endif %files -n python2-%{pypi_name} -%doc doc/source/readme.rst README.rst +%doc README.rst %license LICENSE %if 0%{?default_python} <= 2 %{_bindir}/%{pypi_name} @@ -142,7 +153,7 @@ rm -rf doc/build/html/.{doctrees,buildinfo} doc/build/html/objects.inv %if 0%{?with_python3} %files -n python3-%{pypi_name} -%doc doc/source/readme.rst README.rst +%doc README.rst %license LICENSE %if 0%{?default_python} >= 3 %{_bindir}/%{pypi_name} @@ -153,7 +164,9 @@ rm -rf doc/build/html/.{doctrees,buildinfo} doc/build/html/objects.inv %endif %files -n python-%{pypi_name}-doc -%doc doc/build/html +%if 0%{?with_docs} +%doc html +%endif %license LICENSE %changelog