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