]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml.spec
- added examples subpackage with pure-fun
[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 Camla oraz ¶rodowisko programistyczne
11 Name:           ocaml
12 Version:        3.06
13 Release:        2
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}/%{name}-%{version}.tar.gz
18 Source1:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}/%{name}-%{version}-refman.html.tar.gz
19 Source2:        ftp://ftp.inria.fr/lang/caml-light/%{name}-%{version}/%{name}-%{version}-refman.ps.gz
20 Source3:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-manual.html.tar.gz
21 Source4:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-manual.dvi.gz
22 Source5:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-tutorial.html.tar.gz
23 Source6:        ftp://ftp.inria.fr/INRIA/Projects/cristal/camlp4/camlp4-%{version}-tutorial.dvi.gz
24 Source7:        http://www.oefai.at/~markus/ocaml_sources/pure-fun-1.0.4.tar.bz2
25 Source8:        http://www.oefai.at/~markus/ocaml_sources/ds-contrib.tar.gz
26 Patch0:         %{name}-build.patch
27 Patch1:         %{name}-manlinks.patch
28 Patch2:         %{name}-db3.patch
29 Patch3:         %{name}-objinfo.patch
30 Patch4:         %{name}-opt-symbols.patch
31 Patch5:         %{name}-mano.patch
32 URL:            http://caml.inria.fr/
33 Requires:       ocaml-runtime = %{version}-%{release}
34 Obsoletes:      ocaml-ocamldoc
35 Provides:       ocaml-ocamldoc
36 BuildRequires:  db3-devel
37 %{!?_without_tk:BuildRequires:          tk-devel}
38 %{!?_without_x11:BuildRequires:         XFree86-devel}
39 %{!?_without_emacs:BuildRequires:       xemacs}
40 %{!?_without_emacs:BuildRequires:       xemacs-common}
41 %{!?_without_emacs:BuildRequires:       xemacs-fsf-compat-pkg}
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44
45 %description
46 Objective Caml is a high-level, strongly-typed, functional and
47 object-oriented programming language from the ML family of languages.
48
49 This package comprises two batch compilers (a fast bytecode compiler
50 and an optimizing native-code compiler), an interactive toplevel
51 system, Lex&Yacc tools, a replay debugger, and a comprehensive
52 library.
53
54 %description -l pl
55 Objektowy Caml jest funkcjonalnym, obiektowo zorientowanym jêzykiem
56 wysokiego poziomu z rodziny jêzyków ML.
57
58 Ten pakiet zawiera dwa kompilatory (szybki kompilator bytecode oraz
59 zoptymalizowany natywny kompilator), interaktywny g³ówny system,
60 narzêdzia Lex&Yacc, odpluskwiacz i biblioteki.
61
62 %package doc-ps
63 Summary:        PostScript documentation for OCaml
64 Summary(pl):    Dokumentacja dla OCaml-a w formacie PostSript
65 Group:          Development/Tools
66
67 %description doc-ps
68 PostScript documentation for OCaml. HTML documentation is in main package.
69
70 %description doc-ps -l pl
71 Dokumentacja dla OCamla w formacie PostSript. Dokumentacja HTML jest
72 w g³ównym pakiecie.
73
74 %package emacs
75 Summary:        Emacs mode for OCaml
76 Summary(pl):    Tryb Emacsa dla OCaml
77 Group:          Development/Tools
78 Requires:       %{name} = %{version}
79
80 %description emacs
81 Emacs mode files for Objective Caml language.
82
83 %description emacs -l pl
84 Pliki trybu Emacsa dla jêzyka Objektowego Camla.
85
86 %package runtime
87 Summary:        Runtime system for OCaml
88 Summary(pl):    ¦rodowisko uruchomieniowe dla OCamla
89 Group:          Libraries
90
91 %description runtime
92 This package contains binaries needed to run bytecode OCaml programs:
93 ocamlrun bytecode interpreter, and basic dynamic link libraries.
94
95 %description runtime -l pl
96 Pakiet ten zawiera binaria potrzebne do uruchamiania programów w
97 OCamlu skompilowanych do bytecodu: interpreter bytecodu ocamlrun oraz
98 podstawowe bibliotki linkowane dynamicznie.
99
100 %package labltk-devel
101 Summary:        LabelTk library for OCaml
102 Summary(pl):    Biblioteka LablTk dla OCamla
103 Group:          Development/Libraries
104 Requires:       %{name}-labltk = %{version}-%{release}
105
106 %description labltk-devel
107 LablTk gives OCaml program access to Tcl/Tk GUI widgets. This package
108 contains files needed to develop OCaml programs using LablTk.
109
110 %description labltk-devel -l pl
111 Biblioteka LablTk daje programom napisanym w OCamlu dostêp do widgetów
112 Tcl/Tk. Pakiet ten zawiera pliki niezbêdne do tworzenia programów
113 u¿ywaj±cych LablTk.
114
115 %package labltk
116 Summary:        Runtime for LabelTk library
117 Summary(pl):    ¦rodowisko uruchomieniowe dla biblioteki LablTk
118 Group:          Libraries
119 Requires:       %{name} = %{version}-%{release}
120
121 %description labltk
122 LablTk gives OCaml program access to Tcl/Tk GUI widgets. This package
123 contains files needed to run bytecode OCaml programs using LablTk.
124
125 %description labltk -l pl
126 Biblioteka LablTk daje programom napisanym w OCamlu dostêp do widgetów
127 Tcl/Tk. Pakiet ten zawiera binaria potrzebne do uruchamiania programów
128 u¿ywaj±cych LablTk.
129
130 %package x11graphics-devel
131 Summary:        X11 graphic output for OCaml
132 Summary(pl):    Iksowe wyj¶cie graficzne dla OCamla
133 Group:          Development/Libraries
134 Requires:       %{name}-x11graphics = %{version}-%{release}
135
136 %description x11graphics-devel
137 x11graphics module gives OCaml program access to drawing in X11
138 windows. This package contains files needed to develop OCaml programs
139 using x11graphics.
140
141 %description x11graphics-devel -l pl
142 Modu³ x11graphics daje programom napisanym w OCamlu dostêp do
143 rysowania po oknach X11. Pakiet ten zawiera pliki niezbêdne do
144 tworzenia programów u¿ywaj±cych x11graphics.
145
146 %package x11graphics
147 Summary:        X11 graphic output for OCaml
148 Summary(pl):    Iksowe wyj¶cie graficzne dla OCamla
149 Group:          Development/Libraries
150 Requires:       %{name} = %{version}-%{release}
151
152 %description x11graphics
153 x11graphics module gives OCaml program access to drawing in X11
154 windows. This package contains files needed to run bytecode OCaml
155 programs using x11graphics.
156
157 %description x11graphics -l pl
158 Modu³ x11graphics daje programom napisanym w OCamlu dostêp do
159 rysowania po oknach X11. Pakiet ten zawiera binaria potrzebne do
160 uruchamiania programów u¿ywaj±cych x11graphics.
161
162 %package camlp4
163 Summary:        Objective Caml Preprocessor
164 Summary(pl):    Preprocesor Ocamla
165 Group:          Development/Languages
166 Requires:       %{name} = %{version}-%{release}
167 Provides:       camlp4 = %{version}-%{release}
168 Obsoletes:      camlp4
169
170 %description camlp4
171 Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers
172 tools for syntax (grammars) and the ability to modify the concrete
173 syntax of the language (quotations, syntax extensions).
174
175 Camlp4 can parse normal Ocaml concrete syntax or any other
176 user-definable syntax. As an example, an alternative syntax is
177 provided, named revised, because it tries to fix some small problems
178 of the normal syntax.
179
180 Camlp4 can pretty print the normal Ocaml concrete syntax or the
181 revised one. It is therefore always possible to have a version of your
182 sources compilable by the compiler Objective Caml without
183 preprocessing.
184
185 %description camlp4 -l pl
186 Camlp4 jest preprocesorem dla Ocamla. Oferuje narzêdzia do sk³adni
187 (gramatyki) oraz umiejêtno¶æ modyfikowania konkretnej sk³adni jêzyka
188 (cytowania, rozszerzenia).
189
190 Camlp4 mo¿e sparsowaæ normaln± sk³adniê Ocamla lub inn± dowoln±
191 definiowaln± przez u¿ytkownika. Jako przyk³ad jest podana alternatywna
192 sk³adnia, nazwana "poprawiona", poniewa¿ próbuje poprawiæ drobne
193 problemy ze zwyk³± sk³adni±.
194
195 Camlp4 umie ³adnie wypisaæ normaln± sk³adniê Camla lub "poprawion±".
196 Dziêki temu jest mo¿liwe posiadanie wersji swoich ¼róde³
197 kompilowalnych przez kompilatora Ocamla bez preprocesingu.
198
199 %package devel
200 Summary:        Compiled parts of OCaml compiler
201 Summary(pl):    Skompilowane kawa³ki kompilatora OCamla
202 Group:          Development/Languages
203 Requires:       %{name} = %{version}-%{release}
204
205 %description devel
206 This package contains *.cmi and *.cmo files being parts of OCaml
207 compiler. They are needed to compile some programs.
208
209 %description devel -l pl
210 Pakiet ten zawiera pliki *.cmi oraz *.cmo bêd±ce cze¶ciami kompilatora
211 OCamla. S± one wymagane do kompilacji niektórych programów.
212
213 %package ocamldoc-devel
214 Summary:        Files needed to develop programs using ocamldoc
215 Summary(pl):    Pliki potrzebne do tworzenia programów u¿ywaj±cych ocamldoc
216 Group:          Development/Languages
217 Requires:       %{name} = %{version}-%{release}
218
219 %description ocamldoc-devel
220 You need this package if you are going to write ocamldoc front end or
221 something like that.
222
223 %description ocamldoc-devel -l pl
224 Bêdziesz potrzebowaæ tego pakietu, je¶li zamierzasza pisaæ front end
225 dla ocamldoc lub co¶ podobnego.
226
227 %package lib-source
228 Summary:        Sources of OCaml standard library
229 Summary(pl):    ¬ród³a biblioteki standardowej OCamla
230 Group:          Development/Languages
231 Requires:       %{name} = %{version}-%{release}
232
233 %description lib-source
234 This sources come helpful during debugging of user programs with ocamldebug.
235
236 %description lib-source -l pl
237 ¬ród³a te co¶ przydatne przy odpluskwianiu programów u¿ytkownika
238 z u¿yciem ocamldebug.
239
240 # maybe we'll want to add some more stuff here?
241 %package examples
242 Summary:        Example source code for OCaml
243 Summary(pl):    Przyk³adowe kody ¼ród³owe w OCamlu
244 Group:          Development/Languages
245 Requires:       %{name} = %{version}-%{release}
246
247 %description examples
248 This packages contains sources for Okasaki's Purely Functional 
249 Datastructures in OCaml, along with some contributions.
250
251 %description examples -l pl
252 Pakiet ten zawiera ¼ród³a Czysto-Funkcjonalnych Struktur Danych 
253 Okasaki'ego, prze³o¿one na OCamla, wraz z dodatkami.
254
255 %prep
256 %setup -q -T -b 0
257 %setup -q -T -D -a 1
258 # order mess with docs somewhat
259 mkdir docs
260 mkdir docs/html
261 mv htmlman docs/html/ocaml
262 cp %{SOURCE2} docs/ocaml.ps.gz
263 %setup -q -T -D -a 3
264 mv camlp4-%{version}-manual.html docs/html/camlp4
265 cp %{SOURCE4} docs/camlp4.ps.gz
266 %setup -q -T -D -a 5
267 mv camlp4-%{version}-tutorial.html docs/html/camlp4-tutorial
268 cp %{SOURCE6} docs/camlp4-tutorial.ps.gz
269 mkdir examples
270 cd examples
271 %setup -q -T -D -a 6
272 %setup -q -T -D -a 7
273 cd ..
274 %patch0 -p1
275 %patch1 -p1
276 %patch2 -p1
277 %patch3 -p1
278 #%patch4 -p1
279 %patch5 -p1
280
281 %build
282 ./configure \
283         -cc "%{__cc} %{rpmcflags}" \
284         -bindir %{_bindir} \
285         -libdir %{_libdir}/%{name} \
286         -mandir %{_mandir}/man1 \
287         -host %{_host} \
288         %{?_without_tk:-notk} \
289         -with-pthread
290
291 %{__make} world bootstrap opt.opt
292 %{__make} -C tools objinfo
293
294 %install
295 rm -rf $RPM_BUILD_ROOT
296
297 %{__make} install \
298         BINDIR=$RPM_BUILD_ROOT%{_bindir} \
299         LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{name} \
300         MANDIR=$RPM_BUILD_ROOT%{_mandir}
301
302 cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF
303 %{_libdir}/%{name}/stublibs
304 %{_libdir}/%{name}
305 EOF
306
307 %if %{!?_without_emacs:1}%{?_without_emacs:0}
308 %{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
309         EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
310                 else echo xemacs; fi`" \
311         EMACSDIR="$RPM_BUILD_ROOT%{_libdir}/emacs/site-lisp"
312 %endif
313
314 # symlink .opt versions of compilers (if present)
315 # warning: don't do that with camlp4 (can't load extensions then)
316 for f in ocamlc ocamlopt ocamldoc ocamllex; do
317         if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
318                 mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
319                         $RPM_BUILD_ROOT%{_bindir}/$f.byte
320                 ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
321         fi
322 done
323
324 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.mli
325 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*/*.ml{,i}
326
327 # move includes to the proper place
328 install -d $RPM_BUILD_ROOT%{_includedir}
329 mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
330 # but leave compatibility symlink
331 ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml
332
333 # compiled sources of compiler, needed by some programs
334 for f in {asm,byte}comp parsing typing utils ; do
335         install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
336         cp $f/*.{cmi,cmo,cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
337 done
338
339 # this isn't installed by default, but is useful
340 install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
341
342 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
343 cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
344
345 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
346 cp -r otherlibs/labltk/examples* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
347
348 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
349
350 # shutup checkfiles
351 rm -rf $RPM_BUILD_ROOT%{_mandir}/man3
352 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/labltk/{labltktop,pp}
353
354 %clean
355 rm -rf $RPM_BUILD_ROOT
356
357 %files runtime
358 %defattr(644,root,root,755)
359 %attr(755,root,root) %{_bindir}/ocamlrun
360 %dir %{_libdir}/%{name}
361 %dir %{_libdir}/%{name}/stublibs
362 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dll*.so
363 %exclude %{_libdir}/%{name}/stublibs/dllgraphics.so
364 %exclude %{_libdir}/%{name}/stublibs/dlllabltk.so
365 %exclude %{_libdir}/%{name}/stublibs/dlltkanim.so
366
367 %files
368 %defattr(644,root,root,755)
369 %doc LICENSE Changes README Upgrading
370 %doc docs/html/ocaml
371 %attr(755,root,root) %{_bindir}/ocaml*
372 %exclude %{_bindir}/ocamlbrowser
373 %exclude %{_bindir}/ocamlrun
374 %attr(755,root,root) %{_bindir}/*labels
375 %{_includedir}/caml
376 %{_libdir}/%{name}/caml
377 %{_libdir}/%{name}/threads
378 %{_libdir}/%{name}/*.a
379 %{_libdir}/%{name}/*.o
380 %{_libdir}/%{name}/*.cm*
381 %exclude %{_libdir}/%{name}/*graphics*
382 %{_libdir}/%{name}/ld.conf
383 %{_libdir}/%{name}/camlheader
384 %{_libdir}/%{name}/camlheader_ur
385 %dir %{_libdir}/%{name}/ocamldoc
386 %{_libdir}/%{name}/ocamldoc/*.sty
387 %{_libdir}/%{name}/ocamldoc/*.hva
388 %attr(755,root,root) %{_libdir}/%{name}/expunge
389 %attr(755,root,root) %{_libdir}/%{name}/extract_crc
390 %attr(755,root,root) %{_libdir}/%{name}/*labels
391 %{_mandir}/man1/*ocaml*
392
393 %files lib-source
394 %defattr(644,root,root,755)
395 %{_libdir}/%{name}/*.ml
396
397 %files examples
398 %{_examplesdir}/%{name}-%{version}
399
400 # they are poor, html is much better
401 #%files manpages
402 #%{_mandir}/man3/*
403
404 %files devel
405 %defattr(644,root,root,755)
406 %{_libdir}/%{name}/compiler
407
408 %files camlp4
409 %defattr(644,root,root,755)
410 %doc docs/html/camlp4*
411 %attr(755,root,root) %{_bindir}/*camlp4*
412 %attr(755,root,root) %{_bindir}/ocpp
413 # Not installed since 3.05, is is needed?
414 #%attr(755,root,root) %{_bindir}/odyl
415 %{_libdir}/%{name}/camlp4
416 %{_mandir}/man*/*camlp4*
417 %{_mandir}/man*/*ocpp*
418
419 %if %{!?_without_tk:1}%{?_without_tk:0}
420 %files labltk-devel
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{_bindir}/labltk
423 %attr(755,root,root) %{_bindir}/ocamlbrowser
424 %dir %{_libdir}/%{name}/labltk
425 %{_libdir}/%{name}/labltk/*.cm*
426 %{_libdir}/%{name}/labltk/*.a
427 %attr(755,root,root) %{_libdir}/%{name}/labltk/tkcompiler
428 %{_examplesdir}/%{name}-labltk-%{version}
429
430 %files labltk
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dlllabltk.so
433 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dlltkanim.so
434 %endif
435
436 %if %{!?_without_x11:1}%{?_without_x11:0}
437 %files x11graphics-devel
438 %defattr(644,root,root,755)
439 %{_libdir}/%{name}/graphics*.cm*
440 %{_libdir}/%{name}/graphics.a
441 %{_libdir}/%{name}/libgraphics.a
442
443 %files x11graphics
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dllgraphics.so
446 %endif
447
448 %if %{!?_without_emacs:1}%{?_without_emacs:0}
449 %files emacs
450 %defattr(644,root,root,755)
451 %{_libdir}/emacs/site-lisp/*.el*
452 %endif
453
454 %files ocamldoc-devel
455 %defattr(644,root,root,755)
456 %{_libdir}/%{name}/ocamldoc/*.cm*
457 %{_libdir}/%{name}/ocamldoc/*.a
458
459 %files doc-ps
460 %defattr(644,root,root,755)
461 %doc docs/*.ps.gz
This page took 0.070773 seconds and 4 git commands to generate.