1
0

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

- singlespec auto-conversion
- common -doc subpackage
- improve packaging of docs

OBS-URL: https://build.opensuse.org/request/show/521118
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=15
This commit is contained in:
Jan Matejek 2017-09-05 11:55:26 +00:00 committed by Git OBS Bridge
parent 6ee3bb46b0
commit a61398687f
2 changed files with 27 additions and 20 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 24 13:38:57 UTC 2017 - jmatejek@suse.com
- singlespec auto-conversion
-------------------------------------------------------------------
Wed Mar 9 10:07:35 UTC 2016 - bwiedemann@suse.com
@ -254,3 +259,4 @@ Thu Oct 13 00:00:00 CET 2005 - jfunk@funktronics.ca
- Initial release

View File

@ -1,7 +1,7 @@
#
# spec file for package python-FormEncode
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,30 +16,31 @@
#
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-FormEncode
Version: 1.3.0
Release: 0
Url: http://formencode.org
Summary: HTML form validation, generation, and conversion package
License: Python-2.0
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/F/FormEncode/FormEncode-%{version}.zip
Url: http://formencode.org
Source: https://files.pythonhosted.org/packages/source/F/FormEncode/FormEncode-%{version}.zip
Source1: FormEncode-doc-infrastructure.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: unzip
Provides: python-formencode = %{version}
Obsoletes: python-formencode < %{version}
# Documentation requirements:
BuildRequires: python-Sphinx
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%ifpython2
Provides: %{oldpython}-formencode = %{version}
Obsoletes: %{oldpython}-formencode < %{version}
%endif
%python_subpackages
%description
FormEncode validates and converts nested structures. It allows for
@ -61,11 +62,11 @@ sed -i 's/\r$//g' PKG-INFO README.rst
sed -i '/^:date:/d' docs/*.txt # fix build-compare
%build
python setup.py build
python setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%python_build
%python_exec setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
# install documentation
rm -r %{buildroot}/%{python_sitelib}/docs # remove misplaced documentation
@ -74,14 +75,14 @@ cp -r README.rst build/sphinx/html %{buildroot}%{_docdir}/%{name}/
%fdupes %{buildroot}/%{_prefix}
%files
%files %{python_files}
%defattr(-,root,root,-)
%exclude %{_docdir}/%{name}/html
%doc %dir %{_docdir}/%{name}/
%doc %{_docdir}/%{name}/README.rst
%{python_sitelib}/*
%files doc
%files %{python_files doc}
%defattr(-,root,root,-)
%doc %dir %{_docdir}/%{name}/html
%doc %{_docdir}/%{name}/html/*