3 # * add an axamples subpackage (and python-examples as well)
6 %bcond_without gcj # use javac instead of GCJ
7 %bcond_without dotnet # don't build .NET modules
9 %{?with_dotnet:%include /usr/lib/rpm/macros.mono}
11 Summary: ANother Tool for Language Recognition
12 Summary(pl): Jeszcze jedno narzêdzie do rozpoznawania jêzyka
16 License: Public Domain
17 Group: Development/Tools
18 Source0: http://www.antlr.org/download/%{name}-%{version}.tar.gz
19 # Source0-md5: 1ef201f29283179c8e5ab618529cac78
20 Patch0: %{name}-DESTDIR.patch
21 Patch1: %{name}-remove-ugly-gcj-hack.patch
22 URL: http://www.antlr.org/
23 BuildRequires: automake
25 BuildRequires: gcc-java >= 5:4.0.0
26 BuildRequires: gcc-java-tools >= 5:4.0.0
27 Requires: /usr/bin/gij
33 %{?with_dotnet:BuildRequires: mono-csharp}
34 Conflicts: pccts < 1.33MR33-6
35 BuildRequires: sed >= 4.0
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
40 language tool that provides a framework for constructing recognizers,
41 compilers, and translators from grammatical descriptions containing
42 Java, C#, or C++ actions. ANTLR is popular because it is easy to
43 understand, powerful, flexible, generates human-readable output, and
44 comes with complete source. ANTLR provides excellent support for tree
45 construction, tree walking, and translation.
48 ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
49 PCCTS) to narzêdzie jêzykowe dostarczaj±ce szkielet do tworzenia
50 programów rozpoznaj±cych jêzyki, kompilatorów, translatorów z opisów
51 gramatycznych obejmuj±cych Javê, C# lub C++. ANTLR jest popularne
52 poniewa¿ jest ³atwe do zrozumienia, potê¿ne, elastyczne, generuje
53 wyj¶cie czytelne dla cz³owieka i jest dostêpne z pe³nymi ¼ród³ami.
54 ANTLR ma ¶wietne wsparcie dla tworzenia drzew, przechodzenia po
55 drzewach oraz translacji.
57 %package -n dotnet-antlr
58 Summary: .NET support for ANTLR
59 Summary(pl): Modu³y jêzyka .NET dla biblioteki ANTLR
62 %description -n dotnet-antlr
63 .NET support for ANTLR.
65 %description -n dotnet-antlr -l pl
66 Modu³y jêzyka .NET dla biblioteki ANTLR.
68 %package -n python-antlr
69 Summary: Python support for ANTLR
70 Summary(pl): Modu³y jêzyka Python dla biblioteki ANTLR
71 Group: Libraries/Python
72 Requires: %{name} = %{epoch}:%{version}-%{release}
73 %pyrequires_eq python-libs
75 %description -n python-antlr
76 Python support for ANTLR.
78 %description -n python-antlr -l pl
79 Modu³y jêzyka Python dla biblioteki ANTLR.
87 cp -f /usr/share/automake/config.sub scripts
91 %{?with_dotnet:--enable-csharp} \
92 %{!?with_gcj:CLASSPATH=`pwd` --with-javac=javac} \
93 %{?with_gcj:--with-javac=gcj --with-jar=fastjar}
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name}}
102 DESTDIR=$RPM_BUILD_ROOT
104 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
105 $RPM_BUILD_ROOT%{_javadir}
106 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
107 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
109 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
111 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
112 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
113 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
115 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
118 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
123 %attr(755,root,root) %{_bindir}/antlr
124 %attr(755,root,root) %{_bindir}/antlr-config
125 %{_includedir}/%{name}
126 %{_libdir}/libantlr.a
127 # Dont separate it, antlr binary wont work without it
131 %files -n dotnet-antlr
132 %defattr(644,root,root,755)
133 %{_prefix}/lib/mono/%{name}/*.dll
136 %files -n python-antlr
137 %defattr(644,root,root,755)
138 %{py_sitescriptdir}/%{name}