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