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