]> git.pld-linux.org Git - packages/antlr.git/blame_incremental - antlr.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/antlr.git] / antlr.spec
... / ...
CommitLineData
1# TODO:
2# - add python bcond
3# - package the Emacs and Jedit modes
4# %{_datadir}/%{name}-%{version}/antlr-jedit.xml
5# %{_datadir}/%{name}-%{version}/antlr-mode.el
6#
7# NOTE:
8# - next version is packaged as antlr3.spec. Please, do not upgrade this spec
9# to 3.
10#
11# Conditional build:
12%bcond_with gcj # use GCJ instead of javac
13%bcond_without dotnet # don't build .NET modules
14%bcond_without java # don't build Java at all
15#
16#
17%ifarch x32
18%undefine with_dotnet
19%endif
20#
21Summary: ANother Tool for Language Recognition
22Summary(pl.UTF-8): Jeszcze jedno narzędzie do rozpoznawania języka
23Name: antlr
24Version: 2.7.7
25Release: 17
26License: Public Domain
27Group: Development/Tools
28Source0: http://www.antlr2.org/download/%{name}-%{version}.tar.gz
29# Source0-md5: 01cc9a2a454dd33dcd8c856ec89af090
30Patch0: %{name}-DESTDIR.patch
31Patch1: %{name}-strcasecmp.patch
32Patch2: %{name}-gentoo.patch
33URL: http://www.antlr2.org/
34BuildRequires: autoconf
35BuildRequires: automake
36BuildRequires: libstdc++-devel
37%{?with_dotnet:BuildRequires: mono-csharp}
38BuildRequires: python
39BuildRequires: sed >= 4.0
40%if %{with java}
41%if %{with gcj}
42BuildRequires: java-gcj-compat-devel
43%else
44BuildRequires: jar
45BuildRequires: jdk
46Requires: jpackage-utils
47%endif
48Requires: jre
49%endif
50Conflicts: pccts < 1.33MR33-6
51BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53%description
54ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
55language tool that provides a framework for constructing recognizers,
56compilers, and translators from grammatical descriptions containing
57Java, C#, or C++ actions. ANTLR is popular because it is easy to
58understand, powerful, flexible, generates human-readable output, and
59comes with complete source. ANTLR provides excellent support for tree
60construction, tree walking, and translation.
61
62%description -l pl.UTF-8
63ANTLR (ANother Tool for Language Recognition; poprzednio znane jako
64PCCTS) to narzędzie językowe dostarczające szkielet do tworzenia
65programów rozpoznających języki, kompilatorów, translatorów z opisów
66gramatycznych obejmujących Javę, C# lub C++. ANTLR jest popularne
67ponieważ jest łatwe do zrozumienia, potężne, elastyczne, generuje
68wyjście czytelne dla człowieka i jest dostępne z pełnymi źródłami.
69ANTLR ma świetne wsparcie dla tworzenia drzew, przechodzenia po
70drzewach oraz translacji.
71
72%package -n dotnet-antlr
73Summary: .NET support for ANTLR
74Summary(pl.UTF-8): Moduły języka .NET dla biblioteki ANTLR
75Group: Libraries
76
77%description -n dotnet-antlr
78.NET support for ANTLR.
79
80%description -n dotnet-antlr -l pl.UTF-8
81Moduły języka .NET dla biblioteki ANTLR.
82
83%package -n python-antlr
84Summary: Python runtime support for ANTLR-generated parsers
85Summary(pl.UTF-8): Moduł uruchomieniowy języka Python dla analizatorów ANTLR
86Group: Libraries/Python
87%pyrequires_eq python-libs
88
89%description -n python-antlr
90Python runtime support for ANTLR-generated parsers.
91
92%description -n python-antlr -l pl.UTF-8
93Moduł uruchomieniowy języka Python dla analizatorów wygenerowanych
94przez ANTLR.
95
96%package examples
97Summary: Examples of ANTLR usage
98Summary(pl.UTF-8): Przykładowe programy używające ANTLR
99Group: Development
100Requires: %{name} = %{epoch}:%{version}-%{release}
101
102%description examples
103Examples of ANTLR usage.
104
105%description examples -l pl.UTF-8
106Przykładowe programy używające ANTLR.
107
108%prep
109%setup -q
110%patch0 -p1
111%patch1 -p1
112%patch2 -p1
113
114%build
115cp -f /usr/share/automake/config.sub scripts
116%{__autoconf}
117%configure \
118 %{?with_dotnet:CSHARPC=/usr/bin/mcs --enable-csharp} \
119 %{!?with_dotnet:--disable-csharp} \
120 --enable-cxx \
121 %{?with_java:CLASSPATH=`pwd` --with-java=java --with-javac=javac --with-jar=jar} \
122 %{!?with_java:--disable-java} \
123
124CXXFLAGS="%{rpmcxxflags}" \
125%{__make}
126
127%install
128rm -rf $RPM_BUILD_ROOT
129install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}-%{version}}
130
131%{__make} install \
132 DESTDIR=$RPM_BUILD_ROOT
133
134%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
135 $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
136%{__rm} $RPM_BUILD_ROOT%{_libdir}/antlr.py
137%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
138%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
139# module installer
140%{__rm} $RPM_BUILD_ROOT%{_sbindir}/pyantlr.sh
141
142%if %{with java}
143%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
144 $RPM_BUILD_ROOT%{_javadir}
145%{__rm} $RPM_BUILD_ROOT%{_libdir}/antlr.jar
146%endif
147%{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
148
149%if %{with dotnet}
150%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}
151%{__rm} $RPM_BUILD_ROOT%{_libdir}/antlr.*.dll
152%endif
153
154cp -Rf examples/{cpp,csharp,java,python} \
155 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
156find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
157
158%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
159
160%clean
161rm -rf $RPM_BUILD_ROOT
162
163%files
164%defattr(644,root,root,755)
165%doc doc/*.{html,gif,jpg}
166%attr(755,root,root) %{_bindir}/antlr
167%attr(755,root,root) %{_bindir}/antlr-config
168%{_includedir}/%{name}
169%{_libdir}/libantlr.a
170# Don't separate it, antlr binary won't work without it
171%if %{with java}
172%{_javadir}/antlr.jar
173%endif
174
175%if %{with dotnet}
176%files -n dotnet-antlr
177%defattr(644,root,root,755)
178%dir %{_prefix}/lib/mono/%{name}
179%{_prefix}/lib/mono/%{name}/antlr.astframe.dll
180%{_prefix}/lib/mono/%{name}/antlr.runtime.dll
181%endif
182
183%files -n python-antlr
184%defattr(644,root,root,755)
185%{py_sitescriptdir}/%{name}
186
187%files examples
188%defattr(644,root,root,755)
189%{_examplesdir}/%{name}-%{version}
This page took 0.061626 seconds and 4 git commands to generate.