]> git.pld-linux.org Git - packages/antlr.git/blob - antlr.spec
5d55cc0a053d2a7433f965bf88af0ff9032c63b7
[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:        12
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 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %files
155 %defattr(644,root,root,755)
156 %doc doc/*
157 %attr(755,root,root) %{_bindir}/antlr
158 %attr(755,root,root) %{_bindir}/antlr-config
159 %{_includedir}/%{name}
160 %{_libdir}/libantlr.a
161 # Dont separate it, antlr binary wont work without it
162 %if %{with java}
163 %{_javadir}/*.jar
164 %endif
165
166 %if %{with dotnet}
167 %files -n dotnet-antlr
168 %defattr(644,root,root,755)
169 %dir %{_prefix}/lib/mono/%{name}
170 %{_prefix}/lib/mono/%{name}/*.dll
171 %endif
172
173 %files -n python-antlr
174 %defattr(644,root,root,755)
175 %{py_sitescriptdir}/%{name}
176
177 %files examples
178 %defattr(644,root,root,755)
179 %{_examplesdir}/%{name}-%{version}
This page took 0.063598 seconds and 2 git commands to generate.