]>
Commit | Line | Data |
---|---|---|
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 | # | |
20 | Summary: ANother Tool for Language Recognition | |
21 | Summary(pl.UTF-8): Jeszcze jedno narzędzie do rozpoznawania języka | |
22 | Name: antlr | |
23 | Version: 2.7.7 | |
24 | Release: 14 | |
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 | Patch2: %{name}-gentoo.patch | |
32 | URL: http://www.antlr2.org/ | |
33 | BuildRequires: autoconf | |
34 | BuildRequires: automake | |
35 | BuildRequires: libstdc++-devel | |
36 | %{?with_dotnet:BuildRequires: mono-csharp} | |
37 | BuildRequires: python | |
38 | BuildRequires: sed >= 4.0 | |
39 | %if %{with java} | |
40 | %if %{with gcj} | |
41 | BuildRequires: java-gcj-compat-devel | |
42 | %else | |
43 | BuildRequires: jar | |
44 | BuildRequires: jdk | |
45 | Requires: jpackage-utils | |
46 | %endif | |
47 | Requires: jre | |
48 | %endif | |
49 | Conflicts: pccts < 1.33MR33-6 | |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
53 | ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a | |
54 | language tool that provides a framework for constructing recognizers, | |
55 | compilers, and translators from grammatical descriptions containing | |
56 | Java, C#, or C++ actions. ANTLR is popular because it is easy to | |
57 | understand, powerful, flexible, generates human-readable output, and | |
58 | comes with complete source. ANTLR provides excellent support for tree | |
59 | construction, tree walking, and translation. | |
60 | ||
61 | %description -l pl.UTF-8 | |
62 | ANTLR (ANother Tool for Language Recognition; poprzednio znane jako | |
63 | PCCTS) to narzędzie językowe dostarczające szkielet do tworzenia | |
64 | programów rozpoznających języki, kompilatorów, translatorów z opisów | |
65 | gramatycznych obejmujących Javę, C# lub C++. ANTLR jest popularne | |
66 | ponieważ jest łatwe do zrozumienia, potężne, elastyczne, generuje | |
67 | wyjście czytelne dla człowieka i jest dostępne z pełnymi źródłami. | |
68 | ANTLR ma świetne wsparcie dla tworzenia drzew, przechodzenia po | |
69 | drzewach oraz translacji. | |
70 | ||
71 | %package -n dotnet-antlr | |
72 | Summary: .NET support for ANTLR | |
73 | Summary(pl.UTF-8): Moduły języka .NET dla biblioteki ANTLR | |
74 | Group: Libraries | |
75 | ||
76 | %description -n dotnet-antlr | |
77 | .NET support for ANTLR. | |
78 | ||
79 | %description -n dotnet-antlr -l pl.UTF-8 | |
80 | Moduły języka .NET dla biblioteki ANTLR. | |
81 | ||
82 | %package -n python-antlr | |
83 | Summary: Python runtime support for ANTLR-generated parsers | |
84 | Summary(pl.UTF-8): Moduł uruchomieniowy języka Python dla analizatorów ANTLR | |
85 | Group: Libraries/Python | |
86 | %pyrequires_eq python-libs | |
87 | ||
88 | %description -n python-antlr | |
89 | Python runtime support for ANTLR-generated parsers. | |
90 | ||
91 | %description -n python-antlr -l pl.UTF-8 | |
92 | Moduł uruchomieniowy języka Python dla analizatorów wygenerowanych | |
93 | przez ANTLR. | |
94 | ||
95 | %package examples | |
96 | Summary: Examples of ANTLR usage | |
97 | Summary(pl.UTF-8): Przykładowe programy używające ANTLR | |
98 | Group: Development | |
99 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
100 | ||
101 | %description examples | |
102 | Examples of ANTLR usage. | |
103 | ||
104 | %description examples -l pl.UTF-8 | |
105 | Przykładowe programy używające ANTLR. | |
106 | ||
107 | %prep | |
108 | %setup -q | |
109 | %patch0 -p1 | |
110 | %patch1 -p1 | |
111 | %patch2 -p1 | |
112 | ||
113 | %build | |
114 | cp -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 | ||
123 | CXXFLAGS="%{rpmcxxflags}" \ | |
124 | %{__make} | |
125 | ||
126 | %install | |
127 | rm -rf $RPM_BUILD_ROOT | |
128 | install -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} | |
134 | install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \ | |
135 | $RPM_BUILD_ROOT%{_javadir} | |
136 | %endif | |
137 | install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \ | |
138 | $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name} | |
139 | cp -Rf examples/{cpp,csharp,java,python} \ | |
140 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
141 | find $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} | |
147 | rm $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 | |
154 | rm -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} |