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