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