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