%define name python3-configobj %define srcname configobj %define version 5.0.6 %define release 1 %{!?dotests: %define dotests 1} %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /opt/freeware/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: Config file reading, writing and validation. Name: %{name} Version: %{version} Release: %{release} Source: https://github.com/DiffSK/configobj/archive/v5.0.6.tar.gz License: BSD-3-Clause Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Michael Foord & Nicola Larosa Url: http://www.voidspace.org.uk/python/configobj.html BuildRequires: python3 >= 3.7.4, python3-six >= 1.13.0, python3-pytest >= 5.3.1 BuildRequires: python3-devel >= 3.7.4 Requires: python3 >= 3.7.4, python3-six >= 1.13.0 %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 | Release 4.7.2 fixes several bugs in 4.7.1 | Release 4.7.1 fixes a bug with the deprecated options keyword in | 4.7.0. | Release 4.7.0 improves performance adds features for validation and | fixes some bugs. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %check #this needs to be set for tests.test_configobj.test_options_deprecation #export PYTHONWARNINGS=always #tar -xzf %{SOURCE} #python3 test_configobj.py #py.test-3.7.4 --verbose tests export PYTHONPATH="${RPM_BUILD_ROOT}/%{python_sitelib}" if [ "%{dotests}" == 1 ] then (python3 -m unittest functionaltests.test_configobj functionaltests.test_validate_errors || true) fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc docs/*.html docs/*.css docs/*.rst %{python_sitelib}/* %changelog * Mon Jan 20 2020 Ashwini Chandrappa - 5.0.6-1 - Build with python3 and updated to version 5.0.6 * Thu May 12 2016 Ravi Hirekurabar - 5.0.5-1 - Update to version 5.0.5 * Thu Jul 16 2013 Tristan Delhalle - 1.1.3-1 - first version for AIX V6.1 and higher