File python-configparser2.spec of Package python-configparser2

#
# spec file for package python-configparser2
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016, Martin Hauke <mardnh@gmx.de>
#
# 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-configparser2
Version:        4.0.0
Release:        0
Summary:        Backport of the enhanced config parser introduced in Python 3.x
License:        MIT
Group:          Development/Languages/Python
Url:            http://docs.python.org/3/library/configparser.html
Source:         https://files.pythonhosted.org/packages/source/c/configparser2/configparser2-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-backports
BuildArch:      noarch
%python_subpackages

%description
The ancient ConfigParser module available in the standard library 2.x has
seen a major update in Python 3.x. This is a backport of those changes so
that they can be used directly in Python 2.7.

configparser2 is derived from Lukasz Langa’s configparser mercurial repo. The
only difference is a name is not conflicting with the default python3
configparser.

%prep
%setup -q -n configparser2-%{version}
sed -i '1d' src/configparser2.py src/backports/configparser2/{helpers,__init__}.py

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst
%python2_only %{python_sitelib}/configparser2.py*
%dir %{python_sitelib}/backports/
%{python_sitelib}/backports/configparser2/
%{python_sitelib}/configparser2-%{version}-py*.egg-info
%{python_sitelib}/configparser2-%{version}-py*-nspkg.pth

%changelog
openSUSE Build Service is sponsored by