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