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