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