File python-configparser.spec of Package python-configparser

#
# spec file for package python-configparser
#
# 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/
#


Name:           python-configparser
Version:        3.5.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://pypi.io/packages/source/c/configparser/configparser-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-setuptools
Requires:       python-backports
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       python2-configparser = %{version}

%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.

# Note: we use this package as a basis for the backports/ directory because it
# is small and has a better __init__.py file

%package -n python-backports
Url:            https://pypi.python.org/pypi/backports/
Summary:        Namespace for backported Python features

%description -n python-backports
This is a common package that backports using the "backports" namespace
must depend on to avoid conflicts.  You shouldn't install this directly,
packages that require this will pultll it in automatically.

Please see these links for more details:
    https://pypi.python.org/pypi/backports/
    https://www.python.org/dev/peps/pep-0420/\%23namespace-packages-today

If your package provides a module in the %{python_sitelib}/backports
folder, please depend on this and delete any existing 
%{python_sitelib}/backports/__init__.py file provided by that package.

%prep
%setup -q -n configparser-%{version}

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
cp src/backports/__init__.py %{buildroot}%{python_sitelib}/backports/
%py_compile %{buildroot}%{python_sitelib}/backports/__init__.py

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

%files -n python-backports
%defattr(-,root,root,-)
%dir %{python_sitelib}/backports/
%{python_sitelib}/backports/__init__.py*

%changelog
openSUSE Build Service is sponsored by