]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml.spec
- fixed examples
[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 set -x
257 %setup -q -T -b 0
258 %setup -q -T -D -a 1
259 %setup -q -T -D -c -n %{name}-%{version}/examples -a 7
260 %setup -q -T -D -c -n %{name}-%{version}/examples -a 8
261 %setup -q -T -D -n %{name}-%{version} -a 3
262 %setup -q -T -D -n %{name}-%{version} -a 5
263 # order mess with docs somewhat
264 mkdir docs
265 mkdir docs/html
266 mv htmlman docs/html/ocaml
267 cp %{SOURCE2} docs/ocaml.ps.gz
268 mv camlp4-%{version}-manual.html docs/html/camlp4
269 cp %{SOURCE4} docs/camlp4.ps.gz
270 mv camlp4-%{version}-tutorial.html docs/html/camlp4-tutorial
271 cp %{SOURCE6} docs/camlp4-tutorial.ps.gz
272 %patch0 -p1
273 %patch1 -p1
274 %patch2 -p1
275 %patch3 -p1
276 #%patch4 -p1
277 %patch5 -p1
278
279 %build
280 ./configure \
281         -cc "%{__cc} %{rpmcflags}" \
282         -bindir %{_bindir} \
283         -libdir %{_libdir}/%{name} \
284         -mandir %{_mandir}/man1 \
285         -host %{_host} \
286         %{?_without_tk:-notk} \
287         -with-pthread
288
289 %{__make} world bootstrap opt.opt
290 %{__make} -C tools objinfo
291
292 %install
293 rm -rf $RPM_BUILD_ROOT
294
295 %{__make} install \
296         BINDIR=$RPM_BUILD_ROOT%{_bindir} \
297         LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{name} \
298         MANDIR=$RPM_BUILD_ROOT%{_mandir}
299
300 cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF
301 %{_libdir}/%{name}/stublibs
302 %{_libdir}/%{name}
303 EOF
304
305 %if %{!?_without_emacs:1}%{?_without_emacs:0}
306 %{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
307         EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
308                 else echo xemacs; fi`" \
309         EMACSDIR="$RPM_BUILD_ROOT%{_libdir}/emacs/site-lisp"
310 %endif
311
312 # symlink .opt versions of compilers (if present)
313 # warning: don't do that with camlp4 (can't load extensions then)
314 for f in ocamlc ocamlopt ocamldoc ocamllex; do
315         if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
316                 mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
317                         $RPM_BUILD_ROOT%{_bindir}/$f.byte
318                 ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
319         fi
320 done
321
322 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.mli
323 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*/*.ml{,i}
324
325 # move includes to the proper place
326 install -d $RPM_BUILD_ROOT%{_includedir}
327 mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
328 # but leave compatibility symlink
329 ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml
330
331 # compiled sources of compiler, needed by some programs
332 for f in {asm,byte}comp parsing typing utils ; do
333         install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
334         cp $f/*.{cmi,cmo,cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
335 done
336
337 # this isn't installed by default, but is useful
338 install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
339
340 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
341 cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
342
343 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
344 cp -r otherlibs/labltk/examples* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
345
346 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
347
348 # shutup checkfiles
349 rm -rf $RPM_BUILD_ROOT%{_mandir}/man3
350 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/labltk/{labltktop,pp}
351
352 %clean
353 rm -rf $RPM_BUILD_ROOT
354
355 %files runtime
356 %defattr(644,root,root,755)
357 %attr(755,root,root) %{_bindir}/ocamlrun
358 %dir %{_libdir}/%{name}
359 %dir %{_libdir}/%{name}/stublibs
360 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dll*.so
361 %exclude %{_libdir}/%{name}/stublibs/dllgraphics.so
362 %exclude %{_libdir}/%{name}/stublibs/dlllabltk.so
363 %exclude %{_libdir}/%{name}/stublibs/dlltkanim.so
364
365 %files
366 %defattr(644,root,root,755)
367 %doc LICENSE Changes README Upgrading
368 %doc docs/html/ocaml
369 %attr(755,root,root) %{_bindir}/ocaml*
370 %exclude %{_bindir}/ocamlbrowser
371 %exclude %{_bindir}/ocamlrun
372 %attr(755,root,root) %{_bindir}/*labels
373 %{_includedir}/caml
374 %{_libdir}/%{name}/caml
375 %{_libdir}/%{name}/threads
376 %{_libdir}/%{name}/*.a
377 %{_libdir}/%{name}/*.o
378 %{_libdir}/%{name}/*.cm*
379 %exclude %{_libdir}/%{name}/*graphics*
380 %{_libdir}/%{name}/ld.conf
381 %{_libdir}/%{name}/camlheader
382 %{_libdir}/%{name}/camlheader_ur
383 %dir %{_libdir}/%{name}/ocamldoc
384 %{_libdir}/%{name}/ocamldoc/*.sty
385 %{_libdir}/%{name}/ocamldoc/*.hva
386 %attr(755,root,root) %{_libdir}/%{name}/expunge
387 %attr(755,root,root) %{_libdir}/%{name}/extract_crc
388 %attr(755,root,root) %{_libdir}/%{name}/*labels
389 %{_mandir}/man1/*ocaml*
390
391 %files lib-source
392 %defattr(644,root,root,755)
393 %{_libdir}/%{name}/*.ml
394
395 %files examples
396 %{_examplesdir}/%{name}-%{version}
397
398 # they are poor, html is much better
399 #%files manpages
400 #%{_mandir}/man3/*
401
402 %files devel
403 %defattr(644,root,root,755)
404 %{_libdir}/%{name}/compiler
405
406 %files camlp4
407 %defattr(644,root,root,755)
408 %doc docs/html/camlp4*
409 %attr(755,root,root) %{_bindir}/*camlp4*
410 %attr(755,root,root) %{_bindir}/ocpp
411 # Not installed since 3.05, is is needed?
412 #%attr(755,root,root) %{_bindir}/odyl
413 %{_libdir}/%{name}/camlp4
414 %{_mandir}/man*/*camlp4*
415 %{_mandir}/man*/*ocpp*
416
417 %if %{!?_without_tk:1}%{?_without_tk:0}
418 %files labltk-devel
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_bindir}/labltk
421 %attr(755,root,root) %{_bindir}/ocamlbrowser
422 %dir %{_libdir}/%{name}/labltk
423 %{_libdir}/%{name}/labltk/*.cm*
424 %{_libdir}/%{name}/labltk/*.a
425 %attr(755,root,root) %{_libdir}/%{name}/labltk/tkcompiler
426 %{_examplesdir}/%{name}-labltk-%{version}
427
428 %files labltk
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dlllabltk.so
431 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dlltkanim.so
432 %endif
433
434 %if %{!?_without_x11:1}%{?_without_x11:0}
435 %files x11graphics-devel
436 %defattr(644,root,root,755)
437 %{_libdir}/%{name}/graphics*.cm*
438 %{_libdir}/%{name}/graphics.a
439 %{_libdir}/%{name}/libgraphics.a
440
441 %files x11graphics
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dllgraphics.so
444 %endif
445
446 %if %{!?_without_emacs:1}%{?_without_emacs:0}
447 %files emacs
448 %defattr(644,root,root,755)
449 %{_libdir}/emacs/site-lisp/*.el*
450 %endif
451
452 %files ocamldoc-devel
453 %defattr(644,root,root,755)
454 %{_libdir}/%{name}/ocamldoc/*.cm*
455 %{_libdir}/%{name}/ocamldoc/*.a
456
457 %files doc-ps
458 %defattr(644,root,root,755)
459 %doc docs/*.ps.gz
This page took 0.063064 seconds and 4 git commands to generate.