Name:           pyparsing
Version:        2.3.0
Release:        1%{?_dist_release}
Summary:        An object-oriented approach to text processing
Summary(ja):	オブジェクト指向のテキストパース用 Python モジュール

Group:          Development/Libraries
License:        MIT
URL:            https://github.com/pyparsing/pyparsing/
Source0:        https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-2.3.0.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildArch:      noarch

BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-rpm-macros
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-rpm-macros

Vendor: Project Vine
Distribution: Vine Linux

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

%package -n python-pyparsing
Summary:        An object-oriented approach to text processing
Summary(ja):	オブジェクト指向のテキストパース用 Python モジュール
Group:          Development/Libraries
Requires:       python
Provides:       pyparsing = %{version}-%{release}
Obsoletes:      pyparsing < %{version}

%description -n python-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:        An object-oriented approach to text processing
Summary(ja):	オブジェクト指向のテキストパース用 Python モジュール
Group:          Development/Libraries
Requires:       python3

%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.

%prep
%setup -qc -n pyparsing-%{version}
mv pyparsing-%{version} python2
cp -a python2 python3

pushd python2
perl -pi -e 's/\r//' LICENSE
perl -pi -e 's/\r//' CHANGES
perl -pi -e 's/\r//' README*
cp -a LICENSE CHANGES README* htmldoc examples HowToUsePyparsing.html ../
cp pyparsingClassDiagram.JPG ../pyparsingClassDiagram.jpg
cp pyparsingClassDiagram.PNG ../pyparsingClassDiagram.png
popd

%build
pushd python2
%py_build
popd
pushd python3
%py3_build
popd


%install
rm -rf $RPM_BUILD_ROOT
pushd python2
%py_install
popd
pushd python3
%py3_install
popd

%clean
rm -rf $RPM_BUILD_ROOT

%files -n python-pyparsing
%defattr(-,root,root,-)
%license LICENSE
%doc CHANGES README* htmldoc examples
%doc HowToUsePyparsing.html pyparsingClassDiagram.jpg pyparsingClassDiagram.png
%{python_sitelib}/pyparsing*egg-info
%{python_sitelib}/pyparsing.py*

%files -n python3-pyparsing
%defattr(-,root,root,-)
%license LICENSE
%doc CHANGES README* htmldoc examples
%doc HowToUsePyparsing.html pyparsingClassDiagram.jpg pyparsingClassDiagram.png
%{python3_sitelib}/pyparsing*egg-info
%{python3_sitelib}/pyparsing.py*
%{python3_sitelib}/__pycache__/pyparsing.*


%changelog
* Wed Nov 28 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.3.0-1
- new upstream release.
- changed naming-rule.
- added python3 support.

* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.5.0-4
- rebuild with VineSeed environment

* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.5.0-3
- rebuilt with python-2.7.2

* Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 1.5.0-2
- rebuilt with python-2.6.4

* Sun Dec 28 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.5.0-1
- initial build for Vine Linux based on fedora package

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.5.0-3
- Rebuild for Python 2.6

* Mon Aug  4 2008 José Matos <jamatos[AT]fc.up.pt> - 1.5.0-2
- respun (now with the right sources)

* Mon Aug  4 2008 José Matos <jamatos[AT]fc.up.pt> - 1.5.0-1
- new upstream release.

* Tue Apr  1 2008 José Matos <jamatos[AT]fc.up.pt> - 1.4.11-1
- New upstream version, add egg-info for F9+.

* Wed Aug 29 2007 José Matos <jamatos[AT]fc.up.pt> - 1.4.7-1
- New upstream version.

* Sat Apr 21 2007 José Matos <jamatos[AT]fc.up.pt> - 1.4.6-1
- New upstream version.

* Mon Dec 11 2006 José Matos <jamatos[AT]fc.up.pt> - 1.4.4-1
- New upstream version.

* Mon Sep 11 2006 José Matos <jamatos[AT]fc.up.pt> - 1.4.3-1
- New version.

* Wed Aug  3 2005 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 1.3-1
- Initial RPM release
