]> git.pld-linux.org Git - packages/ocaml.git/blobdiff - ocaml.spec
- release 10 (by relup.sh)
[packages/ocaml.git] / ocaml.spec
index 12e2fb241228e04f7afb605cd1027d2372ffa899..92f317259c4a205c5122171def6705b2f32336ec 100644 (file)
@@ -1,26 +1,33 @@
 #
 # Conditional build:
-%bcond_without emacs   # without emacs subpackage
-%bcond_without x       # without X11 support 
+%bcond_without emacs           # emacs subpackage
+%bcond_without x               # X11 support
+%bcond_without ocaml_opt       # native, optimized compiler
+
+# ppc64, sparc64 and x32 variants not supported currently
+# alpha, hppa, ia64, mips removed since 4.00
+%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
+%undefine      with_ocaml_opt
+%endif
 
-%define                sver    4.02
+%define                sver    4.04
 
 Summary:       The Objective Caml compiler and programming environment
 Summary(pl.UTF-8):     Kompilator OCamla (Objective Caml) oraz środowisko programistyczne
 Name:          ocaml
-Version:       4.02.1
-Release:       2
+Version:       4.04.1
+Release:       10
 Epoch:         1
 License:       QPL v1.0 with linking exception (compiler), LGPL v2 with linking exception (library)
 Group:         Development/Languages
 Source0:       http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{version}.tar.xz
-# Source0-md5: d74ac1b1179af362491e14349dd1958b
+# Source0-md5: 092139f2a256d1f3d2571f64ab475aa9
 Source1:       http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman-html.tar.gz
-# Source1-md5: 915a1949f7af7186e16354e9682dc1e5
+# Source1-md5: 5c58a4fce99b20e02c3208ad956bcb9d
 Source2:       http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman.ps.gz
-# Source2-md5: e85016fa23b6525d1d10da06010fd90a
+# Source2-md5: a408f706789b9b84b0eb68da3db05f15
 Source3:       http://caml.inria.fr/distrib/%{name}-%{sver}/%{name}-%{sver}-refman.info.tar.gz
-# Source3-md5: 265b7db123e925e8b7b70ca2266b4206
+# Source3-md5: 8c9df1da0e36a69817f43115fa87360c
 Source4:       https://github.com/mmottl/pure-fun/archive/v1.0.13/pure-fun-1.0.13.tar.gz
 # Source4-md5: 0a6ff033df78d0880fe4883ace025ebe
 # note: dead URL
@@ -28,6 +35,7 @@ Source5:      http://www.ocaml.info/ocaml_sources/ds-contrib.tar.gz
 # Source5-md5: 77fa1da7375dea1393cc0b6cd802d7e1
 Patch1:                %{name}-CFLAGS.patch
 Patch2:                %{name}-as_needed.patch
+Patch3:                x32.patch
 URL:           http://caml.inria.fr/
 %{?with_x:BuildRequires:       xorg-lib-libX11-devel}
 %if %{with emacs}
@@ -174,8 +182,8 @@ Summary:    Compiled parts of OCaml compiler
 Summary(pl.UTF-8):     Skompilowane części kompilatora OCamla
 Group:         Development/Languages
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Obsoletes:     ocaml-devel
 Provides:      ocaml-devel
+Obsoletes:     ocaml-devel
 
 %description compiler-objects
 This package contains *.cmi and *.cmo files being parts of OCaml
@@ -225,20 +233,21 @@ mv htmlman docs/html/ocaml
 cp %{SOURCE2} docs/ocaml.ps.gz
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
-%build 
+%build
 cp -f /usr/share/automake/config.sub config/gnu
 ./configure \
-        -cc "%{__cc}" \
+       -host %{_target_platform} \
+       -cc "%{__cc}" \
        -bindir %{_bindir} \
        -libdir %{_libdir}/%{name} \
        -mandir %{_mandir}/man1 \
-       -host %{_host} \
        -with-pthread \
        -x11lib %{_libdir}
 
-%{__make} -j1 world bootstrap opt.opt CFLAGS="%{rpmcflags} -Wall -DUSE_INTERP_RESULT"
-%{__make} -C tools objinfo CFLAGS="%{rpmcflags} -Wall -DUSE_INTERP_RESULT" -j1
+%{__make} -j1 world bootstrap %{?with_ocaml_opt:opt.opt} \
+       CFLAGS="%{rpmcflags} -Wall -DUSE_INTERP_RESULT"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -262,28 +271,28 @@ EOF
        EMACS="emacs"
 %endif
 
-# symlink .opt versions of compilers (if present)
-for f in ocamlc ocamlopt ocamldoc ocamllex; do
-       if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
-               mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
-                       $RPM_BUILD_ROOT%{_bindir}/$f.byte
-               ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
+# symlink .opt version of executable (if present)
+for f in ocamldoc ; do
+       if test -f $RPM_BUILD_ROOT%{_bindir}/${f}.opt; then
+               [ ! -f $RPM_BUILD_ROOT%{_bindir}/${f}.byte ] || exit 1 # drop rename if .opt/.byte already handled upstream
+               %{__mv} $RPM_BUILD_ROOT%{_bindir}/$f \
+                       $RPM_BUILD_ROOT%{_bindir}/${f}.byte
+               ln -sf ${f}.opt $RPM_BUILD_ROOT%{_bindir}/$f
        fi
 done
 
 # move includes to the proper place
-mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
 # but leave compatibility symlink
 ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml
 
 # compiled sources of compiler, needed by some programs
 for f in {asm,byte}comp parsing typing utils ; do
        install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
-       cp $f/*.{cmi,cmo,cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
+       cp $f/*.{cmi,cmo} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
+       %{?with_ocaml_opt:cp $f/*.{cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f}
 done
 
-# this isn't installed by default, but is useful
-install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
 cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
 
@@ -304,24 +313,43 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc Changes LICENSE README
+%doc Changes LICENSE README.adoc
 %attr(755,root,root) %{_bindir}/addlabels
 %attr(755,root,root) %{_bindir}/ocaml
-%attr(755,root,root) %{_bindir}/ocamlbuild*
 %attr(755,root,root) %{_bindir}/ocamlc
-%attr(755,root,root) %{_bindir}/ocamlc.*
+%attr(755,root,root) %{_bindir}/ocamlc.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlc.opt}
 %attr(755,root,root) %{_bindir}/ocamlcp
+%attr(755,root,root) %{_bindir}/ocamlcp.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlcp.opt}
 %attr(755,root,root) %{_bindir}/ocamldebug
-%attr(755,root,root) %{_bindir}/ocamldep*
-%attr(755,root,root) %{_bindir}/ocamldoc*
-%attr(755,root,root) %{_bindir}/ocamllex*
+%attr(755,root,root) %{_bindir}/ocamldep
+%attr(755,root,root) %{_bindir}/ocamldep.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamldep.opt}
+%attr(755,root,root) %{_bindir}/ocamldoc
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamldoc.byte}
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamldoc.opt}
+%attr(755,root,root) %{_bindir}/ocamllex
+%attr(755,root,root) %{_bindir}/ocamllex.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamllex.opt}
 %attr(755,root,root) %{_bindir}/ocamlmklib
+%attr(755,root,root) %{_bindir}/ocamlmklib.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlmklib.opt}
 %attr(755,root,root) %{_bindir}/ocamlmktop
+%attr(755,root,root) %{_bindir}/ocamlmktop.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlmktop.opt}
 %attr(755,root,root) %{_bindir}/ocamlobjinfo
-%attr(755,root,root) %{_bindir}/ocamlopt
-%attr(755,root,root) %{_bindir}/ocamlopt.*
+%attr(755,root,root) %{_bindir}/ocamlobjinfo.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlobjinfo.opt}
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt}
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt.byte}
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlopt.opt}
 %attr(755,root,root) %{_bindir}/ocamloptp
+%attr(755,root,root) %{_bindir}/ocamloptp.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamloptp.opt}
 %attr(755,root,root) %{_bindir}/ocamlprof
+%attr(755,root,root) %{_bindir}/ocamlprof.byte
+%{?with_ocaml_opt:%attr(755,root,root) %{_bindir}/ocamlprof.opt}
 %attr(755,root,root) %{_bindir}/ocamlyacc
 %attr(755,root,root) %{_bindir}/scrapelabels
 %{_includedir}/caml
@@ -332,14 +360,13 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libdir}/%{name}/vmthreads/*.cm*
 %dir %{_libdir}/%{name}/vmthreads/*.a
 %{_libdir}/%{name}/*.a
-%{_libdir}/%{name}/*.o
+%{?with_ocaml_opt:%{_libdir}/%{name}/*.o}
 %{_libdir}/%{name}/*.cm*
 %exclude %{_libdir}/%{name}/*graphics*
 %{_libdir}/%{name}/Makefile.config
 %{_libdir}/%{name}/ld.conf
 %{_libdir}/%{name}/camlheader
 %{_libdir}/%{name}/camlheader_ur
-%{_libdir}/%{name}/ocamlbuild
 %dir %{_libdir}/%{name}/ocamldoc
 %{_libdir}/%{name}/ocamldoc/*.hva
 %attr(755,root,root) %{_libdir}/%{name}/expunge
@@ -352,10 +379,12 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/ocamlrun
 %dir %{_libdir}/%{name}
+%{_libdir}/%{name}/VERSION
 %dir %{_libdir}/%{name}/site-lib
 %dir %{_libdir}/%{name}/stublibs
 %attr(755,root,root) %{_libdir}/%{name}/stublibs/dll*.so
 %exclude %{_libdir}/%{name}/stublibs/dllgraphics.so
+%{?with_ocaml_opt:%attr(755,root,root) %{_libdir}/%{name}/libasmrun_shared.so}
 %attr(755,root,root) %{_libdir}/%{name}/libcamlrun_shared.so
 %{_mandir}/man1/ocamlrun.1*
 
@@ -395,7 +424,7 @@ rm -rf $RPM_BUILD_ROOT
 %files x11graphics-devel
 %defattr(644,root,root,755)
 %{_libdir}/%{name}/graphics*.cm*
-%{_libdir}/%{name}/graphics.a
+%{?with_ocaml_opt:%{_libdir}/%{name}/graphics.a}
 %{_libdir}/%{name}/libgraphics.a
 %endif
 
@@ -406,7 +435,7 @@ rm -rf $RPM_BUILD_ROOT
 %files ocamldoc-devel
 %defattr(644,root,root,755)
 %{_libdir}/%{name}/ocamldoc/*.cm*
-%{_libdir}/%{name}/ocamldoc/*.a
+%{?with_ocaml_opt:%{_libdir}/%{name}/ocamldoc/*.a}
 
 %files examples
 %defattr(644,root,root,755)
This page took 0.033271 seconds and 4 git commands to generate.