Bart Vanbrabant 4eb01e7
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Bart Vanbrabant 4eb01e7
01ce193
Summary: ANother Tool for Language Recognition
01ce193
Name: antlr3
Bart Vanbrabant 4eb01e7
Version: 3.1.1
d9064a6
Release: 4%{?dist}
01ce193
URL: http://www.antlr.org/
Bart Vanbrabant 4eb01e7
Source0: http://www.antlr.org/download/antlr-3.1.1.tar.gz
01ce193
# Utility file, in conversation with upstream about this
01ce193
Source1: antlr-clean-generated
985290b
Source2: antlr3
01ce193
License: BSD
01ce193
Group: Development/Libraries
01ce193
BuildArch: noarch
01ce193
BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
01ce193
BuildRequires: java-devel >= 1:1.6.0
01ce193
# For cleaner script
01ce193
BuildRequires: python
01ce193
BuildRequires: ant, stringtemplate, ant-antlr, ant-junit
d9064a6
# The build.xml uses this to version the jar
d9064a6
BuildRequires: bcel
01ce193
BuildRequires: jpackage-utils
01ce193
Requires: jpackage-utils
985290b
Requires: antlr
985290b
Requires: stringtemplate
01ce193
01ce193
%description
01ce193
ANother Tool for Language Recognition, is a language tool
01ce193
that provides a framework for constructing recognizers,
01ce193
interpreters, compilers, and translators from grammatical 
01ce193
descriptions containing actions in a variety of target languages.
01ce193
Bart Vanbrabant 4eb01e7
%package        python
Bart Vanbrabant 4eb01e7
Group:          Development/Libraries
Bart Vanbrabant 4eb01e7
Summary:        Python runtime support for ANTLR-generated parsers
Bart Vanbrabant 4eb01e7
BuildRequires:  python-devel
Bart Vanbrabant 4eb01e7
BuildRequires:  python-setuptools-devel
Bart Vanbrabant 4eb01e7
BuildArch:      noarch
Bart Vanbrabant 4eb01e7
Bart Vanbrabant 4eb01e7
%description    python
Bart Vanbrabant 4eb01e7
Python runtime support for ANTLR-generated parsers
Bart Vanbrabant 4eb01e7
01ce193
%prep
01ce193
%setup -q -n antlr-%{version}
01ce193
01ce193
%build
01ce193
rm -f lib/*.jar
01ce193
build-jar-repository -s -p lib stringtemplate
01ce193
# Clean out generated files upstream includes
Bart Vanbrabant 4eb01e7
%{__python} %{SOURCE1} .
01ce193
# Build
01ce193
ant
01ce193
Bart Vanbrabant 4eb01e7
# Build the python runtime
Bart Vanbrabant 4eb01e7
cd runtime/Python
Bart Vanbrabant 4eb01e7
%{__python} setup.py build
Bart Vanbrabant 4eb01e7
cd ../..
Bart Vanbrabant 4eb01e7
01ce193
%install
01ce193
rm -rf $RPM_BUILD_ROOT
985290b
install -D build/antlr-3.1.1.jar $RPM_BUILD_ROOT%{_datadir}/java/antlr3.jar
985290b
install -D -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr3
Bart Vanbrabant 4eb01e7
Bart Vanbrabant 4eb01e7
cd runtime/Python
Bart Vanbrabant 4eb01e7
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
Bart Vanbrabant 4eb01e7
cd ../..
01ce193
01ce193
%clean
01ce193
rm -rf $RPM_BUILD_ROOT
01ce193
01ce193
%files
01ce193
%defattr(-,root,root)
01ce193
%doc README.txt LICENSE.txt
01ce193
%{_datadir}/java/*.jar
985290b
%{_bindir}/antlr3
01ce193
Bart Vanbrabant 4eb01e7
%files python
Bart Vanbrabant 4eb01e7
%defattr(0644,root,root,0755)
Bart Vanbrabant 4eb01e7
%{python_sitelib}/antlr3/*
Bart Vanbrabant 4eb01e7
%{python_sitelib}/antlr_python_runtime-*
Bart Vanbrabant 4eb01e7
01ce193
%changelog
d9064a6
* Mon Jan 12 2009 Colin Walters <walters@redhat.com> - 3.1.1-4
d9064a6
- Add bcel build dep to version jar name
d9064a6
985290b
* Mon Nov 10 2008 Colin Walters <walters@redhat.com> - 3.1.1-3
985290b
- Add antlr3 script
985290b
Bart Vanbrabant e125125
* Mon Nov  6 2008 Bart Vanbrabant <bart.vanbrabant@zoeloelip.be> - 3.1.1-2
Bart Vanbrabant e125125
- Fix the install of the jar (remove the version)
Bart Vanbrabant e125125
Bart Vanbrabant 4eb01e7
* Mon Nov  3 2008 Bart Vanbrabant <bart.vanbrabant@zoeloelip.be> - 3.1.1-1
Bart Vanbrabant 4eb01e7
- Update to version 3.1.1
Bart Vanbrabant 4eb01e7
- Add python runtime subpackage
Bart Vanbrabant 4eb01e7
01ce193
* Fri Jun 27 2008 Colin Walters <walters@redhat.com> - 3.0.1-2
01ce193
- Fix some BRs
01ce193
01ce193
* Sun Apr 06 2008 Colin Walters <walters@redhat.com> - 3.0.1-1
01ce193
- First version