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