]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml.spec
- added patch for powerpc native compiler
[packages/ocaml.git] / ocaml.spec
1
2 # conditional build:
3 # --without emacs
4 # --without tk
5 # --without x11  (implies --without tk)
6
7 %{?_without_x11:%define _without_tk     1}
8
9 Summary:        The Objective Caml compiler and programming environment
10 Summary(pl):    Kompilator Objektowego Caml oraz ¶rodowisko programistyczne
11 Name:           ocaml
12 Version:        3.04
13 Release:        5
14 License:        distributable
15 Vendor:         Group of implementors <caml-light@inria.fr>
16 Group:          Development/Languages
17 Source0:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}.tar.gz
18 Source1:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.info.tar.gz
19 Source2:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.html.tar.gz
20 Source3:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}-refman.ps.gz
21 Source4:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-refman.html.tar.gz
22 Source5:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-refman.ps.gz
23 Source6:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-tutorial.html.tar.gz
24 Source7:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-tutorial.ps.gz
25 Patch0:         %{name}-build.patch
26 Patch1:         %{name}-DESTDIR.patch
27 Patch2:         %{name}-manlinks.patch
28 Patch3:         %{name}-db3.patch
29 Patch4:         %{name}-powerpcfix.patch
30 URL:            http://caml.inria.fr/
31 BuildRequires:  db3-devel
32 %{!?_without_tk:BuildRequires:          tk-devel}
33 %{!?_without_x11:BuildRequires:         XFree86-devel}
34 %{!?_without_emacs:BuildRequires:       xemacs-common}
35 %{!?_without_emacs:BuildRequires:       xemacs-fsf-compat-pkg}
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 Objective Caml is a high-level, strongly-typed, functional and
40 object-oriented programming language from the ML family of languages.
41
42 This package comprises two batch compilers (a fast bytecode compiler
43 and an optimizing native-code compiler), an interactive toplevel
44 system, Lex&Yacc tools, a replay debugger, and a comprehensive
45 library.
46
47 %description -l pl
48 Objektowy Caml jest funkcjonalnym, obiektowo zorientowanym jêzykiem
49 wysokiego poziomu z rodziny jêzyków ML.
50
51 Ten pakiet zawiera dwa kompilatory (szybki kompilator bytecode oraz
52 zoptymalizowany natywny kompilator), interaktywny g³ówny system,
53 narzêdzia Lex&Yacc, odpluskwiacz i biblioteki.
54
55 %package doc-ps
56 Summary:        PostScript documentation for OCaml
57 Summary(pl):    Dokumentacja dla OCaml-a w formacie PostSript
58 Group:          Development/Tools
59 Requires:       %{name} = %{version}
60
61 %description doc-ps
62 PostScript documentation for OCaml
63
64 %description doc-ps -l pl
65 Dokumentacja dla OCaml-a w formacie PostSript
66
67 %package doc-html
68 Summary:        HTML documentation for OCaml
69 Summary(pl):    Dokumentacja dla OCaml-a w formacie HTML
70 Group:          Development/Tools
71 Requires:       %{name} = %{version}
72
73 %description doc-html
74 HTML documentation for OCaml
75
76 %description doc-html -l pl
77 Dokumentacja dla OCaml-a w formacie HTML
78
79 %package emacs
80 Summary:        Emacs mode for OCaml
81 Summary(pl):    Tryb Emacsa dla OCaml
82 Group:          Development/Tools
83 Requires:       %{name} = %{version}
84
85 %description emacs
86 Emacs mode files for Objective Caml language
87
88 %description emacs -l pl
89 Pliki trybu Emacsa dla jêzyka Objektowego Caml
90
91 %package labltk
92 Summary:        LabelTk library for OCaml
93 Summary(pl):    Biblioteka LablTk dla OCamla
94 Group:          Development/Libraries
95 Requires:       %{name} = %{version}
96
97 %description labltk
98 LablTk gives OCaml program access to Tcl/Tk GUI widgets.
99
100 %description labltk -l pl
101 Biblioteka LablTk daje programom napisanym w OCamlu dostêp do widgetów
102 Tcl/Tk.
103
104 %package x11graphics
105 Summary:        X11 graphic output for OCaml
106 Summary(pl):    Iksowe wyj¶cie graficzne dla OCamla
107 Group:          Development/Libraries
108 Requires:       %{name} = %{version}
109
110 %description x11graphics
111 This package gives OCaml program access to drawing in X11 windows.
112
113 %description x11graphics -l pl
114 Ten pakiet daje programom napisanym w OCamlu dostêp do rysowania po
115 oknach X11.
116
117 %package camlp4
118 Summary:        Objective Caml Preprocessor
119 Summary(pl):    Preprocesor Ocamla
120 Group:          Development/Languages
121 Requires:       %{name} = %{version}
122 Provides:       camlp4 = %{version}
123 Obsoletes:      camlp4
124
125 %description camlp4
126 Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers
127 tools for syntax (grammars) and the ability to modify the concrete
128 syntax of the language (quotations, syntax extensions).
129
130 Camlp4 can parse normal Ocaml concrete syntax or any other
131 user-definable syntax. As an example, an alternative syntax is
132 provided, named revised, because it tries to fix some small problems
133 of the normal syntax.
134
135 Camlp4 can pretty print the normal Ocaml concrete syntax or the
136 revised one. It is therefore always possible to have a version of your
137 sources compilable by the compiler Objective Caml without
138 preprocessing.
139
140 %description camlp4 -l pl
141 Camlp4 jest preprocesorem dla Ocamla. Oferuje narzêdzia do sk³adni
142 (gramatyki) oraz umiejêtno¶æ modyfikowania konkretnej sk³adni jêzyka
143 (cytowania, rozszerzenia).
144
145 Camlp4 mo¿e sparsowaæ normaln± sk³adniê Ocamla lub inn± dowoln±
146 definiowaln± przez u¿ytkownika. Jako przyk³ad jest podana alternatywna
147 sk³adnia, nazwana "poprawiona", poniewa¿ próbuje poprawiæ drobne
148 problemy ze zwyk³± sk³adni±.
149
150 Camlp4 umie ³adnie wypisaæ normaln± sk³adniê Camla lub "poprawion±".
151 Dziêki temu jest mo¿liwe posiadanie wersji swoich ¼róde³
152 kompilowalnych przez kompilatora Ocamla bez preprocesingu.
153
154 %prep
155 %setup -q -T -b 0
156 %setup -q -T -D -a 1
157 %setup -q -T -D -a 2
158 # order mess with docs somewhat
159 mkdir docs
160 mkdir docs/html
161 mv htmlman docs/html/ocaml
162 cp %{SOURCE3} docs/ocaml.ps.gz
163 %setup -q -T -D -a 4
164 mv camlp4-%{version}-refman.html docs/html/camlp4
165 cp %{SOURCE5} docs/camlp4.ps.gz
166 %setup -q -T -D -a 6
167 mv camlp4-%{version}-tutorial.html docs/html/camlp4-tutorial
168 cp %{SOURCE7} docs/camlp4-tutorial.ps.gz
169
170 %patch0 -p1
171 %patch1 -p1
172 %patch2 -p1
173 %patch3 -p1
174 %ifarch ppc
175 %patch4 -p1
176 %endif
177
178 %build
179 ./configure \
180         -cc "%{__cc} %{rpmcflags}" \
181         -bindir %{_bindir} \
182         -libdir %{_libdir}/%{name} \
183         -mandir %{_mandir}/man1 \
184         -host %{_host} \
185         %{?_without_tk:-notk} \
186         -with-pthread
187
188 # this is crude hack (works in addition to ocaml-db3.patch)
189 cp config/Makefile config/Makefile.tmp
190 sed -e 's|-ldb1|-ldb|; s|-I%{_includedir}/db1||' < config/Makefile.tmp > config/Makefile
191
192 %{__make} world bootstrap opt ocamlc.opt ocamlopt.opt
193 %{__make} -C camlp4 optp4
194
195 # hack info pages to contain dir entry
196 cat <<EOF >infoman/ocaml.info
197 INFO-DIR-SECTION Programming Languages:
198 START-INFO-DIR-ENTRY
199 * Ocaml: (ocaml).                             The Ocaml language
200 END-INFO-DIR-ENTRY
201 EOF
202 zcat infoman/ocaml.info.gz >> infoman/ocaml.info
203
204 gzip -9nf infoman/ocaml.info
205
206 %install
207 rm -rf $RPM_BUILD_ROOT
208 install -d $RPM_BUILD_ROOT%{_infodir}
209
210 %{__make} install DESTDIR=$RPM_BUILD_ROOT
211
212 %if %{!?_without_emacs:1}%{?_without_emacs:0}
213 %{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
214         EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
215                 else echo xemacs; fi`" \
216         EMACSDIR="%{_libdir}/emacs/site-lisp"
217 %endif
218
219 cp -p {parsing/{location,longident,parsetree},typing/typecore}.{cm,ml}i \
220         $RPM_BUILD_ROOT%{_libdir}/%{name}
221
222 for f in ocamlc ocamlopt camlp4o camlp4r; do
223         if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
224                 mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
225                         $RPM_BUILD_ROOT%{_bindir}/$f.byte
226                 ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
227         fi
228 done
229
230 rm -f $RPM_BUILD_ROOT%{_libdir}/%{_name}/*.ml
231 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
232
233 install infoman/*info* $RPM_BUILD_ROOT%{_infodir}
234
235 gzip -9nf LICENSE Changes README Upgrading
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %post
241 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
242
243 %postun
244 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
245
246
247 %files
248 %defattr(644,root,root,755)
249 %doc *.gz
250 %attr(755,root,root) %{_bindir}/ocaml
251 %attr(755,root,root) %{_bindir}/ocaml[cmdlopry]*
252 %attr(755,root,root) %{_bindir}/*labels
253 %{_libdir}/%{name}/caml
254 %{_libdir}/%{name}/threads
255 %{_libdir}/%{name}/[abefhimnopqrstuw]*.*
256 %{_libdir}/%{name}/callback.*
257 %{_libdir}/%{name}/char.*
258 %{_libdir}/%{name}/condition.*
259 %{_libdir}/%{name}/dbm.*
260 %{_libdir}/%{name}/digest.*
261 %attr(755,root,root) %{_libdir}/%{name}/dll[bmnstu]*.so
262 %{_libdir}/%{name}/g[ce]*.*
263 %{_libdir}/%{name}/l*.cm*
264 %{_libdir}/%{name}/l*.mli
265 %{_libdir}/%{name}/lib[abc]*.a
266 %{_libdir}/%{name}/libmldbm.a
267 %{_libdir}/%{name}/lib[nstu]*.a
268 %{_libdir}/%{name}/ld.conf
269 %attr(755,root,root) %{_libdir}/%{name}/expunge
270 %attr(755,root,root) %{_libdir}/%{name}/extract_crc
271 %{_libdir}/%{name}/camlheader
272 %{_libdir}/%{name}/camlheader_ur
273 %attr(755,root,root) %{_libdir}/%{name}/*labels
274 %{_mandir}/man*/*ocaml*
275 %{_infodir}/*
276
277 %files camlp4
278 %defattr(644,root,root,755)
279 %attr(755,root,root) %{_bindir}/*camlp4*
280 %attr(755,root,root) %{_bindir}/ocpp
281 %attr(755,root,root) %{_bindir}/odyl
282 %{_libdir}/%{name}/camlp4
283 %{_mandir}/man*/*camlp4*
284 %{_mandir}/man*/*ocpp*
285
286 %if %{!?_without_tk:1}%{?_without_tk:0}
287 %files labltk
288 %defattr(644,root,root,755)
289 %attr(755,root,root) %{_bindir}/labltk
290 %attr(755,root,root) %{_bindir}/ocamlbrowser
291 %dir %{_libdir}/%{name}/labltk
292 %{_libdir}/%{name}/labltk/*.cm*
293 %{_libdir}/%{name}/labltk/*.a
294 %{_libdir}/%{name}/labltk/*.mli
295 %attr(755,root,root) %{_libdir}/%{name}/labltk/*.so
296 %attr(755,root,root) %{_libdir}/%{name}/labltk/labltktop
297 %attr(755,root,root) %{_libdir}/%{name}/labltk/tkcompiler
298 %endif
299
300 %if %{!?_without_x11:1}%{?_without_x11:0}
301 %files x11graphics
302 %defattr(644,root,root,755)
303 %{_libdir}/%{name}/graphics*
304 %{_libdir}/%{name}/libgraphics.a
305 %attr(755,root,root) %{_libdir}/%{name}/dllgraphics.so
306 %endif
307
308 %if %{!?_without_emacs:1}%{?_without_emacs:0}
309 %files emacs
310 %defattr(644,root,root,755)
311 %{_libdir}/emacs/site-lisp/*.el
312 %endif
313
314 %files doc-ps
315 %defattr(644,root,root,755)
316 %doc docs/*.ps.gz
317
318 %files doc-html
319 %defattr(644,root,root,755)
320 %doc docs/html/*
This page took 0.06282 seconds and 4 git commands to generate.