]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without emacs # without emacs subpackage | |
4 | %bcond_without x # without X11 support | |
5 | %bcond_without opt # don't build native, optimized compiler | |
6 | ||
7 | %ifarch x32 | |
8 | %undefine with_opt | |
9 | %endif | |
10 | ||
11 | %define sver 4.02 | |
12 | ||
13 | Summary: The Objective Caml compiler and programming environment | |
14 | Summary(pl.UTF-8): Kompilator OCamla (Objective Caml) oraz środowisko programistyczne | |
15 | Name: ocaml | |
16 | Version: 4.02.1 | |
17 | Release: 3 | |
18 | Epoch: 1 | |
19 | License: QPL v1.0 with linking exception (compiler), LGPL v2 with linking exception (library) | |
20 | Group: Development/Languages | |
21 | Source0: http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{version}.tar.xz | |
22 | # Source0-md5: d74ac1b1179af362491e14349dd1958b | |
23 | Source1: http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman-html.tar.gz | |
24 | # Source1-md5: 915a1949f7af7186e16354e9682dc1e5 | |
25 | Source2: http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman.ps.gz | |
26 | # Source2-md5: e85016fa23b6525d1d10da06010fd90a | |
27 | Source3: http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman.info.tar.gz | |
28 | # Source3-md5: 265b7db123e925e8b7b70ca2266b4206 | |
29 | Source4: https://github.com/mmottl/pure-fun/archive/v1.0.13/pure-fun-1.0.13.tar.gz | |
30 | # Source4-md5: 0a6ff033df78d0880fe4883ace025ebe | |
31 | # note: dead URL | |
32 | Source5: http://www.ocaml.info/ocaml_sources/ds-contrib.tar.gz | |
33 | # Source5-md5: 77fa1da7375dea1393cc0b6cd802d7e1 | |
34 | Patch1: %{name}-CFLAGS.patch | |
35 | Patch2: %{name}-as_needed.patch | |
36 | Patch3: x32.patch | |
37 | URL: http://caml.inria.fr/ | |
38 | %{?with_x:BuildRequires: xorg-lib-libX11-devel} | |
39 | %if %{with emacs} | |
40 | BuildRequires: sed >= 4.0 | |
41 | BuildRequires: emacs | |
42 | BuildRequires: emacs-common | |
43 | %endif | |
44 | Requires: %{name}-runtime = %{epoch}:%{version}-%{release} | |
45 | Provides: ocaml-bytes-devel | |
46 | Provides: ocaml-ocamldoc | |
47 | Obsoletes: ocaml-ocamldoc | |
48 | Obsoletes: ocaml-bytes-devel | |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
50 | ||
51 | %define specflags -fno-strict-aliasing | |
52 | ||
53 | %description | |
54 | Objective Caml is a high-level, strongly-typed, functional and | |
55 | object-oriented programming language from the ML family of languages. | |
56 | ||
57 | This package comprises two batch compilers (a fast bytecode compiler | |
58 | and an optimizing native-code compiler), an interactive toplevel | |
59 | system, Lex&Yacc tools, a replay debugger, and a comprehensive | |
60 | library. | |
61 | ||
62 | %description -l pl.UTF-8 | |
63 | OCaml (Objective Caml) jest funkcyjnym, obiektowo zorientowanym | |
64 | językiem wysokiego poziomu z silnym typowaniem. Należy do rodziny | |
65 | języków ML. | |
66 | ||
67 | Ten pakiet zawiera dwa kompilatory (szybki kompilator do bajtkodu | |
68 | oraz optymalizujący kompilator do kodu natywnego), interaktywne | |
69 | środowisko pracy, narzędzia do tworzenia analizatorów leksykalnych | |
70 | oraz składniowych (ocamllex, ocamlyacc), odpluskwiacz (ocamldebug) i | |
71 | biblioteki. | |
72 | ||
73 | %package runtime | |
74 | Summary: Runtime system for OCaml | |
75 | Summary(pl.UTF-8): Środowisko uruchomieniowe dla OCamla | |
76 | Group: Libraries | |
77 | ||
78 | %description runtime | |
79 | This package contains binaries needed to run bytecode OCaml programs: | |
80 | ocamlrun bytecode interpreter, and basic dynamic link libraries. | |
81 | ||
82 | %description runtime -l pl.UTF-8 | |
83 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów w | |
84 | OCamlu skompilowanych do bajtkodu: interpreter bajtkodu (ocamlrun) | |
85 | oraz podstawowe biblioteki linkowane dynamicznie. | |
86 | ||
87 | %package lib-source | |
88 | Summary: Sources of OCaml standard library | |
89 | Summary(pl.UTF-8): Źródła biblioteki standardowej OCamla | |
90 | Group: Development/Languages | |
91 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
92 | ||
93 | %description lib-source | |
94 | This sources come helpful during debugging of user programs with | |
95 | ocamldebug. | |
96 | ||
97 | %description lib-source -l pl.UTF-8 | |
98 | Źródła te są przydatne przy odpluskwianiu programów użytkownika | |
99 | z użyciem ocamldebug. | |
100 | ||
101 | %package doc-html | |
102 | Summary: HTML documentation for OCaml | |
103 | Summary(pl.UTF-8): Dokumentacja dla OCamla w formacie HTML | |
104 | Group: Development/Tools | |
105 | ||
106 | %description doc-html | |
107 | HTML documentation for OCaml. | |
108 | ||
109 | %description doc-html -l pl.UTF-8 | |
110 | Dokumentacja dla OCamla w formacie HTML. | |
111 | ||
112 | %package doc-ps | |
113 | Summary: PostScript documentation for OCaml | |
114 | Summary(pl.UTF-8): Dokumentacja dla OCamla w formacie PostScript | |
115 | Group: Development/Tools | |
116 | ||
117 | %description doc-ps | |
118 | PostScript documentation for OCaml. | |
119 | ||
120 | %description doc-ps -l pl.UTF-8 | |
121 | Dokumentacja dla OCamla w formacie PostScript. | |
122 | ||
123 | %package doc-info | |
124 | Summary: Info documentation for OCaml | |
125 | Summary(pl.UTF-8): Dokumentacja info dla OCamla | |
126 | Group: Development/Tools | |
127 | ||
128 | %description doc-info | |
129 | Info documentation for OCaml. | |
130 | ||
131 | %description doc-info -l pl.UTF-8 | |
132 | Dokumentacja info dla OCamla. | |
133 | ||
134 | %package emacs | |
135 | Summary: Emacs mode for OCaml | |
136 | Summary(pl.UTF-8): Tryb OCamla dla Emacsa | |
137 | Group: Development/Tools | |
138 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
139 | ||
140 | %description emacs | |
141 | Emacs mode files for Objective Caml language. | |
142 | ||
143 | %description emacs -l pl.UTF-8 | |
144 | Pliki trybu OCamla dla Emacsa. | |
145 | ||
146 | %package x11graphics | |
147 | Summary: X11 graphic output for OCaml | |
148 | Summary(pl.UTF-8): Dostęp do X11 dla OCamla | |
149 | Group: Development/Libraries | |
150 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
151 | ||
152 | %description x11graphics | |
153 | x11graphics module gives OCaml program access to drawing in X11 | |
154 | windows. This package contains files needed to run bytecode OCaml | |
155 | programs using x11graphics. | |
156 | ||
157 | %description x11graphics -l pl.UTF-8 | |
158 | Moduł x11graphics daje programom napisanym w OCamlu możliwość | |
159 | korzystania z interfejsu graficznego X11. Pakiet ten zawiera binaria | |
160 | potrzebne do uruchamiania programów używających x11graphics. | |
161 | ||
162 | %package x11graphics-devel | |
163 | Summary: X11 graphic output for OCaml | |
164 | Summary(pl.UTF-8): Dostęp do X11 dla OCamla | |
165 | Group: Development/Libraries | |
166 | Requires: %{name}-x11graphics = %{epoch}:%{version}-%{release} | |
167 | ||
168 | %description x11graphics-devel | |
169 | x11graphics module gives OCaml program access to drawing in X11 | |
170 | windows. This package contains files needed to develop OCaml programs | |
171 | using x11graphics. | |
172 | ||
173 | %description x11graphics-devel -l pl.UTF-8 | |
174 | Moduł x11graphics daje programom napisanym w OCamlu możliwość | |
175 | korzystania z interfejsu graficznego X11. Pakiet ten zawiera pliki | |
176 | niezbędne do tworzenia programów używających x11graphics. | |
177 | ||
178 | %package compiler-objects | |
179 | Summary: Compiled parts of OCaml compiler | |
180 | Summary(pl.UTF-8): Skompilowane części kompilatora OCamla | |
181 | Group: Development/Languages | |
182 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
183 | Obsoletes: ocaml-devel | |
184 | Provides: ocaml-devel | |
185 | ||
186 | %description compiler-objects | |
187 | This package contains *.cmi and *.cmo files being parts of OCaml | |
188 | compiler. They are needed to compile some programs. | |
189 | ||
190 | %description compiler-objects -l pl.UTF-8 | |
191 | Pakiet ten zawiera pliki *.cmi oraz *.cmo będące częściami kompilatora | |
192 | OCamla. Są one wymagane do kompilacji niektórych programów. | |
193 | ||
194 | %package ocamldoc-devel | |
195 | Summary: Files needed to develop programs using ocamldoc | |
196 | Summary(pl.UTF-8): Pliki potrzebne do tworzenia programów używających ocamldoc | |
197 | Group: Development/Languages | |
198 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
199 | ||
200 | %description ocamldoc-devel | |
201 | You need this package if you are going to write ocamldoc front end or | |
202 | something like that. | |
203 | ||
204 | %description ocamldoc-devel -l pl.UTF-8 | |
205 | Będziesz potrzebować tego pakietu, jeśli zamierzasz pisać front end | |
206 | dla ocamldoc lub coś podobnego. | |
207 | ||
208 | # maybe we'll want to add some more stuff here? | |
209 | %package examples | |
210 | Summary: Example source code for OCaml | |
211 | Summary(pl.UTF-8): Przykładowe kody źródłowe w OCamlu | |
212 | Group: Development/Languages | |
213 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
214 | ||
215 | %description examples | |
216 | This packages contains sources for Okasaki's Purely Functional | |
217 | Datastructures in OCaml, along with some contributions. | |
218 | ||
219 | %description examples -l pl.UTF-8 | |
220 | Pakiet ten zawiera źródła Czysto Funkcyjnych Struktur Danych | |
221 | autorstwa Okasaki'ego, napisane w OCamlu, wraz z dodatkami. | |
222 | ||
223 | %prep | |
224 | %setup -q -a1 -a3 | |
225 | mkdir examples | |
226 | tar xzf %{SOURCE4} -C examples | |
227 | tar xzf %{SOURCE5} -C examples | |
228 | # order mess with docs somewhat | |
229 | mkdir -p docs/html | |
230 | mv htmlman docs/html/ocaml | |
231 | cp %{SOURCE2} docs/ocaml.ps.gz | |
232 | %patch1 -p1 | |
233 | %patch2 -p1 | |
234 | %patch3 -p1 | |
235 | ||
236 | %build | |
237 | cp -f /usr/share/automake/config.sub config/gnu | |
238 | ./configure \ | |
239 | -host %{_target_platform} \ | |
240 | -cc "%{__cc}" \ | |
241 | -bindir %{_bindir} \ | |
242 | -libdir %{_libdir}/%{name} \ | |
243 | -mandir %{_mandir}/man1 \ | |
244 | -with-pthread \ | |
245 | -x11lib %{_libdir} | |
246 | ||
247 | %{__make} -j1 world bootstrap %{?with_opt:opt.opt} \ | |
248 | CFLAGS="%{rpmcflags} -Wall -DUSE_INTERP_RESULT" | |
249 | ||
250 | %{__make} -C tools objinfo \ | |
251 | CFLAGS="%{rpmcflags} -Wall -DUSE_INTERP_RESULT" -j1 | |
252 | ||
253 | %install | |
254 | rm -rf $RPM_BUILD_ROOT | |
255 | install -d $RPM_BUILD_ROOT{%{_includedir},%{_infodir},%{_examplesdir}/%{name}-%{version}} | |
256 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/site-lib | |
257 | ||
258 | %{__make} install \ | |
259 | BINDIR=$RPM_BUILD_ROOT%{_bindir} \ | |
260 | LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{name} \ | |
261 | MANDIR=$RPM_BUILD_ROOT%{_mandir} | |
262 | ||
263 | cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF | |
264 | %{_libdir}/%{name}/stublibs | |
265 | %{_libdir}/%{name} | |
266 | EOF | |
267 | ||
268 | %if %{with emacs} | |
269 | %{__make} -C emacs install \ | |
270 | DESTDIR=$RPM_BUILD_ROOT \ | |
271 | EMACSDIR="$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp" \ | |
272 | EMACS="emacs" | |
273 | %endif | |
274 | ||
275 | # symlink .opt versions of compilers (if present) | |
276 | for f in ocamlc ocamlopt ocamldoc ocamllex; do | |
277 | if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then | |
278 | mv -f $RPM_BUILD_ROOT%{_bindir}/$f \ | |
279 | $RPM_BUILD_ROOT%{_bindir}/$f.byte | |
280 | ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f | |
281 | fi | |
282 | done | |
283 | ||
284 | # move includes to the proper place | |
285 | mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml | |
286 | # but leave compatibility symlink | |
287 | ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml | |
288 | ||
289 | # compiled sources of compiler, needed by some programs | |
290 | for f in {asm,byte}comp parsing typing utils ; do | |
291 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f | |
292 | cp $f/*.{cmi,cmo} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f | |
293 | %{?with_opt:cp $f/*.{cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f} | |
294 | done | |
295 | ||
296 | # this isn't installed by default, but is useful | |
297 | install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo | |
298 | cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
299 | ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir} | |
300 | ||
301 | # shutup checkfiles | |
302 | %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man3 | |
303 | ||
304 | # install info pages | |
305 | cp -f infoman/*.gz $RPM_BUILD_ROOT%{_infodir} | |
306 | ||
307 | %clean | |
308 | rm -rf $RPM_BUILD_ROOT | |
309 | ||
310 | %post doc-info -p /sbin/postshell | |
311 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
312 | ||
313 | %postun doc-info -p /sbin/postshell | |
314 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
315 | ||
316 | %files | |
317 | %defattr(644,root,root,755) | |
318 | %doc Changes LICENSE README | |
319 | %attr(755,root,root) %{_bindir}/addlabels | |
320 | %attr(755,root,root) %{_bindir}/ocaml | |
321 | %attr(755,root,root) %{_bindir}/ocamlbuild* | |
322 | %attr(755,root,root) %{_bindir}/ocamlc | |
323 | %{?with_opt:%attr(755,root,root) %{_bindir}/ocamlc.*} | |
324 | %attr(755,root,root) %{_bindir}/ocamlcp | |
325 | %attr(755,root,root) %{_bindir}/ocamldebug | |
326 | %attr(755,root,root) %{_bindir}/ocamldep* | |
327 | %attr(755,root,root) %{_bindir}/ocamldoc* | |
328 | %attr(755,root,root) %{_bindir}/ocamllex* | |
329 | %attr(755,root,root) %{_bindir}/ocamlmklib | |
330 | %attr(755,root,root) %{_bindir}/ocamlmktop | |
331 | %attr(755,root,root) %{_bindir}/ocamlobjinfo | |
332 | %{?with_opt:%attr(755,root,root) %{_bindir}/ocamlopt} | |
333 | %{?with_opt:%attr(755,root,root) %{_bindir}/ocamlopt.*} | |
334 | %attr(755,root,root) %{_bindir}/ocamloptp | |
335 | %attr(755,root,root) %{_bindir}/ocamlprof | |
336 | %attr(755,root,root) %{_bindir}/ocamlyacc | |
337 | %attr(755,root,root) %{_bindir}/scrapelabels | |
338 | %{_includedir}/caml | |
339 | %{_libdir}/%{name}/caml | |
340 | %{_libdir}/%{name}/compiler-libs | |
341 | %{_libdir}/%{name}/threads | |
342 | %dir %{_libdir}/%{name}/vmthreads | |
343 | %dir %{_libdir}/%{name}/vmthreads/*.cm* | |
344 | %dir %{_libdir}/%{name}/vmthreads/*.a | |
345 | %{_libdir}/%{name}/*.a | |
346 | %{?with_opt:%{_libdir}/%{name}/*.o} | |
347 | %{_libdir}/%{name}/*.cm* | |
348 | %exclude %{_libdir}/%{name}/*graphics* | |
349 | %{_libdir}/%{name}/Makefile.config | |
350 | %{_libdir}/%{name}/ld.conf | |
351 | %{_libdir}/%{name}/camlheader | |
352 | %{_libdir}/%{name}/camlheader_ur | |
353 | %{_libdir}/%{name}/ocamlbuild | |
354 | %dir %{_libdir}/%{name}/ocamldoc | |
355 | %{_libdir}/%{name}/ocamldoc/*.hva | |
356 | %attr(755,root,root) %{_libdir}/%{name}/expunge | |
357 | %attr(755,root,root) %{_libdir}/%{name}/extract_crc | |
358 | %attr(755,root,root) %{_libdir}/%{name}/objinfo_helper | |
359 | %{_mandir}/man1/ocaml* | |
360 | %exclude %{_mandir}/man1/ocamlrun.1* | |
361 | ||
362 | %files runtime | |
363 | %defattr(644,root,root,755) | |
364 | %attr(755,root,root) %{_bindir}/ocamlrun | |
365 | %dir %{_libdir}/%{name} | |
366 | %dir %{_libdir}/%{name}/site-lib | |
367 | %dir %{_libdir}/%{name}/stublibs | |
368 | %attr(755,root,root) %{_libdir}/%{name}/stublibs/dll*.so | |
369 | %exclude %{_libdir}/%{name}/stublibs/dllgraphics.so | |
370 | %attr(755,root,root) %{_libdir}/%{name}/libcamlrun_shared.so | |
371 | %{_mandir}/man1/ocamlrun.1* | |
372 | ||
373 | %files lib-source | |
374 | %defattr(644,root,root,755) | |
375 | %{_libdir}/%{name}/*.ml | |
376 | %{_libdir}/%{name}/*.mli | |
377 | %{_libdir}/%{name}/*/*.mli | |
378 | ||
379 | %files doc-html | |
380 | %defattr(644,root,root,755) | |
381 | %doc docs/html/ocaml/* | |
382 | ||
383 | %files doc-ps | |
384 | %defattr(644,root,root,755) | |
385 | %doc docs/*.ps.gz | |
386 | ||
387 | %files doc-info | |
388 | %defattr(644,root,root,755) | |
389 | %{_infodir}/ocaml.info* | |
390 | ||
391 | # they are poor, html is much better | |
392 | #%files manpages | |
393 | #%%{_mandir}/man3/* | |
394 | ||
395 | %if %{with emacs} | |
396 | %files emacs | |
397 | %defattr(644,root,root,755) | |
398 | %{_datadir}/emacs/site-lisp/*.el* | |
399 | %endif | |
400 | ||
401 | %if %{with x} | |
402 | %files x11graphics | |
403 | %defattr(644,root,root,755) | |
404 | %attr(755,root,root) %{_libdir}/%{name}/stublibs/dllgraphics.so | |
405 | ||
406 | %files x11graphics-devel | |
407 | %defattr(644,root,root,755) | |
408 | %{_libdir}/%{name}/graphics*.cm* | |
409 | %{?with_opt:%{_libdir}/%{name}/graphics.a} | |
410 | %{_libdir}/%{name}/libgraphics.a | |
411 | %endif | |
412 | ||
413 | %files compiler-objects | |
414 | %defattr(644,root,root,755) | |
415 | %{_libdir}/%{name}/compiler | |
416 | ||
417 | %files ocamldoc-devel | |
418 | %defattr(644,root,root,755) | |
419 | %{_libdir}/%{name}/ocamldoc/*.cm* | |
420 | %{?with_opt:%{_libdir}/%{name}/ocamldoc/*.a} | |
421 | ||
422 | %files examples | |
423 | %defattr(644,root,root,755) | |
424 | %{_examplesdir}/%{name}-%{version} |