]> git.pld-linux.org Git - packages/antlr.git/blob - antlr.spec
a14e86ee96fc902aa149e56f819ef51b48e9e5bf
[packages/antlr.git] / antlr.spec
1 # TODO:
2 #  *  fix gcj build/runtime
3 #  *  add python bcond
4 #  *  package the Emacs and Jedit modes
5 #
6 # Conditional build:
7 %bcond_with     gcj     # use GCJ instead of javac
8 %bcond_without  dotnet  # don't build .NET modules
9 #
10 %{?with_dotnet:%include /usr/lib/rpm/macros.mono}
11 #
12 Summary:        ANother Tool for Language Recognition
13 Summary(pl):    Jeszcze jedno narzêdzie do rozpoznawania jêzyka
14 Name:           antlr
15 Version:        2.7.6
16 Release:        1
17 License:        Public Domain
18 Group:          Development/Tools
19 Source0:        http://www.antlr.org/download/%{name}-%{version}.tar.gz
20 # Source0-md5:  17d8bf2e814f0a26631aadbbda8d7324
21 Patch0:         %{name}-DESTDIR.patch
22 Patch1:         %{name}-csharp.patch
23 Patch2:         %{name}-utils.patch
24 URL:            http://www.antlr.org/
25 BuildRequires:  autoconf
26 BuildRequires:  automake
27 BuildRequires:  libstdc++-devel
28 %{?with_dotnet:BuildRequires:   mono-csharp}
29 BuildRequires:  python
30 BuildRequires:  sed >= 4.0
31 %if %{with gcj}
32 BuildRequires:  gcc-java >= 5:4.0.0
33 BuildRequires:  gcc-java-tools >= 5:4.0.0
34 Requires:       /usr/bin/gij
35 %else
36 BuildRequires:  jar
37 BuildRequires:  jdk
38 Requires:       jre
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
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):    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
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):    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
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):    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
96 Przyk³adowe programy u¿ywaj±ce ANTLR.
97
98 %prep
99 %setup -q
100 %patch0 -p1
101 %patch1 -p1
102 %patch2 -p1
103
104 %build
105 cp -f /usr/share/automake/config.sub scripts
106 %{__autoconf}
107 %configure \
108         --enable-cxx \
109         %{?with_dotnet:--enable-csharp} \
110         %{!?with_dotnet:--disable-csharp} \
111         %{!?with_gcj:CLASSPATH=`pwd` --with-java=java --with-javac=javac --with-jar=jar} \
112         %{?with_gcj:--with-java=gij --with-javac=gcj --with-jar=fastjar}
113
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 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
124         $RPM_BUILD_ROOT%{_javadir}
125 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
126         $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
127 cp -Rf examples/{cpp,csharp,java,python} \
128         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name Makefile -exec rm -f {} \;
130
131 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
132
133 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
134 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
135 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
136
137 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %files
143 %defattr(644,root,root,755)
144 %doc doc/*
145 %attr(755,root,root) %{_bindir}/antlr
146 %attr(755,root,root) %{_bindir}/antlr-config
147 %{_includedir}/%{name}
148 %{_libdir}/libantlr.a
149 # Dont separate it, antlr binary wont work without it
150 %{_javadir}/*.jar
151
152 %if %{with dotnet}
153 %files -n dotnet-antlr
154 %defattr(644,root,root,755)
155 %{_prefix}/lib/mono/%{name}/*.dll
156 %endif
157
158 %files -n python-antlr
159 %defattr(644,root,root,755)
160 %{py_sitescriptdir}/%{name}
161
162 %files examples
163 %defattr(644,root,root,755)
164 %{_examplesdir}/%{name}-%{version}
This page took 0.124196 seconds and 3 git commands to generate.