]> git.pld-linux.org Git - packages/ocaml.git/blob - ocaml.spec
- added 10266 patch (https://github.com/ocaml/ocaml/pull/10266) to fix build with...
[packages/ocaml.git] / ocaml.spec
1 #
2 # Conditional build:
3 %bcond_without  ocaml_opt       # native, optimized compiler
4
5 # ppc64, sparc64 and x32 variants not supported currently
6 # alpha, hppa, ia64, mips removed since 4.00
7 %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
8 %undefine       with_ocaml_opt
9 %endif
10
11 %define         sver    4.12
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.12.0
17 Release:        5
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/ocaml-%{sver}/%{name}-%{version}.tar.xz
22 # Source0-md5:  7343cd398d477001db2c3f2ac92e12ea
23 Source1:        http://caml.inria.fr/distrib/ocaml-%{sver}/%{name}-%{sver}-refman-html.tar.gz
24 # Source1-md5:  1bda3d0a46328a985c817d551423e2c6
25 Source3:        http://caml.inria.fr/distrib/ocaml-%{sver}/%{name}-%{sver}-refman.info.tar.gz
26 # Source3-md5:  c808dbbe35a6cc5d14da6c3b2f175d2c
27 Source4:        https://github.com/mmottl/pure-fun/archive/v1.0.13/pure-fun-1.0.13.tar.gz
28 # Source4-md5:  0a6ff033df78d0880fe4883ace025ebe
29 # note: dead URL
30 Source5:        http://www.ocaml.info/ocaml_sources/ds-contrib.tar.gz
31 # Source5-md5:  77fa1da7375dea1393cc0b6cd802d7e1
32 Patch0:         %{name}-10266.patch
33 URL:            https://www.ocaml.org/
34 Requires:       %{name}-runtime = %{epoch}:%{version}-%{release}
35 Provides:       ocaml-bytes-devel
36 Provides:       ocaml-ocamldoc
37 Obsoletes:      ocaml-bytes-devel
38 Obsoletes:      ocaml-doc-ps < 1:4.12
39 Obsoletes:      ocaml-emacs < 1:4.12
40 Obsoletes:      ocaml-ocamldoc
41 Obsoletes:      ocaml-x11graphics < 1:4.12
42 Obsoletes:      ocaml-x11graphics-devel < 1:4.12
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         specflags       -fno-strict-aliasing
46
47 %if %{without ocaml_opt}
48 %define         _noautoreq      Backend_intf Inlining_decision_intf Simplify_boxed_integer_ops_intf
49 %endif
50
51 %description
52 Objective Caml is a high-level, strongly-typed, functional and
53 object-oriented programming language from the ML family of languages.
54
55 This package comprises two batch compilers (a fast bytecode compiler
56 and an optimizing native-code compiler), an interactive toplevel
57 system, Lex&Yacc tools, a replay debugger, and a comprehensive
58 library.
59
60 %description -l pl.UTF-8
61 OCaml (Objective Caml) jest funkcyjnym, obiektowo zorientowanym
62 językiem wysokiego poziomu z silnym typowaniem. Należy do rodziny
63 języków ML.
64
65 Ten pakiet zawiera dwa kompilatory (szybki kompilator do bajtkodu oraz
66 optymalizujący kompilator do kodu natywnego), interaktywne środowisko
67 pracy, narzędzia do tworzenia analizatorów leksykalnych oraz
68 składniowych (ocamllex, ocamlyacc), odpluskwiacz (ocamldebug) i
69 biblioteki.
70
71 %package runtime
72 Summary:        Runtime system for OCaml
73 Summary(pl.UTF-8):      Środowisko uruchomieniowe dla OCamla
74 Group:          Libraries
75
76 %description runtime
77 This package contains binaries needed to run bytecode OCaml programs:
78 ocamlrun bytecode interpreter, and basic dynamic link libraries.
79
80 %description runtime -l pl.UTF-8
81 Pakiet ten zawiera binaria potrzebne do uruchamiania programów w
82 OCamlu skompilowanych do bajtkodu: interpreter bajtkodu (ocamlrun)
83 oraz podstawowe biblioteki linkowane dynamicznie.
84
85 %package lib-source
86 Summary:        Sources of OCaml standard library
87 Summary(pl.UTF-8):      Źródła biblioteki standardowej OCamla
88 Group:          Development/Languages
89 Requires:       %{name} = %{epoch}:%{version}-%{release}
90
91 %description lib-source
92 This sources come helpful during debugging of user programs with
93 ocamldebug.
94
95 %description lib-source -l pl.UTF-8
96 Źródła te są przydatne przy odpluskwianiu programów użytkownika z
97 użyciem ocamldebug.
98
99 %package doc-html
100 Summary:        HTML documentation for OCaml
101 Summary(pl.UTF-8):      Dokumentacja dla OCamla w formacie HTML
102 Group:          Development/Tools
103
104 %description doc-html
105 HTML documentation for OCaml.
106
107 %description doc-html -l pl.UTF-8
108 Dokumentacja dla OCamla w formacie HTML.
109
110 %package doc-info
111 Summary:        Info documentation for OCaml
112 Summary(pl.UTF-8):      Dokumentacja info dla OCamla
113 Group:          Development/Tools
114
115 %description doc-info
116 Info documentation for OCaml.
117
118 %description doc-info -l pl.UTF-8
119 Dokumentacja info dla OCamla.
120
121 %package compiler-objects
122 Summary:        Compiled parts of OCaml compiler
123 Summary(pl.UTF-8):      Skompilowane części kompilatora OCamla
124 Group:          Development/Languages
125 Requires:       %{name} = %{epoch}:%{version}-%{release}
126 Provides:       ocaml-devel
127 Obsoletes:      ocaml-devel
128
129 %description compiler-objects
130 This package contains *.cmi and *.cmo files being parts of OCaml
131 compiler. They are needed to compile some programs.
132
133 %description compiler-objects -l pl.UTF-8
134 Pakiet ten zawiera pliki *.cmi oraz *.cmo będące częściami kompilatora
135 OCamla. Są one wymagane do kompilacji niektórych programów.
136
137 %package ocamldoc-devel
138 Summary:        Files needed to develop programs using ocamldoc
139 Summary(pl.UTF-8):      Pliki potrzebne do tworzenia programów używających ocamldoc
140 Group:          Development/Languages
141 Requires:       %{name} = %{epoch}:%{version}-%{release}
142
143 %description ocamldoc-devel
144 You need this package if you are going to write ocamldoc front end or
145 something like that.
146
147 %description ocamldoc-devel -l pl.UTF-8
148 Będziesz potrzebować tego pakietu, jeśli zamierzasz pisać front end
149 dla ocamldoc lub coś podobnego.
150
151 # maybe we'll want to add some more stuff here?
152 %package examples
153 Summary:        Example source code for OCaml
154 Summary(pl.UTF-8):      Przykładowe kody źródłowe w OCamlu
155 Group:          Development/Languages
156 Requires:       %{name} = %{epoch}:%{version}-%{release}
157
158 %description examples
159 This packages contains sources for Okasaki's Purely Functional
160 Datastructures in OCaml, along with some contributions.
161
162 %description examples -l pl.UTF-8
163 Pakiet ten zawiera źródła Czysto Funkcyjnych Struktur Danych autorstwa
164 Okasaki'ego, napisane w OCamlu, wraz z dodatkami.
165
166 %prep
167 %setup -q -a1 -a3
168 %patch0 -p1
169
170 mkdir examples
171 tar xzf %{SOURCE4} -C examples
172 tar xzf %{SOURCE5} -C examples
173 # order mess with docs somewhat
174 mkdir -p docs/html
175 %{__mv} htmlman docs/html/ocaml
176
177 %build
178 %configure \
179         AS=%{__as} \
180         ASPP="%{__cc} -c" \
181         --libdir=%{_libdir}/ocaml \
182         %{!?with_ocaml_opt:--disable-native-compiler}
183
184 %{__make} world
185 %{__make} bootstrap
186 %if %{with ocaml_opt}
187 %{__make} opt
188 %{__make} opt.opt
189 %endif
190
191 %install
192 rm -rf $RPM_BUILD_ROOT
193 install -d $RPM_BUILD_ROOT{%{_includedir},%{_infodir},%{_examplesdir}/%{name}-%{version}}
194
195 %{__make} install \
196         DESTDIR=$RPM_BUILD_ROOT
197
198 cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF
199 %{_libdir}/%{name}/stublibs
200 %{_libdir}/%{name}
201 EOF
202
203 # move includes to the proper place
204 %{__mv} $RPM_BUILD_ROOT%{_libdir}/ocaml/caml $RPM_BUILD_ROOT%{_includedir}/caml
205 # but leave compatibility symlink
206 ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
207
208 # compiled sources of compiler, needed by some programs
209 for f in %{?with_ocaml_opt:asmcomp} bytecomp parsing typing utils ; do
210         install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
211         cp $f/*.{cmi,cmo} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
212         %{?with_ocaml_opt:cp $f/*.{cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f}
213 done
214
215 cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
216 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
217
218 # shutup checkfiles
219 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man3
220
221 # install info pages
222 cp -p infoman/ocaml.info{,.body-*}.gz $RPM_BUILD_ROOT%{_infodir}
223
224 %clean
225 rm -rf $RPM_BUILD_ROOT
226
227 %post   doc-info -p /sbin/postshell
228 -/usr/sbin/fix-info-dir -c %{_infodir}
229
230 %postun doc-info -p /sbin/postshell
231 -/usr/sbin/fix-info-dir -c %{_infodir}
232
233 %files
234 %defattr(644,root,root,755)
235 %doc Changes LICENSE README.adoc
236 %attr(755,root,root) %{_bindir}/addlabels
237 %attr(755,root,root) %{_bindir}/ocaml
238 %attr(755,root,root) %{_bindir}/ocamlc
239 %attr(755,root,root) %{_bindir}/ocamlc.byte
240 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlc.opt}
241 %attr(755,root,root) %{_bindir}/ocamlcmt
242 %attr(755,root,root) %{_bindir}/ocamlcp
243 %attr(755,root,root) %{_bindir}/ocamlcp.byte
244 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlcp.opt}
245 %attr(755,root,root) %{_bindir}/ocamldebug
246 %attr(755,root,root) %{_bindir}/ocamldep
247 %attr(755,root,root) %{_bindir}/ocamldep.byte
248 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamldep.opt}
249 %attr(755,root,root) %{_bindir}/ocamldoc
250 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamldoc.opt}
251 %attr(755,root,root) %{_bindir}/ocamllex
252 %attr(755,root,root) %{_bindir}/ocamllex.byte
253 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamllex.opt}
254 %attr(755,root,root) %{_bindir}/ocamlmklib
255 %attr(755,root,root) %{_bindir}/ocamlmklib.byte
256 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlmklib.opt}
257 %attr(755,root,root) %{_bindir}/ocamlmktop
258 %attr(755,root,root) %{_bindir}/ocamlmktop.byte
259 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlmktop.opt}
260 %attr(755,root,root) %{_bindir}/ocamlobjinfo
261 %attr(755,root,root) %{_bindir}/ocamlobjinfo.byte
262 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlobjinfo.opt}
263 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt}
264 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt.byte}
265 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt.opt}
266 %attr(755,root,root) %{_bindir}/ocamloptp
267 %attr(755,root,root) %{_bindir}/ocamloptp.byte
268 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamloptp.opt}
269 %attr(755,root,root) %{_bindir}/ocamlprof
270 %attr(755,root,root) %{_bindir}/ocamlprof.byte
271 %{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlprof.opt}
272 %attr(755,root,root) %{_bindir}/ocamlyacc
273 %attr(755,root,root) %{_bindir}/scrapelabels
274 %{_includedir}/caml
275 %{_libdir}/%{name}/caml
276 %{_libdir}/%{name}/compiler-libs
277 %{_libdir}/%{name}/threads
278 %{_libdir}/%{name}/*.a
279 %{?with_ocaml_opt:%{_libdir}/%{name}/*.o}
280 %{_libdir}/%{name}/*.cm*
281 %{_libdir}/%{name}/Makefile.config
282 %{_libdir}/%{name}/ld.conf
283 %{_libdir}/%{name}/camlheader
284 %{_libdir}/%{name}/camlheaderd
285 %{_libdir}/%{name}/camlheaderi
286 %{_libdir}/%{name}/camlheader_ur
287 %dir %{_libdir}/%{name}/ocamldoc
288 %{_libdir}/%{name}/ocamldoc/*.hva
289 %attr(755,root,root) %{_libdir}/%{name}/expunge
290 %attr(755,root,root) %{_libdir}/%{name}/extract_crc
291 %{_mandir}/man1/ocaml*
292 %exclude %{_mandir}/man1/ocamlrun.1*
293
294 %files runtime
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_bindir}/ocamlrun
297 %attr(755,root,root) %{_bindir}/ocamlrund
298 %attr(755,root,root) %{_bindir}/ocamlruni
299 %dir %{_libdir}/%{name}
300 %dir %{_libdir}/%{name}/stublibs
301 %{_libdir}/%{name}/eventlog_metadata
302 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dll*.so
303 %{?with_ocaml_opt:%attr(755,root,root) %{_libdir}/%{name}/libasmrun_shared.so}
304 %attr(755,root,root) %{_libdir}/%{name}/libcamlrun_shared.so
305 %{_mandir}/man1/ocamlrun.1*
306
307 %files lib-source
308 %defattr(644,root,root,755)
309 %{_libdir}/%{name}/*.ml
310 %{_libdir}/%{name}/*.mli
311 %{_libdir}/%{name}/*/*.mli
312
313 %files doc-html
314 %defattr(644,root,root,755)
315 %doc docs/html/ocaml/*
316
317 %files doc-info
318 %defattr(644,root,root,755)
319 %{_infodir}/ocaml.info*
320
321 %files compiler-objects
322 %defattr(644,root,root,755)
323 %{_libdir}/%{name}/compiler
324
325 %files ocamldoc-devel
326 %defattr(644,root,root,755)
327 %{_libdir}/%{name}/ocamldoc/*.cm*
328 %{?with_ocaml_opt:%{_libdir}/%{name}/ocamldoc/*.a}
329
330 %files examples
331 %defattr(644,root,root,755)
332 %{_examplesdir}/%{name}-%{version}
This page took 0.077844 seconds and 4 git commands to generate.