Name:            pyparsing
Version:         2.2.0
Release:         4
Summary:         A Python Parsing Module
License:         MIT
URL:             https://github.com/pyparsing/pyparsing/
Source0:         http://downloads.sourceforge.net/pyparsing/pyparsing-%{version}.tar.gz

BuildArch:       noarch
BuildRequires:   dos2unix python2-devel python2-setuptools python3-devel python3-setuptools
BuildRequires:   python2-pip python2-wheel python%{python3_pkgversion}-pip python%{python3_pkgversion}-wheel

%description
The pyparsing module is an alternative approach to creating and executing simple
grammars, vs. the traditional lex/yacc approach, or the use of regular expressions.
The pyparsing module provides a library of classes that client code uses to
construct the grammar directly in Python code.

%package      -n python2-pyparsing
Summary:         Pyparsing for python2
%{?python_provide:%python_provide python2-pyparsing}
Provides:        pyparsing = %{version}-%{release}
Obsoletes:       pyparsing < 2.1.10-5

%description  -n python2-pyparsing
pyparsing is a module that can be used to easily and directly configure syntax
definitions for any number of text parsing applications.

%package      -n python3-pyparsing
Summary:         Pyparsing for python3
%{?python_provide:%python_provide python3-%pyparsing}

%description  -n python3-pyparsing
pyparsing is a module that can be used to easily and directly configure syntax
definitions for any number of text parsing applications.

%package         help
Summary:         Documents for %{name}
Buildarch:       noarch
Requires:		 man info
Provides:        pyparsing-doc
Obsoletes:       pyparsing-doc

%description     help
Man pages and other related documents for %{name}.

%prep
%autosetup -n %{name}-%{version}
mv docs/pyparsingClassDiagram.PNG docs/pyparsingClassDiagram.png

dos2unix -k CHANGES LICENSE README

%build
%py2_build_wheel
%py3_build_wheel

%install
%py2_install_wheel pyparsing-%{version}-py2.py3-none-any.whl
%py3_install_wheel pyparsing-%{version}-py2.py3-none-any.whl

%pre

%preun

%post

%postun

%files -n python2-pyparsing
%defattr(-,root,root)
%license LICENSE
%doc CHANGES README
%exclude /docs/pyparsingClassDiagram.JPG
%{python2_sitelib}/pyparsing.py*
%{python2_sitelib}/pyparsing-*dist-info/

%files -n python3-pyparsing
%license LICENSE
%doc CHANGES README
%exclude /docs/pyparsingClassDiagram.JPG
%{python3_sitelib}/pyparsing.py
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/pyparsing-*dist-info/

%files help
%doc CHANGES README HowToUsePyparsing.html docs examples htmldoc

%changelog
* Fri Sep 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.2.0-4
- Package init
