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