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