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