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 URL: http://www.antlr.org/
22 BuildRequires: automake
24 BuildRequires: gcc-java >= 5:4.0.0
25 BuildRequires: gcc-java-tools >= 5:4.0.0
26 Requires: /usr/bin/gij
32 %{?with_dotnet:BuildRequires: mono-csharp}
33 Conflicts: pccts < 1.33MR33-6
34 BuildRequires: sed >= 4.0
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
39 language tool that provides a framework for constructing recognizers,
40 compilers, and translators from grammatical descriptions containing
41 Java, C#, or C++ actions. ANTLR is popular because it is easy to
42 understand, powerful, flexible, generates human-readable output, and
43 comes with complete source. ANTLR provides excellent support for tree
44 construction, tree walking, and translation.
47 ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
48 PCCTS) to narzêdzie jêzykowe dostarczaj±ce szkielet do tworzenia
49 programów rozpoznaj±cych jêzyki, kompilatorów, translatorów z opisów
50 gramatycznych obejmuj±cych Javê, C# lub C++. ANTLR jest popularne
51 poniewa¿ jest ³atwe do zrozumienia, potê¿ne, elastyczne, generuje
52 wyj¶cie czytelne dla cz³owieka i jest dostêpne z pe³nymi ¼ród³ami.
53 ANTLR ma ¶wietne wsparcie dla tworzenia drzew, przechodzenia po
54 drzewach oraz translacji.
56 %package -n dotnet-antlr
57 Summary: .NET support for ANTLR
58 Summary(pl): Modu³y jêzyka .NET dla biblioteki ANTLR
61 %description -n dotnet-antlr
62 .NET support for ANTLR.
64 %description -n dotnet-antlr -l pl
65 Modu³y jêzyka .NET dla biblioteki ANTLR.
67 %package -n python-antlr
68 Summary: Python support for ANTLR
69 Summary(pl): Modu³y jêzyka Python dla biblioteki ANTLR
70 Group: Libraries/Python
71 Requires: %{name} = %{epoch}:%{version}-%{release}
72 %pyrequires_eq python-libs
74 %description -n python-antlr
75 Python support for ANTLR.
77 %description -n python-antlr -l pl
78 Modu³y jêzyka Python dla biblioteki ANTLR.
81 Summary: Examples of ANTLR usage
82 Summary(pl): Przyk³adowe programy u¿ywaj±ce ANTLR
84 Requires: %{name} = %{epoch}:%{version}-%{release}
87 Examples of ANTLR usage.
89 %description examples -l pl
90 Przyk³adowe programy u¿ywaj±ce ANTLR.
97 cp -f /usr/share/automake/config.sub scripts
101 %{?with_dotnet:--enable-csharp} \
102 %{!?with_dotnet:--disable-csharp} \
103 %{!?with_gcj:CLASSPATH=`pwd` --with-javac=javac} \
104 %{?with_gcj:--with-javac=gcj --with-jar=fastjar}
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}-%{version}}
113 DESTDIR=$RPM_BUILD_ROOT
115 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
116 $RPM_BUILD_ROOT%{_javadir}
117 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
118 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
119 cp -Rf examples/{cpp,csharp,java,python} \
120 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
121 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
123 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
125 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
126 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
127 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
129 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
132 rm -rf $RPM_BUILD_ROOT
135 %defattr(644,root,root,755)
137 %attr(755,root,root) %{_bindir}/antlr
138 %attr(755,root,root) %{_bindir}/antlr-config
139 %{_includedir}/%{name}
140 %{_libdir}/libantlr.a
141 # Dont separate it, antlr binary wont work without it
145 %files -n dotnet-antlr
146 %defattr(644,root,root,755)
147 %{_prefix}/lib/mono/%{name}/*.dll
150 %files -n python-antlr
151 %defattr(644,root,root,755)
152 %{py_sitescriptdir}/%{name}
155 %defattr(644,root,root,755)
156 %{_examplesdir}/%{name}-%{version}