Accepting request 522041 from devel:languages:python:singlespec-staging

- common -doc subpackage
- improve packaging of docs

OBS-URL: https://build.opensuse.org/request/show/522041
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=16
This commit is contained in:
Jan Matejek 2017-09-07 15:45:01 +00:00 committed by Git OBS Bridge
parent a61398687f
commit 942c58b695
2 changed files with 13 additions and 15 deletions

View File

@ -2,6 +2,8 @@
Thu Aug 24 13:38:57 UTC 2017 - jmatejek@suse.com
- singlespec auto-conversion
- common -doc subpackage
- improve packaging of docs
-------------------------------------------------------------------
Wed Mar 9 10:07:35 UTC 2016 - bwiedemann@suse.com

View File

@ -28,11 +28,11 @@ Url: http://formencode.org
Source: https://files.pythonhosted.org/packages/source/F/FormEncode/FormEncode-%{version}.zip
Source1: FormEncode-doc-infrastructure.tar.gz
# Documentation requirements:
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@ -47,12 +47,12 @@ FormEncode validates and converts nested structures. It allows for
a declarative form of defining the validation, and decoupled processes
for filling and generating forms.
%package doc
%package -n %{name}-doc
Summary: HTML form validation, generation, and conversion package
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Provides: %{python_module FormEncode-doc = %{version}}
%description doc
%description -n %{name}-doc
This package contains documentation files for %{name}.
%prep
@ -63,28 +63,24 @@ sed -i '/^:date:/d' docs/*.txt # fix build-compare
%build
%python_build
%python_exec setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%{_python_use_flavor python3}
python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo && mv build/sphinx/html html
%install
%python_install
# install documentation
rm -r %{buildroot}/%{python_sitelib}/docs # remove misplaced documentation
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -r README.rst build/sphinx/html %{buildroot}%{_docdir}/%{name}/
rm -r %{buildroot}%{python_sitelib}/docs # remove misplaced documentation
%fdupes %{buildroot}/%{_prefix}
%fdupes %{buildroot}%{_prefix}
%files %{python_files}
%defattr(-,root,root,-)
%exclude %{_docdir}/%{name}/html
%doc %dir %{_docdir}/%{name}/
%doc %{_docdir}/%{name}/README.rst
%doc README.rst
%{python_sitelib}/*
%files %{python_files doc}
%files -n %{name}-doc
%defattr(-,root,root,-)
%doc %dir %{_docdir}/%{name}/html
%doc %{_docdir}/%{name}/html/*
%doc html
%changelog