3 # * package the Emacs and Jedit modes
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: 17d8bf2e814f0a26631aadbbda8d7324
20 Patch0: %{name}-DESTDIR.patch
21 Patch1: %{name}-csharp.patch
22 Patch2: %{name}-utils.patch
23 URL: http://www.antlr.org/
24 BuildRequires: autoconf
25 BuildRequires: automake
26 BuildRequires: libstdc++-devel
27 %{?with_dotnet:BuildRequires: mono-csharp}
29 BuildRequires: sed >= 4.0
31 BuildRequires: gcc-java >= 5:4.0.0
32 BuildRequires: gcc-java-tools >= 5:4.0.0
33 Requires: /usr/bin/gij
39 Conflicts: pccts < 1.33MR33-6
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
44 language tool that provides a framework for constructing recognizers,
45 compilers, and translators from grammatical descriptions containing
46 Java, C#, or C++ actions. ANTLR is popular because it is easy to
47 understand, powerful, flexible, generates human-readable output, and
48 comes with complete source. ANTLR provides excellent support for tree
49 construction, tree walking, and translation.
52 ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
53 PCCTS) to narzêdzie jêzykowe dostarczaj±ce szkielet do tworzenia
54 programów rozpoznaj±cych jêzyki, kompilatorów, translatorów z opisów
55 gramatycznych obejmuj±cych Javê, C# lub C++. ANTLR jest popularne
56 poniewa¿ jest ³atwe do zrozumienia, potê¿ne, elastyczne, generuje
57 wyj¶cie czytelne dla cz³owieka i jest dostêpne z pe³nymi ¼ród³ami.
58 ANTLR ma ¶wietne wsparcie dla tworzenia drzew, przechodzenia po
59 drzewach oraz translacji.
61 %package -n dotnet-antlr
62 Summary: .NET support for ANTLR
63 Summary(pl): Modu³y jêzyka .NET dla biblioteki ANTLR
66 %description -n dotnet-antlr
67 .NET support for ANTLR.
69 %description -n dotnet-antlr -l pl
70 Modu³y jêzyka .NET dla biblioteki ANTLR.
72 %package -n python-antlr
73 Summary: Python runtime support for ANTLR-generated parsers
74 Summary(pl): Modu³ uruchomieniowy jêzyka Python dla analizatorów ANTLR
75 Group: Libraries/Python
76 %pyrequires_eq python-libs
78 %description -n python-antlr
79 Python runtime support for ANTLR-generated parsers.
81 %description -n python-antlr -l pl
82 Modu³ uruchomieniowy jêzyka Python dla analizatorów wygenerowanych
86 Summary: Examples of ANTLR usage
87 Summary(pl): Przyk³adowe programy u¿ywaj±ce ANTLR
89 Requires: %{name} = %{epoch}:%{version}-%{release}
92 Examples of ANTLR usage.
94 %description examples -l pl
95 Przyk³adowe programy u¿ywaj±ce ANTLR.
104 cp -f /usr/share/automake/config.sub scripts
108 %{?with_dotnet:--enable-csharp} \
109 %{!?with_dotnet:--disable-csharp} \
110 %{!?with_gcj:CLASSPATH=`pwd` --with-java=java --with-javac=javac --with-jar=jar} \
111 %{?with_gcj:--with-java=gij --with-javac=gcj --with-jar=fastjar}
116 rm -rf $RPM_BUILD_ROOT
117 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}-%{version}}
120 DESTDIR=$RPM_BUILD_ROOT
122 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
123 $RPM_BUILD_ROOT%{_javadir}
124 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
125 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
126 cp -Rf examples/{cpp,csharp,java,python} \
127 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
130 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
132 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
133 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
134 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
136 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
139 rm -rf $RPM_BUILD_ROOT
142 %defattr(644,root,root,755)
144 %attr(755,root,root) %{_bindir}/antlr
145 %attr(755,root,root) %{_bindir}/antlr-config
146 %{_includedir}/%{name}
147 %{_libdir}/libantlr.a
148 # Dont separate it, antlr binary wont work without it
152 %files -n dotnet-antlr
153 %defattr(644,root,root,755)
154 %dir %{_prefix}/lib/mono/%{name}
155 %{_prefix}/lib/mono/%{name}/*.dll
158 %files -n python-antlr
159 %defattr(644,root,root,755)
160 %{py_sitescriptdir}/%{name}
163 %defattr(644,root,root,755)
164 %{_examplesdir}/%{name}-%{version}