diff --git a/.cvsignore b/.cvsignore index e69de29..9094dc5 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +antlr-3.0.1.tar.gz diff --git a/antlr-clean-generated b/antlr-clean-generated new file mode 100644 index 0000000..e8fbcca --- /dev/null +++ b/antlr-clean-generated @@ -0,0 +1,23 @@ +#!/usr/bin/python +# Clean out files which look to have been generated by antlr +# Author: Colin Walters +# This file is hereby placed into the public domain. + +import os,sys,re + +_antlr_compiled_re = re.compile(r'// \$ANTLR.*:.*->.*\$$') + +def clean_antlr_generated(basedir): + for (dpath,subdirs,fnames) in os.walk(basedir): + for fname in fnames: + fpath = os.path.join(dpath, fname) + f = open(fpath) + first = f.readline() + f.close() + if _antlr_compiled_re.match(first): + print "Deleting antlr-compiled %s" % (fpath,) + os.unlink(fpath) + +if __name__ == '__main__': + basedir = sys.argv[1] + clean_antlr_generated(basedir) diff --git a/antlr3.spec b/antlr3.spec new file mode 100644 index 0000000..65e92b8 --- /dev/null +++ b/antlr3.spec @@ -0,0 +1,54 @@ +Summary: ANother Tool for Language Recognition +Name: antlr3 +Version: 3.0.1 +Release: 2%{?dist} +URL: http://www.antlr.org/ +Source0: http://www.antlr.org/download/antlr-3.0.1.tar.gz +# Utility file, in conversation with upstream about this +Source1: antlr-clean-generated +License: BSD +Group: Development/Libraries +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: java-devel >= 1:1.6.0 +# For cleaner script +BuildRequires: python +BuildRequires: ant, stringtemplate, ant-antlr, ant-junit +BuildRequires: jpackage-utils +Requires: jpackage-utils + +%description +ANother Tool for Language Recognition, is a language tool +that provides a framework for constructing recognizers, +interpreters, compilers, and translators from grammatical +descriptions containing actions in a variety of target languages. + +%prep +%setup -q -n antlr-%{version} + +%build +rm -f lib/*.jar +build-jar-repository -s -p lib stringtemplate +# Clean out generated files upstream includes +python %{SOURCE1} . +# Build +ant + +%install +rm -rf $RPM_BUILD_ROOT +install -D build/antlr.jar $RPM_BUILD_ROOT%{_datadir}/java/antlr3.jar + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc README.txt LICENSE.txt +%{_datadir}/java/*.jar + +%changelog +* Fri Jun 27 2008 Colin Walters - 3.0.1-2 +- Fix some BRs + +* Sun Apr 06 2008 Colin Walters - 3.0.1-1 +- First version diff --git a/import.log b/import.log new file mode 100644 index 0000000..cd1d6d5 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +antlr3-3_0_1-2_fc9:HEAD:antlr3-3.0.1-2.fc9.src.rpm:1214934104 diff --git a/sources b/sources index e69de29..0a0d063 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +3368332e3ecec632db667cb5cdfdbf6f antlr-3.0.1.tar.gz