3 # - package the Emacs and Jedit modes
6 # - next version is packaged as antlr3.spec. Please, do not upgrade this spec
10 %bcond_without gcj # use javac instead of GCJ
11 %bcond_without dotnet # don't build .NET modules
12 %bcond_without java # don't build Java at all
14 %{?with_dotnet:%include /usr/lib/rpm/macros.mono}
16 %ifarch i586 i686 athlon %{x8664}
20 Summary: ANother Tool for Language Recognition
21 Summary(pl.UTF-8): Jeszcze jedno narzędzie do rozpoznawania języka
25 License: Public Domain
26 Group: Development/Tools
27 Source0: http://www.antlr2.org/download/%{name}-%{version}.tar.gz
28 # Source0-md5: 01cc9a2a454dd33dcd8c856ec89af090
29 Patch0: %{name}-DESTDIR.patch
30 Patch1: %{name}-strcasecmp.patch
31 URL: http://www.antlr2.org/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: libstdc++-devel
35 %{?with_dotnet:BuildRequires: mono-csharp}
37 BuildRequires: sed >= 4.0
40 BuildRequires: java-gcj-compat-devel
44 Requires: jpackage-utils
47 Conflicts: pccts < 1.33MR33-6
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
52 language tool that provides a framework for constructing recognizers,
53 compilers, and translators from grammatical descriptions containing
54 Java, C#, or C++ actions. ANTLR is popular because it is easy to
55 understand, powerful, flexible, generates human-readable output, and
56 comes with complete source. ANTLR provides excellent support for tree
57 construction, tree walking, and translation.
59 %description -l pl.UTF-8
60 ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
61 PCCTS) to narzędzie językowe dostarczające szkielet do tworzenia
62 programów rozpoznających języki, kompilatorów, translatorów z opisów
63 gramatycznych obejmujących Javę, C# lub C++. ANTLR jest popularne
64 ponieważ jest łatwe do zrozumienia, potężne, elastyczne, generuje
65 wyjście czytelne dla człowieka i jest dostępne z pełnymi źródłami.
66 ANTLR ma świetne wsparcie dla tworzenia drzew, przechodzenia po
67 drzewach oraz translacji.
69 %package -n dotnet-antlr
70 Summary: .NET support for ANTLR
71 Summary(pl.UTF-8): Moduły języka .NET dla biblioteki ANTLR
74 %description -n dotnet-antlr
75 .NET support for ANTLR.
77 %description -n dotnet-antlr -l pl.UTF-8
78 Moduły języka .NET dla biblioteki ANTLR.
80 %package -n python-antlr
81 Summary: Python runtime support for ANTLR-generated parsers
82 Summary(pl.UTF-8): Moduł uruchomieniowy języka Python dla analizatorów ANTLR
83 Group: Libraries/Python
84 %pyrequires_eq python-libs
86 %description -n python-antlr
87 Python runtime support for ANTLR-generated parsers.
89 %description -n python-antlr -l pl.UTF-8
90 Moduł uruchomieniowy języka Python dla analizatorów wygenerowanych
94 Summary: Examples of ANTLR usage
95 Summary(pl.UTF-8): Przykładowe programy używające ANTLR
97 Requires: %{name} = %{epoch}:%{version}-%{release}
100 Examples of ANTLR usage.
102 %description examples -l pl.UTF-8
103 Przykładowe programy używające ANTLR.
111 cp -f /usr/share/automake/config.sub scripts
114 %{?with_dotnet:CSHARPC=/usr/bin/mcs --enable-csharp} \
115 %{!?with_dotnet:--disable-csharp} \
117 %{?with_java:CLASSPATH=`pwd` --with-java=java --with-javac=javac --with-jar=jar} \
118 %{!?with_java:--disable-java} \
120 CXXFLAGS="%{rpmcxxflags}" \
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}-%{version}}
128 DESTDIR=$RPM_BUILD_ROOT
131 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
132 $RPM_BUILD_ROOT%{_javadir}
134 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
135 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
136 cp -Rf examples/{cpp,csharp,java,python} \
137 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
138 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
140 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
142 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
143 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
144 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
146 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
149 rm -rf $RPM_BUILD_ROOT
152 %defattr(644,root,root,755)
154 %attr(755,root,root) %{_bindir}/antlr
155 %attr(755,root,root) %{_bindir}/antlr-config
156 %{_includedir}/%{name}
157 %{_libdir}/libantlr.a
158 # Dont separate it, antlr binary wont work without it
164 %files -n dotnet-antlr
165 %defattr(644,root,root,755)
166 %dir %{_prefix}/lib/mono/%{name}
167 %{_prefix}/lib/mono/%{name}/*.dll
170 %files -n python-antlr
171 %defattr(644,root,root,755)
172 %{py_sitescriptdir}/%{name}
175 %defattr(644,root,root,755)
176 %{_examplesdir}/%{name}-%{version}