Blob Blame Raw
%global srcname TPG
%global modname tpg
%global sum A Python "toy parser generator"

Name:           python-%{modname}
Version:        3.2.2
Release:        8%{?dist}

Summary:        %{sum}
License:        LGPLv2+
URL:            http://christophe.delord.free.fr/%{modname}/index.html
Source0:        http://cdsoft.fr/%{modname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python3-devel

%description
Toy Parser Generator is a lexical and syntactic parser generator
for Python. This generator was born from a simple statement: YACC
is to complex to use in simple cases (calculators, configuration
files, small programming languages, ...).

TPG can very simply write parsers that are useful for most every
day needs (even if it can't make your coffee). With a very clear
and simple syntax, you can write an attributed grammar that is
translated into a recursive descendant parser. TPG generated code
is very closed to the original grammar. This means that the parser
works "like" the grammar. A grammar rule can be seen as a method
of the parser class, symbols as method calls, attributes as method
parameters and semantic values as return values. You can also add
Python code directly into grammar rules and build abstract syntax
trees while parsing.


%package -n python2-%{modname}
Summary:  %{sum}
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{modname}
Toy Parser Generator is a lexical and syntactic parser generator
for Python2. This generator was born from a simple statement: YACC
is to complex to use in simple cases (calculators, configuration
files, small programming languages, ...).

TPG can very simply write parsers that are useful for most every
day needs (even if it can't make your coffee). With a very clear
and simple syntax, you can write an attributed grammar that is
translated into a recursive descendant parser. TPG generated code
is very closed to the original grammar. This means that the parser
works "like" the grammar. A grammar rule can be seen as a method
of the parser class, symbols as method calls, attributes as method
parameters and semantic values as return values. You can also add
Python code directly into grammar rules and build abstract syntax
trees while parsing.


%package -n python3-%{modname}
Summary:  %{sum}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{modname}
Toy Parser Generator is a lexical and syntactic parser generator
for Python3. This generator was born from a simple statement: YACC
is to complex to use in simple cases (calculators, configuration
files, small programming languages, ...).

TPG can very simply write parsers that are useful for most every
day needs (even if it can't make your coffee). With a very clear
and simple syntax, you can write an attributed grammar that is
translated into a recursive descendant parser. TPG generated code
is very closed to the original grammar. This means that the parser
works "like" the grammar. A grammar rule can be seen as a method
of the parser class, symbols as method calls, attributes as method
parameters and semantic values as return values. You can also add
Python code directly into grammar rules and build abstract syntax
trees while parsing.


%prep
%setup -q -n %{srcname}-%{version}


%build
%py2_build
%py3_build


%install
rm -rf $RPM_BUILD_ROOT

%py3_install
mv %{buildroot}%{_bindir}/%{modname} %{buildroot}%{_bindir}/%{modname}-%{python3_version}

%py2_install
mv %{buildroot}%{_bindir}/%{modname} %{buildroot}%{_bindir}/%{modname}-%{python2_version}

# Make symlinks to moved executables
ln -s ./%{modname}-%{python2_version} %{buildroot}%{_bindir}/%{modname}-2
ln -s ./%{modname}-%{python3_version} %{buildroot}%{_bindir}/%{modname}-3
ln -s ./%{modname}-2 %{buildroot}%{_bindir}/%{modname}


%files -n python2-%{modname}
%doc README doc THANKS ChangeLog
%license License.txt
%{_bindir}/%{modname}
%{_bindir}/%{modname}-2
%{_bindir}/%{modname}-%{python2_version}
%{python2_sitelib}/%{modname}.py
%{python2_sitelib}/%{modname}.pyc
%{python2_sitelib}/%{modname}.pyo
%{python2_sitelib}/%{srcname}-%{version}-py*.egg-info


%files -n python3-%{modname}
%doc README doc THANKS ChangeLog
%license License.txt
%{_bindir}/%{modname}-3
%{_bindir}/%{modname}-%{python3_version}
%{python3_sitelib}/%{modname}.py
%{python3_sitelib}/__pycache__/%{modname}.*
%{python3_sitelib}/%{srcname}-%{version}-py*.egg-info


%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.2.2-6
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.2.2-2
- Rebuild for Python 3.6

* Wed Jul 27 2016 Lumir Balhar <lbalhar@redhat.com> - 3.2.2-1
- Update to 3.2.2
- Add Python3

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-16
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 3.1.2-7
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Mon Aug 10 2009 Adam Miller <maxamillion [AT] gmail.com> - 3.1.2-6
- Fixed source0 as per https://www.redhat.com/archives/fedora-devel-list/2009-August/msg00591.html

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

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

* Wed Sep 03 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 3.1.2-2
- drop ancient API Requires

* Wed Sep 03 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 3.1.2-1
- fix license tag
- update to 3.1.2

* Sat Dec 23 2006 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.1.0-4
- Rebuild with Python 2.5

* Sat Sep 16 2006 Shahms E. King <shahms@shahms.com> 3.1.0-3
- rebuild for FC6

* Fri Aug 11 2006 Shahms E. King <shahms@shahms.com> 3.1.0-2
- Include, don't ghost .pyo files per new guidelines

* Tue Aug 08 2006 Shahms E. King <shahms@shahms.com> 3.1.0-1
- update to upstream 3.1.0

* Mon Feb 13 2006 Shahms E. King <shahms@shahms.com> 3.0.6-2
- rebuild for FC5

* Mon Jan 30 2006 Shahms E. King <shahms@shahms.com> 3.0.6-1
- update to upstream 3.0.6

* Thu May 12 2005 Shahms E. King <shahms@shahms.com> 3.0.5-4
- rebuilt, add dist tag

* Thu Apr 07 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Mon Mar 21 2005 Shahms E. King <shahms@shahms.com> 3.0.5-2 -
- Remove unsued python_sitearch define

* Tue Mar 01 2005 Shahms E. King <shahms@shahms.com> 3.0.5-1 -
- Update to 3.0.5
- Clean up spec file