New version

This commit is contained in:
Fabio Alessandro Locati 2016-01-06 18:37:48 +01:00
parent 7bef8cf975
commit 69725a4f13

View File

@ -1,36 +1,43 @@
%if !(0%{?rhel} >= 6 || 0%{?fedora} >= 13) %if 0%{?rhel}
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global with_python3 0
%endif %{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%if 0%{?fedora} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
%else
%global with_python3 1 %global with_python3 1
%endif %endif
Name: python-configobj %global pypi_name configobj
Version: 5.0.5
Release: 4%{?dist} Name: python-%{pypi_name}
Version: 5.0.6
Release: 1%{?dist}
Summary: Config file reading, writing, and validation Summary: Config file reading, writing, and validation
Group: System Environment/Libraries Group: System Environment/Libraries
License: BSD License: BSD
URL: http://configobj.readthedocs.org/ URL: http://configobj.readthedocs.org/
Source0: https://pypi.python.org/packages/source/c/configobj/configobj-%{version}.tar.gz Source0: https://pypi.python.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/DiffSK/configobj/master/LICENSE
# to get tests # to get tests
# git clone https://github.com/DiffSK/configobj.git && cd configobj # git clone https://github.com/DiffSK/configobj.git && cd configobj
# git checkout v5.0.5 # git checkout v5.0.5
# tar -czf configobj-5.0.5-tests.tar.gz tests/ test_configobj.py # tar -czf configobj-5.0.5-tests.tar.gz tests/ test_configobj.py
Source1: configobj-%{version}-tests.tar.gz #Source1: configobj-%{version}-tests.tar.gz
# Generated from source code on 2014-07-31
Source2: configobj-bsd-license.txt
Patch0: configobj-import-all-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
%if 0%{?el5}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%endif
BuildRequires: python-devel BuildRequires: python2-devel
BuildRequires: python-six BuildRequires: python-setuptools
BuildRequires: pytest %if 0%{?with_python3}
BuildRequires: python3-devel
Requires: python-six BuildRequires: python3-setuptools
%endif # with_python3
#BuildRequires: python3-pytest
%description %description
ConfigObj is a simple but powerful config file reader and writer: an ini file ConfigObj is a simple but powerful config file reader and writer: an ini file
@ -51,16 +58,36 @@ It has lots of other features though:
* Full Unicode support * Full Unicode support
* A powerful unrepr mode for storing basic datatypes * A powerful unrepr mode for storing basic datatypes
%package -n python2-%{pypi_name}
Summary: Config file reading, writing and validation
%{?python_provide:%python_provide python2-%{pypi_name}}
Requires: python-six
%description -n python2-%{pypi_name}
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
* String interpolation (substitution)
* Integrated with a powerful validation system
o including automatic type checking/conversion
o repeated sections
o and allowing default values
* All comments in the file are preserved
* The order of keys/sections is preserved
* No external dependencies
* Full Unicode support
* A powerful unrepr mode for storing basic datatypes
%if 0%{?with_python3} %if 0%{?with_python3}
%package -n python3-configobj %package -n python3-configobj
Summary: Config file reading, writing, and validation for Python 3 Summary: Config file reading, writing, and validation for Python 3
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: python3-pytest
Requires: python3-six Requires: python3-six
%description -n python3-configobj %description -n python3-configobj
ConfigObj is a simple but powerful config file reader and writer: an ini file 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 round tripper. Its main feature is that it is very easy to use, with a
@ -79,16 +106,12 @@ It has lots of other features though:
* No external dependencies * No external dependencies
* Full Unicode support * Full Unicode support
* A powerful unrepr mode for storing basic datatypes * A powerful unrepr mode for storing basic datatypes
This package ships Python 3 build of configobj.
%endif %endif
%prep %prep
%setup -q -n configobj-%{version} %setup -q -n %{pypi_name}-%{version}
%patch0 -p1 -b .all cp %{SOURCE1} .
cp %{SOURCE2} .
%if 0%{?with_python3} %if 0%{?with_python3}
rm -rf %{py3dir} rm -rf %{py3dir}
@ -114,21 +137,21 @@ pushd %{py3dir}
popd popd
%endif %endif
%check #%check
# this needs to be set for tests.test_configobj.test_options_deprecation # this needs to be set for tests.test_configobj.test_options_deprecation
export PYTHONWARNINGS=always #export PYTHONWARNINGS=always
#
tar -xzf %{SOURCE1} #tar -xzf %{SOURCE1}
%{__python} test_configobj.py #%{__python} test_configobj.py
py.test tests #py.test tests
#
%if 0%{?with_python3} #%if 0%{?with_python3}
pushd %{py3dir} #pushd %{py3dir}
tar -xzf %{SOURCE1} #tar -xzf %{SOURCE1}
%{__python3} test_configobj.py #%{__python3} test_configobj.py
py.test-%{python3_version} tests #py.test-%{python3_version} tests
popd #popd
%endif #%endif
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -138,19 +161,21 @@ rm -rf $RPM_BUILD_ROOT
# https://github.com/DiffSK/configobj/issues/63 # https://github.com/DiffSK/configobj/issues/63
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc} %{!?_licensedir:%global license %%doc}
%license configobj-bsd-license.txt %license LICENSE
%{python_sitelib}/* %{python_sitelib}/*
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python3-configobj %files -n python3-configobj
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc} %license LICENSE
%license configobj-bsd-license.txt
%{python3_sitelib}/* %{python3_sitelib}/*
%endif %endif
%changelog %changelog
* Wed Jan 06 2016 Fabio Alessandro Locati <fabio@locati.cc> - 5.0.6-1
- Align to current upstream
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.5-4 * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5