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