2 # * fix gcj build/runtime
4 # * package the Emacs and Jedit modes
7 %bcond_with gcj # use GCJ instead of javac
8 %bcond_without dotnet # don't build .NET modules
10 %{?with_dotnet:%include /usr/lib/rpm/macros.mono}
12 Summary: ANother Tool for Language Recognition
13 Summary(pl): Jeszcze jedno narzêdzie do rozpoznawania jêzyka
17 License: Public Domain
18 Group: Development/Tools
19 Source0: http://www.antlr.org/download/%{name}-%{version}.tar.gz
20 # Source0-md5: 17d8bf2e814f0a26631aadbbda8d7324
21 Patch0: %{name}-DESTDIR.patch
22 Patch1: %{name}-csharp.patch
23 Patch2: %{name}-utils.patch
24 URL: http://www.antlr.org/
25 BuildRequires: autoconf
26 BuildRequires: automake
27 BuildRequires: libstdc++-devel
28 %{?with_dotnet:BuildRequires: mono-csharp}
30 BuildRequires: sed >= 4.0
32 BuildRequires: gcc-java >= 5:4.0.0
33 BuildRequires: gcc-java-tools >= 5:4.0.0
34 Requires: /usr/bin/gij
40 Conflicts: pccts < 1.33MR33-6
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
45 language tool that provides a framework for constructing recognizers,
46 compilers, and translators from grammatical descriptions containing
47 Java, C#, or C++ actions. ANTLR is popular because it is easy to
48 understand, powerful, flexible, generates human-readable output, and
49 comes with complete source. ANTLR provides excellent support for tree
50 construction, tree walking, and translation.
53 ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
54 PCCTS) to narzêdzie jêzykowe dostarczaj±ce szkielet do tworzenia
55 programów rozpoznaj±cych jêzyki, kompilatorów, translatorów z opisów
56 gramatycznych obejmuj±cych Javê, C# lub C++. ANTLR jest popularne
57 poniewa¿ jest ³atwe do zrozumienia, potê¿ne, elastyczne, generuje
58 wyj¶cie czytelne dla cz³owieka i jest dostêpne z pe³nymi ¼ród³ami.
59 ANTLR ma ¶wietne wsparcie dla tworzenia drzew, przechodzenia po
60 drzewach oraz translacji.
62 %package -n dotnet-antlr
63 Summary: .NET support for ANTLR
64 Summary(pl): Modu³y jêzyka .NET dla biblioteki ANTLR
67 %description -n dotnet-antlr
68 .NET support for ANTLR.
70 %description -n dotnet-antlr -l pl
71 Modu³y jêzyka .NET dla biblioteki ANTLR.
73 %package -n python-antlr
74 Summary: Python runtime support for ANTLR-generated parsers
75 Summary(pl): Modu³ uruchomieniowy jêzyka Python dla analizatorów ANTLR
76 Group: Libraries/Python
77 %pyrequires_eq python-libs
79 %description -n python-antlr
80 Python runtime support for ANTLR-generated parsers.
82 %description -n python-antlr -l pl
83 Modu³ uruchomieniowy jêzyka Python dla analizatorów wygenerowanych
87 Summary: Examples of ANTLR usage
88 Summary(pl): Przyk³adowe programy u¿ywaj±ce ANTLR
90 Requires: %{name} = %{epoch}:%{version}-%{release}
93 Examples of ANTLR usage.
95 %description examples -l pl
96 Przyk³adowe programy u¿ywaj±ce ANTLR.
105 cp -f /usr/share/automake/config.sub scripts
109 %{?with_dotnet:--enable-csharp} \
110 %{!?with_dotnet:--disable-csharp} \
111 %{!?with_gcj:CLASSPATH=`pwd` --with-java=java --with-javac=javac --with-jar=jar} \
112 %{?with_gcj:--with-java=gij --with-javac=gcj --with-jar=fastjar}
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}-%{version}}
121 DESTDIR=$RPM_BUILD_ROOT
123 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
124 $RPM_BUILD_ROOT%{_javadir}
125 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
126 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
127 cp -Rf examples/{cpp,csharp,java,python} \
128 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
131 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
133 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
134 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
135 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
137 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
140 rm -rf $RPM_BUILD_ROOT
143 %defattr(644,root,root,755)
145 %attr(755,root,root) %{_bindir}/antlr
146 %attr(755,root,root) %{_bindir}/antlr-config
147 %{_includedir}/%{name}
148 %{_libdir}/libantlr.a
149 # Dont separate it, antlr binary wont work without it
153 %files -n dotnet-antlr
154 %defattr(644,root,root,755)
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}