Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define srcname TPG

Name:           python-tpg
Version:        3.0.6
Release:        1%{?dist}

Summary:        A Python "toy parser generator"
Group:          Development/Libraries
License:        LGPL
URL:            http://christophe.delord.free.fr/en/tpg/
Source0:        http://christophe.delord.free.fr/soft/tpg/TPG-3.0.6.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python-devel
Requires:   python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")

%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 usefull 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
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc README doc THANKS ChangeLog License.txt
%{_bindir}/tpg
%{python_sitelib}/tpg.py
%{python_sitelib}/tpg.pyc
%ghost %{python_sitelib}/tpg.pyo

%changelog
* 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

* Fri Apr  7 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