diff --git a/python-pip.spec b/python-pip.spec index a285828..3813d10 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -3,6 +3,11 @@ %bcond_without python2 %bcond_without python3 +%if %{without python3} +%bcond_with doc +%else +%bcond_without doc +%endif %global srcname pip %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl @@ -25,7 +30,7 @@ Name: python-%{srcname} # When updating, update the bundled libraries versions bellow! Version: 9.0.1 -Release: 15%{?dist} +Release: 16%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -173,10 +178,26 @@ written in Python. Many packages can be found in the Python Package Index (PyPI). pip is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python". +%if %{with doc} +%package doc +Summary: A documentation for a tool for installing and managing Python packages + +BuildRequires: python%{python3_pkgversion}-sphinx + +%description doc +A documentation for a tool for installing and managing Python packages + +%endif + %endif # with python3 %prep +%if %{with doc} && %{without python3} +echo "This combination (with doc, without python3) is unsupported" +exit 1 +%endif + %setup -q -n %{srcname}-%{version} %if %{with tests} tar -xf %{SOURCE1} @@ -208,6 +229,14 @@ rm pip/_vendor/ordereddict.py %endif %endif # with python3 +%if %{with doc} +pushd docs +make html +make man +rm _build/html/.buildinfo +popd +%endif + %install %if %{with python3} @@ -222,6 +251,17 @@ rm pip/_vendor/ordereddict.py rm %{buildroot}%{_bindir}/pip %endif # with python3 +%if %{with doc} +install -d %{buildroot}%{_mandir}/man1 +%if %{with python2} +install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip.1 +install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip2.1 +%endif +%if %{with python3} +install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip3.1 +%endif +%endif # with doc + %if %{with python2} %if %{without bootstrap} %py2_install_wheel %{python2_wheelname} @@ -299,7 +339,11 @@ py.test-%{python3_version} -m 'not network' %if %{with python2} %files -n python2-%{srcname} %license LICENSE.txt -%doc README.rst docs +%doc README.rst +%if %{with doc} +%{_mandir}/man1/pip.* +%{_mandir}/man1/pip2.* +%endif %{_bindir}/pip %{_bindir}/pip2 %{_bindir}/pip-2 @@ -317,7 +361,10 @@ py.test-%{python3_version} -m 'not network' %if %{with python3} %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE.txt -%doc README.rst docs +%doc README.rst +%if %{with doc} +%{_mandir}/man1/pip3.* +%endif %{_bindir}/pip3 %{_bindir}/pip-3 %{_bindir}/pip%{python3_version} @@ -328,9 +375,19 @@ py.test-%{python3_version} -m 'not network' %if 0%{?bashcomp2} %dir %(dirname %{bashcompdir}) %endif + +%if %{with doc} +%files doc +%license LICENSE.txt +%doc README.rst +%doc docs/_build/html +%endif # with doc %endif # with python3 %changelog +* Wed Feb 21 2018 Lumír Balhar - 9.0.1-16 +- Include built HTML documentation (in the new -doc subpackage) and man page + * Fri Feb 09 2018 Fedora Release Engineering - 9.0.1-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild