File python-funcparserlib.spec of Package python-funcparserlib

#
# spec file for package python-funcparserlib
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           python-funcparserlib
Version:        0.3.6
Release:        0
Url:            http://code.google.com/p/funcparserlib/
Summary:        Recursive descent parsing library based on functional combinators
License:        MIT
Group:          Development/Languages/Python
Source:         http://pypi.python.org/packages/source/f/funcparserlib/funcparserlib-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-nose
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
Parser combinators are just higher-order functions that take parsers as
their arguments and return them as result values. Parser combinators are:

First-class values. Extremely composable. Tend to make the code quite compact.
Resemble the readable notation of xBNF grammars.

Parsers made with funcparserlib are pure-Python LL(*) parsers. It means that
it's very easy to write them without thinking about look-aheads and all that
hardcore parsing stuff. But the recursive descent parsing is a rather slow
method compared to LL(k) or LR(k) algorithms.

So the primary domain for funcparserlib is parsing little languages or external
DSLs (domain specific languages).

The library itself is very small. Its source code is only 0.5 KLOC, with lots
of comments included. It features the longest parsed prefix error reporting,
as well as a tiny lexer generator for token position tracking.

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

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%check
# Python 2.6.0 has broken exceptions for tests
%if %(python -c 'import sys; print int(sys.version.startswith("2.6 "))') == 0
nosetests
%endif

%files
%defattr(-,root,root,-)
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by