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