]> git.pld-linux.org Git - packages/antlr.git/blob - antlr.spec
- unified examplesdir
[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_gcj:CLASSPATH=`pwd` --with-javac=javac} \
105         %{?with_gcj:--with-javac=gcj --with-jar=fastjar}
106
107 %{__make}
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT{%{_javadir},%{py_sitescriptdir}/%{name},%{_prefix}/lib/mono/%{name},%{_examplesdir}/%{name}}
112
113 %{__make} install \
114         DESTDIR=$RPM_BUILD_ROOT
115
116 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/antlr.jar \
117         $RPM_BUILD_ROOT%{_javadir}
118 install $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/*.py \
119         $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
120 cp -Rf examples/{cpp,csharp,java,python} \
121         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
122 find $RPM_BUILD_ROOT%{_examplesdir}/%{name} -name Makefile -exec rm -f {} \;
123
124 %{?with_dotnet:install lib/*.dll $RPM_BUILD_ROOT%{_prefix}/lib/mono/%{name}}
125
126 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
127 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}
128 rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
129
130 %{__sed} -i -e "s,ANTLR_JAR=.*,ANTLR_JAR=\"%{_javadir}/antlr.jar\",g" $RPM_BUILD_ROOT%{_bindir}/antlr
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %files
136 %defattr(644,root,root,755)
137 %doc doc/*
138 %attr(755,root,root) %{_bindir}/antlr
139 %attr(755,root,root) %{_bindir}/antlr-config
140 %{_includedir}/%{name}
141 %{_libdir}/libantlr.a
142 # Dont separate it, antlr binary wont work without it
143 %{_javadir}/*.jar
144
145 %if %{with dotnet}
146 %files -n dotnet-antlr
147 %defattr(644,root,root,755)
148 %{_prefix}/lib/mono/%{name}/*.dll
149 %endif
150
151 %files -n python-antlr
152 %defattr(644,root,root,755)
153 %{py_sitescriptdir}/%{name}
154
155 %files examples
156 %defattr(644,root,root,755)
157 %{_examplesdir}/%{name}-%{version}
This page took 0.401073 seconds and 3 git commands to generate.