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.
82 Summary: Examples of ANTLR usage
83 Summary(pl): Przyk³adowe programy u¿ywaj±ce ANTLR
85 Requires: %{name} = %{epoch}:%{version}-%{release}
88 Examples of ANTLR usage.
90 %description examples -l pl
91 Przyk³adowe programy u¿ywaj±ce ANTLR.
99 cp -f /usr/share/automake/config.sub scripts
103 %{?with_dotnet:--enable-csharp} \
104 %{!?with_dotnet:--disable-csharp} \
105 %{!?with_gcj:CLASSPATH=`pwd` --with-javac=javac} \
106 %{?with_gcj:--with-javac=gcj --with-jar=fastjar}
111 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}}
115 DESTDIR=$RPM_BUILD_ROOT
117 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
118 $RPM_BUILD_ROOT%{_javadir}
119 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
120 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
121 cp -Rf examples/{cpp,csharp,java,python} \
122 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 find $RPM_BUILD_ROOT%{_examplesdir}/%{name} -name Makefile -exec rm -f {} \;
125 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
127 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
128 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
129 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
131 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
134 rm -rf $RPM_BUILD_ROOT
137 %defattr(644,root,root,755)
139 %attr(755,root,root) %{_bindir}/antlr
140 %attr(755,root,root) %{_bindir}/antlr-config
141 %{_includedir}/%{name}
142 %{_libdir}/libantlr.a
143 # Dont separate it, antlr binary wont work without it
147 %files -n dotnet-antlr
148 %defattr(644,root,root,755)
149 %{_prefix}/lib/mono/%{name}/*.dll
152 %files -n python-antlr
153 %defattr(644,root,root,755)
154 %{py_sitescriptdir}/%{name}
157 %defattr(644,root,root,755)
158 %{_examplesdir}/%{name}-%{version}