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