]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml.spec
- added builidng also optimized camlp4
[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 Caml oraz ¶rodowisko programistyczne
11 Name:           ocaml
12 Version:        3.04
13 Release:        4
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 URL:            http://caml.inria.fr/
30 BuildRequires:  db3-devel
31 %{!?_without_tk:BuildRequires:          tk-devel}
32 %{!?_without_x11:BuildRequires:         XFree86-devel}
33 %{!?_without_emacs:BuildRequires:       xemacs-common}
34 %{!?_without_emacs:BuildRequires:       xemacs-fsf-compat-pkg}
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 Objective Caml is a high-level, strongly-typed, functional and
39 object-oriented programming language from the ML family of languages.
40
41 This package comprises two batch compilers (a fast bytecode compiler
42 and an optimizing native-code compiler), an interactive toplevel
43 system, Lex&Yacc tools, a replay debugger, and a comprehensive
44 library.
45
46 %description -l pl
47 Objektowy Caml jest funkcjonalnym, obiektowo zorientowanym jêzykiem
48 wysokiego poziomu z rodziny jêzyków ML.
49
50 Ten pakiet zawiera dwa kompilatory (szybki kompilator bytecode oraz
51 zoptymalizowany natywny kompilator), interaktywny g³ówny system,
52 narzêdzia Lex&Yacc, odpluskwiacz i biblioteki.
53
54 %package doc-ps
55 Summary:        PostScript documentation for OCaml
56 Summary(pl):    Dokumentacja dla OCaml-a w formacie PostSript
57 Group:          Development/Tools
58 Requires:       %{name} = %{version}
59
60 %description doc-ps
61 PostScript documentation for OCaml
62
63 %description doc-ps -l pl
64 Dokumentacja dla OCaml-a w formacie PostSript
65
66 %package doc-html
67 Summary:        HTML documentation for OCaml
68 Summary(pl):    Dokumentacja dla OCaml-a w formacie HTML
69 Group:          Development/Tools
70 Requires:       %{name} = %{version}
71
72 %description doc-html
73 HTML documentation for OCaml
74
75 %description doc-html -l pl
76 Dokumentacja dla OCaml-a w formacie HTML
77
78 %package emacs
79 Summary:        Emacs mode for OCaml
80 Summary(pl):    Tryb Emacsa dla OCaml
81 Group:          Development/Tools
82 Requires:       %{name} = %{version}
83
84 %description emacs
85 Emacs mode files for Objective Caml language
86
87 %description emacs -l pl
88 Pliki trybu Emacsa dla jêzyka Objektowego Caml
89
90 %package labltk
91 Summary:        LabelTk library for OCaml
92 Summary(pl):    Biblioteka LablTk dla OCamla
93 Group:          Development/Libraries
94 Requires:       %{name} = %{version}
95
96 %description labltk
97 LablTk gives OCaml program access to Tcl/Tk GUI widgets.
98
99 %description labltk -l pl
100 Biblioteka LablTk daje programom napisanym w OCamlu dostêp do widgetów
101 Tcl/Tk.
102
103 %package x11graphics
104 Summary:        X11 graphic output for OCaml
105 Summary(pl):    Iksowe wyj¶cie graficzne dla OCamla
106 Group:          Development/Libraries
107 Requires:       %{name} = %{version}
108
109 %description x11graphics
110 This package gives OCaml program access to drawing in X11 windows.
111
112 %description x11graphics -l pl
113 Ten pakiet daje programom napisanym w OCamlu dostêp do rysowania po
114 oknach X11.
115
116 %package camlp4
117 Summary:        Objective Caml Preprocessor
118 Summary(pl):    Preprocesor Ocamla
119 Group:          Development/Languages
120 Requires:       %{name} = %{version}
121 Provides:       camlp4 = %{version}
122 Obsoletes:      camlp4
123
124 %description camlp4
125 Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers
126 tools for syntax (grammars) and the ability to modify the concrete
127 syntax of the language (quotations, syntax extensions).
128
129 Camlp4 can parse normal Ocaml concrete syntax or any other
130 user-definable syntax. As an example, an alternative syntax is
131 provided, named revised, because it tries to fix some small problems
132 of the normal syntax.
133
134 Camlp4 can pretty print the normal Ocaml concrete syntax or the
135 revised one. It is therefore always possible to have a version of your
136 sources compilable by the compiler Objective Caml without
137 preprocessing.
138
139 %description camlp4 -l pl
140 Camlp4 jest preprocesorem dla Ocamla. Oferuje narzêdzia do sk³adni
141 (gramatyki) oraz umiejêtno¶æ modyfikowania konkretnej sk³adni jêzyka
142 (cytowania, rozszerzenia).
143
144 Camlp4 mo¿e sparsowaæ normaln± sk³adniê Ocamla lub inn± dowoln±
145 definiowaln± przez u¿ytkownika. Jako przyk³ad jest podana alternatywna
146 sk³adnia, nazwana "poprawiona", poniewa¿ próbuje poprawiæ drobne
147 problemy ze zwyk³± sk³adni±.
148
149 Camlp4 umie ³adnie wypisaæ normaln± sk³adniê Camla lub "poprawion±".
150 Dziêki temu jest mo¿liwe posiadanie wersji swoich ¼róde³
151 kompilowalnych przez kompilatora Ocamla bez preprocesingu.
152
153 %prep
154 %setup -q -T -b 0
155 %setup -q -T -D -a 1
156 %setup -q -T -D -a 2
157 # order mess with docs somewhat
158 mkdir docs
159 mkdir docs/html
160 mv htmlman docs/html/ocaml
161 cp %{SOURCE3} docs/ocaml.ps.gz
162 %setup -q -T -D -a 4
163 mv camlp4-%{version}-refman.html docs/html/camlp4
164 cp %{SOURCE5} docs/camlp4.ps.gz
165 %setup -q -T -D -a 6
166 mv camlp4-%{version}-tutorial.html docs/html/camlp4-tutorial
167 cp %{SOURCE7} docs/camlp4-tutorial.ps.gz
168
169 %patch0 -p1
170 %patch1 -p1
171 %patch2 -p1
172 %patch3 -p1
173
174 %build
175 ./configure \
176         -cc "%{__cc} %{rpmcflags}" \
177         -bindir %{_bindir} \
178         -libdir %{_libdir}/%{name} \
179         -mandir %{_mandir}/man1 \
180         -host %{_host} \
181         %{?_without_tk:-notk} \
182         -with-pthread
183
184 # this is crude hack (works in addition to ocaml-db3.patch)
185 cp config/Makefile config/Makefile.tmp
186 sed -e 's|-ldb1|-ldb|; s|-I%{_includedir}/db1||' < config/Makefile.tmp > config/Makefile
187
188 %{__make} world bootstrap opt ocamlc.opt ocamlopt.opt
189 %{__make} -C camlp4 optp4
190
191 # hack info pages to contain dir entry
192 cat <<EOF >infoman/ocaml.info
193 INFO-DIR-SECTION Programming Languages:
194 START-INFO-DIR-ENTRY
195 * Ocaml: (ocaml).                             The Ocaml language
196 END-INFO-DIR-ENTRY
197 EOF
198 zcat infoman/ocaml.info.gz >> infoman/ocaml.info
199
200 gzip -9nf infoman/ocaml.info
201
202 %install
203 rm -rf $RPM_BUILD_ROOT
204 install -d $RPM_BUILD_ROOT%{_infodir}
205
206 %{__make} install DESTDIR=$RPM_BUILD_ROOT
207
208 %if %{!?_without_emacs:1}%{?_without_emacs:0}
209 %{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
210         EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
211                 else echo xemacs; fi`" \
212         EMACSDIR="%{_libdir}/emacs/site-lisp"
213 %endif
214
215 cp -p {parsing/{location,longident,parsetree},typing/typecore}.{cm,ml}i \
216         $RPM_BUILD_ROOT%{_libdir}/%{name}
217
218 for f in ocamlc ocamlopt camlp4o camlp4r; do
219         mv -f $RPM_BUILD_ROOT%{_bindir}/$f $RPM_BUILD_ROOT%{_bindir}/$f.byte
220         ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
221 done
222
223 rm -f $RPM_BUILD_ROOT%{_libdir}/%{_name}/*.ml
224 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
225
226 install infoman/*info* $RPM_BUILD_ROOT%{_infodir}
227
228 gzip -9nf LICENSE Changes README Upgrading
229
230 %clean
231 rm -rf $RPM_BUILD_ROOT
232
233 %post
234 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
235
236 %postun
237 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
238
239
240 %files
241 %defattr(644,root,root,755)
242 %doc *.gz
243 %attr(755,root,root) %{_bindir}/ocaml
244 %attr(755,root,root) %{_bindir}/ocaml[cmdlopry]*
245 %attr(755,root,root) %{_bindir}/*labels
246 %{_libdir}/%{name}/caml
247 %{_libdir}/%{name}/threads
248 %{_libdir}/%{name}/[abefhimnopqrstuw]*.*
249 %{_libdir}/%{name}/callback.*
250 %{_libdir}/%{name}/char.*
251 %{_libdir}/%{name}/condition.*
252 %{_libdir}/%{name}/dbm.*
253 %{_libdir}/%{name}/digest.*
254 %attr(755,root,root) %{_libdir}/%{name}/dll[bmnstu]*.so
255 %{_libdir}/%{name}/g[ce]*.*
256 %{_libdir}/%{name}/l*.cm*
257 %{_libdir}/%{name}/l*.mli
258 %{_libdir}/%{name}/lib[abc]*.a
259 %{_libdir}/%{name}/libmldbm.a
260 %{_libdir}/%{name}/lib[nstu]*.a
261 %{_libdir}/%{name}/ld.conf
262 %attr(755,root,root) %{_libdir}/%{name}/expunge
263 %attr(755,root,root) %{_libdir}/%{name}/extract_crc
264 %{_libdir}/%{name}/camlheader
265 %{_libdir}/%{name}/camlheader_ur
266 %attr(755,root,root) %{_libdir}/%{name}/*labels
267 %{_mandir}/man*/*ocaml*
268 %{_infodir}/*
269
270 %files camlp4
271 %defattr(644,root,root,755)
272 %attr(755,root,root) %{_bindir}/*camlp4*
273 %attr(755,root,root) %{_bindir}/ocpp
274 %attr(755,root,root) %{_bindir}/odyl
275 %{_libdir}/%{name}/camlp4
276 %{_mandir}/man*/*camlp4*
277 %{_mandir}/man*/*ocpp*
278
279 %if %{!?_without_tk:1}%{?_without_tk:0}
280 %files labltk
281 %defattr(644,root,root,755)
282 %attr(755,root,root) %{_bindir}/labltk
283 %attr(755,root,root) %{_bindir}/ocamlbrowser
284 %dir %{_libdir}/%{name}/labltk
285 %{_libdir}/%{name}/labltk/*.cm*
286 %{_libdir}/%{name}/labltk/*.a
287 %{_libdir}/%{name}/labltk/*.mli
288 %attr(755,root,root) %{_libdir}/%{name}/labltk/*.so
289 %attr(755,root,root) %{_libdir}/%{name}/labltk/labltktop
290 %attr(755,root,root) %{_libdir}/%{name}/labltk/tkcompiler
291 %endif
292
293 %if %{!?_without_x11:1}%{?_without_x11:0}
294 %files x11graphics
295 %defattr(644,root,root,755)
296 %{_libdir}/%{name}/graphics*
297 %{_libdir}/%{name}/libgraphics.a
298 %attr(755,root,root) %{_libdir}/%{name}/dllgraphics.so
299 %endif
300
301 %if %{!?_without_emacs:1}%{?_without_emacs:0}
302 %files emacs
303 %defattr(644,root,root,755)
304 %{_libdir}/emacs/site-lisp/*.el
305 %endif
306
307 %files doc-ps
308 %defattr(644,root,root,755)
309 %doc docs/*.ps.gz
310
311 %files doc-html
312 %defattr(644,root,root,755)
313 %doc docs/html/*
This page took 0.0583939999999999 seconds and 4 git commands to generate.