File python-deform.spec of Package python-deform

#
# spec file for package python-deform
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-deform
Version:        2.0.4
Release:        0
Url:            http://docs.pylonsproject.org/projects/deform/en/latest/
Summary:        Another form generation library
License:        BSD-4-Clause and ZPL-2.1 and MIT
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/d/deform/deform-%{version}.tar.gz
Source1:        colander.inv
Source2:        python.inv
Source3:        pyramid.inv
Source4:        update-intersphinx-files.sh
Source5:        https://github.com/Pylons/deform/raw/master/LICENSE.txt
Patch:          deform-local-intersphinx-files.patch
Requires:       python-Chameleon >= 2.5.1
Requires:       python-colander >= 1.0a1
Requires:       python-iso8601
Requires:       python-peppercorn >= 0.3
Requires:       python-translationstring >= 1.0
Requires:       python-zope.deprecation
BuildRequires:  %{python_module Chameleon} >= 2.5.1
BuildRequires:  %{python_module colander} >= 1.0a1
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module iso8601}
BuildRequires:  %{python_module peppercorn} >= 0.3
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module translationstring} >= 1.0
BuildRequires:  %{python_module zope.deprecation}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
# Documentation 
BuildRequires:  python3-Sphinx
# Testing requirements:
BuildRequires:  %{python_module beautifulsoup4}
BuildRequires:  %{python_module coverage}
BuildRequires:  %{python_module flaky}
BuildRequires:  %{python_module nose}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%python_subpackages

%description
A Python HTML form library.

Please see -doc package or
http://docs.pylonsproject.org/projects/deform/en/latest/ for the documentation.

%package lang
Summary:        Languages for package %{name}
Group:          System/Localization
Requires:       %{name} = %{version}
Supplements:    packageand(bundle-lang-other:%{name})
Provides:       %{name}-lang-all = %{version}

%description lang
Provides translations to the package %{name}

%package -n %{name}-doc
Summary:        Documentation for Another form generation library
Group:          Development/Languages/Python
Requires:       %{name} = %{version}

%description -n %{name}-doc
This package contains documentation files for %{name}.

%prep
%setup -q -n deform-%{version}
%patch -p1
cp %{S:1} docs/
cp %{S:2} docs/
cp %{S:3} docs/
cp %{S:5} .
# Fix spurious backup files
find . -type f -iname "*.*~" -delete

%build
%python_build
python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo

%install
%python_install
%find_lang deform
%find_lang messages
%python_expand grep -F "%{$python_sitelib}" deform.lang > deform_%{$python_bin_suffix}.lang
%python_expand grep -F "%{$python_sitelib}" messages.lang >> deform_%{$python_bin_suffix}.lang
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}

%check
%python_exec setup.py test 

%files %{python_files}
%defattr(-,root,root,-)
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE.txt
%else
%doc LICENSE.txt
%endif
%doc README.rst
%{python_sitelib}/*
%exclude %{python_sitelib}/deform/locale

%if %have_python2 && ! 0%{?skip_python2}
%files -n %{python2_prefix}-deform-lang -f deform_%{python2_bin_suffix}.lang
%defattr(-,root,root,-)
%{python2_sitelib}/deform/locale
%endif

%if %have_python2 && ! 0%{?skip_python3}
%files -n %{python3_prefix}-deform-lang -f deform_%{python3_bin_suffix}.lang
%defattr(-,root,root,-)
%{python3_sitelib}/deform/locale
%endif

%files -n %{name}-doc
%defattr(-,root,root,-)
%doc build/sphinx/html

%changelog
openSUSE Build Service is sponsored by