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