#
# spec file for package python-configobj
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, 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-%{**}}
%define oldpython python
Name:           python-configobj
Version:        5.0.6
Release:        2.3
Url:            https://github.com/DiffSK/configobj
Summary:        Config file reading, writing and validation
License:        BSD-3-Clause
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/c/configobj/configobj-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module six}
Requires:       python-six
# There are no real docs!
%ifpython2
Obsoletes:      %{oldpython}-configobj-docs < %{version}
Provides:       %{oldpython}-configobj-docs = %{version}
%endif
BuildArch:      noarch
%python_subpackages

%description
ConfigObj is a simple but powerful config file reader and writer: an ini
file round tripper. Its main feature is that it is very easy to use, with a
straightforward programmer's interface and a simple syntax for config files.
It has lots of other features though:

 * Nested sections (subsections), to any level
 * List values
 * Multiple line values
 * Full Unicode support
 * String interpolation (substitution)
 * Integrated with a powerful validation system
   - including automatic type checking/conversion
   - and allowing default values
   - repeated sections
 * All comments in the file are preserved
 * The order of keys/sections is preserved
 * Powerful ``unrepr`` mode for storing/retrieving Python data-types

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

%build
%python_build

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

%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/configobj.py*
%{python_sitelib}/validate.py*
%{python_sitelib}/_version.py*
%pycache_only %{python_sitelib}/__pycache__/configobj.*.py*
%pycache_only %{python_sitelib}/__pycache__/validate.*.py*
%pycache_only %{python_sitelib}/__pycache__/_version.*.py*
%{python_sitelib}/configobj-%{version}-py*.egg-info

%changelog
* Wed May 24 2017 toddrme2178@gmail.com
- Implement single-spec version.
- Fix source URL.
* Thu Sep 11 2014 toddrme2178@gmail.com
- Update to version 5.0.6
  * Improves error messages in certain edge cases
* Thu Jul 24 2014 fcastelli@suse.com
- Added runtime depedency: python-six
* Wed Jul 23 2014 fcastelli@suse.com
- Update to version 5.0.5:
  * BUGFIX: error in writing out config files to disk with non-ascii
    characters
  * BUGFIX: correcting that the code path fixed in 5.0.3 didn’t cover
    reading in config files
  * BUGFIX: not handling unicode encoding well, especially with respect to
    writing out files
  * Specific error message for installing version this version on Python
    versions older than 2.5
  * Documentation corrections
  * BUGFIX: Fixed regression on python 2.x where passing an encoding parameter
    did not convert a bytestring config file (which is the most common) to
    unicode. Added unit tests for this and related cases
  * BUGFIX: A particular error message would fail to display with a type error
    on python 2.6 only
  * Python 3 single-source compatibility at the cost of a more restrictive set
    of versions: 2.6, 2.7, 3.2, 3.3 (otherwise unchanged)
* Tue May 29 2012 cfarrell@suse.com
- license update: BSD-3-Clause
  Refers only to the license available at
  http://www.voidspace.org.uk/python/license.shtml (which is BSD-3-Clause)
* Fri May 25 2012 toddrme2178@gmail.com
- Spec file cleanups
* Sun Feb  5 2012 dimstar@opensuse.org
- Really make the obsoletes sane: The package was called
  python-configobj-docs before, so that's what we need to obsolete
  (not -doc).
- The Obsoletes tag is for <= %%{version}, as the package existed in
  version 4.7.2, which is also when it was merged back. Obsoleting
  only < 4.7.2 would cause conflicts when installing the newly
  merged package.
* Tue Jan 24 2012 bwiedemann@suse.com
- fix Obsoletes
* Fri Dec  9 2011 saschpe@suse.de
- Spec file cleanup:
  * Use upstream tarball
  * Obsoleted empty doc package
  * Fix SLE-11 build
  * Use upstream description
* Thu Dec  8 2011 coolo@suse.com
- fix license to be in spdx.org format
* Mon Sep 13 2010 dimstar@opensuse.org
- Update to version 4.7.2:
  + BUGFIX: Restore Python 2.3 compatibility
  + BUGFIX: Members that were lists were being returned as copies
    due to interpolation introduced in 4.7. Lists are now only
    copies if interpolation changes a list member.
  + BUGFIX: pop now does interpolation in list values as well.
  + BUGFIX: where interpolation matches a section name rather
    than a value it is ignored instead of raising an exception on
    fetching the item.
  + BUGFIX: values that use interpolation to reference members
    that don't exist can now be repr'd.
  + BUGFIX: Fix to avoid writing '\r\r\n' on Windows when given a
    file opened in text write mode ('w').
* Tue Jul 20 2010 pascal.bleser@opensuse.org
- update to 4.7.1
- split out -docs subpackage
* Sun May 27 2007 peter+rpmspam@suntel.com.tr
- add "unzip" as a builddep so it builds on Factory - 4.4.0
* Fri May 11 2007 poeml@suse.de
- package created (copy from packman package) - 4.4.0