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