File python-iniparse.spec of Package python-iniparse

# spec file for package python-iniparse
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Neal Gompa <>.
# 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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-iniparse
Version:        0.4
Release:        0
Summary:        Python Module for Accessing and Modifying Configuration Data in INI files
License:        MIT
Group:          Development/Libraries/Python
# PATCH-FIX-UPSTREAM: -- Backport of
Patch0:         iniparse-insert-after-commented-option.patch
# PATCH-FIX-UPSTREAM: -- Backport of
Patch1:         iniparse-fix-issue-28.patch
# PATCH-FIX-OPENSUSE: -- Variant of that uses python-six to support py2+py3, from Fedora
Patch2:         python-iniparse-python3-compat.patch
# PATCH-FIX-OPENSUSE: -- Fix to have correct information, from Fedora
Patch3:         python-iniparse-setup-fixes.patch

BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module six}
BuildRequires:  python-rpm-macros
# python2-devel contains test module, even for noarch package
BuildRequires:  python2-devel
# tests require testsuite modules
BuildRequires:  python3-testsuite
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Requires:       python-six


iniparse is an INI parser for Python which is API compatible with the
standard library's ConfigParser, preserves structure of INI files
(order of sections & options, indentation, comments, and blank lines
are preserved when data is updated), and is more convenient to use.

%setup -q -n iniparse-%{version}
%patch0 -p0
%patch1 -p1
%patch2 -p0
%patch3 -p0

chmod 644 html/index.html
sed -i "/.*test_multiprocessing.*/d" tests/ # NOTE(saschpe): Doesn't work and I'm lazy


rm -rf %{buildroot}%{_datadir}/doc/iniparse-%{version} # Remove unwanted stuff


%files %{python_files}
%doc Changelog LICENSE LICENSE-PSF README html/*