File ocaml.spec of Package ocaml
#
# spec file for package ocaml
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2010 Andrew Psaltis <ampsaltis at gmail dot com>
# Copyright (c) 2011 Andrew Psaltis <ampsaltis at gmail dot com>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ocaml
Version: 3.12.1
Release: 0
%define doc_version 3.12
%define do_opt 1
%ifarch s390 s390x
%define do_opt 0
%endif
Source0: http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{version}.tar.bz2
Source1: http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{doc_version}-refman.html.tar.gz
Source2: http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{doc_version}-refman.ps.gz
Source3: http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{doc_version}-refman.info.tar.gz
Source4: rpmlintrc
Patch0: ocaml-3.00-camldebug_el.patch
Patch1: ocaml-3.04-info.patch
Patch2: ocaml-3.04-ocamltags--no-site-start.patch
Patch3: ocaml-rpath.patch
Patch5: ocaml-3.08.3-gcc4.patch
Patch6: ocaml-3.08.3.patch
Patch7: ocaml-3.09-emacs_localcompile.patch
Patch8: ocaml-3.09-rpmoptflags.patch
Patch9: ocaml-ppc64.patch
Patch10: arm-add-type-directive.patch
Url: http://caml.inria.fr/
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %install_info_prereq
BuildRequires: emacs-nox
BuildRequires: fdupes
BuildRequires: gdbm-devel
BuildRequires: ncurses-devel
BuildRequires: tk-devel
# This gets ocamlobjinfo to work with .cmxs files
BuildRequires: binutils-devel
Provides: ocaml(compiler) = %{version}
Requires: ocaml-runtime = %{version}
# This ensures that the find_provides/find_requires calls ocamlobjinfo correctly.
%global __ocaml_requires_opts -c -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
%global __ocaml_provides_opts -f "%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo"
%description
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package comprises two batch compilers (a fast bytecode compiler
and an optimizing native-code compiler), an interactive top level
system, Lex&Yacc tools, a replay debugger, and a comprehensive library.
%package runtime
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0
Group: Development/Languages/Other
Provides: ocaml(runtime) = %{version}
%description runtime
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package contains the runtime environment needed to run Objective
Caml bytecode.
%package source
Summary: Source code for Objective Caml libraries
License: QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
Requires: ocaml = %{version}
%description source
Source code for Objective Caml libraries.
%package x11
Summary: X11 support for Objective Caml
License: SUSE-LGPL-2.0-with-linking-exception
Group: System/Libraries
Requires: ocaml-runtime = %{version}
%description x11
X11 support for Objective Caml.
%package labltk
Summary: The Objective Caml Compiler and Programming Environment
License: SUSE-LGPL-2.0-with-linking-exception
Group: System/Libraries
Requires: ocaml = %{version}
Requires: ocaml(runtime) = %{version}
%description labltk
Labltk is a library for interfacing Objective Caml with the scripting
language Tcl/Tk.
This package contains the runtime files.
%package labltk-devel
Summary: Development files for labltk
License: SUSE-LGPL-2.0-with-linking-exception
Group: Development/Libraries/Other
Requires: %{name}-labltk = %{version}
Requires: ocaml = %{version}
Requires: tcl-devel
Requires: tk-devel
Requires: xorg-x11-libX11-devel
%description labltk-devel
Labltk is a library for interfacing Objective Caml with the scripting
language Tcl/Tk.
This package contains the development files. It includes the ocaml
browser for code editing and library browsing.
%package camlp4
Summary: Pre-Processor-Pretty-Printer for Objective Caml
License: SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
Requires: ocaml-runtime = %{version}
%description camlp4
Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml, parsing a
source file and printing some result on standard output.
This package contains the runtime files.
%package camlp4-devel
Summary: Pre-Processor-Pretty-Printer for Objective Caml
License: SUSE-LGPL-2.0-with-linking-exception
Group: Development/Languages/Other
Requires: %{name}-camlp4 = %{version}
Requires: ocaml = %{version}
Provides: camlp4 = %{version}
Obsoletes: camlp4 < %{version}
%description camlp4-devel
Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml, parsing a
source file and printing some result on standard output.
This package contains the development files.
%package ocamldoc
Summary: The Objective Caml Compiler and Programming Environment
License: QPL-1.0
Group: Development/Languages/Other
Requires: ocaml = %{version}
%description ocamldoc
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package contains a documentation generator for Objective Caml.
%package emacs
Summary: The Objective Caml Compiler and Programming Environment
License: GPL-2.0+
Group: Development/Languages/Other
Requires: emacs
Requires: ocaml = %{version}
Provides: caml-mode
%description emacs
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package provides caml-mode for emacs
%package docs
Summary: The Objective Caml Compiler and Programming Environment
License: GPL-2.0+ and QPL-1.0
Group: Development/Languages/Other
Requires: ocaml = %{version}
%description docs
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package comprises two batch compilers (a fast bytecode compiler
and an optimizing native-code compiler), an interactive top level
system, Lex&Yacc tools, a replay debugger, and a comprehensive library.
%package compiler-libs
Summary: Libraries used internal to the OCaml Compiler
License: QPL-1.0
Group: Development/Libraries/Other
Requires: ocaml = %{version}
%description compiler-libs
Objective Caml is a high-level, strongly-typed, functional and
object-oriented programming language from the ML family of languages.
This package contains several modules used internally by the OCaml
compilers. They are not needed for normal OCaml development, but may
be helpful in the development of certain applications.
%package compiler-libs-devel
Summary: Libraries used internal to the OCaml Compiler
License: QPL-1.0
Group: Development/Libraries/Other
Requires: ocaml-compiler-libs = %{version}
%description compiler-libs-devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%setup -q -T -b 0
%setup -q -T -D -a 1
%setup -q -T -D -a 3
%patch0 -p1
gzip -d infoman/ocaml.info.gz
%patch1 -p1
%patch2 -p1
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9 -p1
%patch10 -p1
find -name ".cvsignore" | xargs -r rm -f
%build
%ifarch %ix86
# Default OPT flags for these architectures use -fomit-frame-pointer,
# which gets in the way of some of the profiling done within.
export RPM_OPT_FLAGS="${RPM_OPT_FLAGS/-fomit-frame-pointer/}"
%endif
CFLAGS="$RPM_OPT_FLAGS" \
./configure -bindir %{_bindir} \
-libdir %{_libdir}/ocaml \
-mandir %{_mandir} \
-x11include %{_includedir} \
-x11lib %{_libdir}
%if %{do_opt}
make world.opt
%else
make world
%endif
%install
make install \
BINDIR="$RPM_BUILD_ROOT%{_bindir}" \
LIBDIR="$RPM_BUILD_ROOT%{_libdir}/ocaml" \
MANDIR="$RPM_BUILD_ROOT%{_mandir}"
sed -i -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf
install -d $RPM_BUILD_ROOT%{_infodir} \
$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
(
cd emacs
make install BINDIR=$RPM_BUILD_ROOT/%{_bindir} EMACSDIR=$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
make install-ocamltags BINDIR=$RPM_BUILD_ROOT/%{_bindir}
)
(
cd infoman; cp -f ocaml* $RPM_BUILD_ROOT%{_infodir}
)
# fix bnc#411232
echo '(load "ocaml.el" nil t t)' >$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/suse-start-ocaml.el
cat <<EOF >$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/%{name}.el
(autoload 'caml-mode "caml" "Caml editing mode" t)
(add-hook 'caml-mode-hook 'font-lock-mode)
(add-to-list 'auto-mode-alist '("\\\\.mli?$" . caml-mode))
EOF
sed -i '1s/^/#!\/usr\/bin\/ocaml\n/' $RPM_BUILD_ROOT/%{_bindir}/ocamltags
export EXCLUDE_FROM_STRIP="ocamldebug ocamlbrowser"
# Install the compiler libs
install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/compiler-libs
cp -a typing/ utils/ parsing/ $RPM_BUILD_ROOT%{_libdir}/ocaml/compiler-libs
%fdupes $RPM_BUILD_ROOT
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc Changes LICENSE README
%{_bindir}/*
%{_mandir}/*/*
%{_libdir}/ocaml/*.a
%if %{do_opt}
%ifarch %ix86 ppc64 x86_64
%{_libdir}/ocaml/*.cmxs
%endif
%{_libdir}/ocaml/*.cmxa
%{_libdir}/ocaml/*.cmx
%{_libdir}/ocaml/*.o
%endif
%{_libdir}/ocaml/*.mli
%{_libdir}/ocaml/libcamlrun_shared.so
%{_libdir}/ocaml/vmthreads/*.mli
%{_libdir}/ocaml/vmthreads/*.a
%if %{do_opt}
%{_libdir}/ocaml/threads/*.a
%{_libdir}/ocaml/threads/*.cmxa
%{_libdir}/ocaml/threads/*.cmx
%endif
%{_libdir}/ocaml/caml
%{_libdir}/ocaml/ocamlbuild
%{_libdir}/ocaml/Makefile.config
%{_libdir}/ocaml/extract_crc
%{_libdir}/ocaml/camlheader
%{_libdir}/ocaml/camlheader_ur
%{_libdir}/ocaml/expunge
%{_libdir}/ocaml/ld.conf
%{_libdir}/ocaml/objinfo_helper
%exclude %{_libdir}/ocaml/graphicsX11.mli
%{_infodir}/*
%exclude %{_bindir}/ocamlrun
%exclude %{_bindir}/camlp4*
%exclude %{_bindir}/mkcamlp4
%exclude %{_bindir}/labltk
%exclude %{_bindir}/ocamltags
%exclude %{_bindir}/ocamlbrowser
%exclude %{_bindir}/ocamldoc*
%exclude %{_libdir}/ocaml/camlp4
%exclude %{_libdir}/ocaml/labltk
%exclude %{_libdir}/ocaml/ocamldoc
%exclude %{_libdir}/ocaml/stublibs/dlllabltk.so
%files runtime
%defattr(-,root,root,-)
%{_bindir}/ocamlrun
%dir %{_libdir}/ocaml
%{_libdir}/ocaml/*.cmo
%{_libdir}/ocaml/*.cmi
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/stublibs
%dir %{_libdir}/ocaml/vmthreads
%{_libdir}/ocaml/vmthreads/*.cmi
%{_libdir}/ocaml/vmthreads/*.cma
%dir %{_libdir}/ocaml/threads
%{_libdir}/ocaml/threads/*.cmi
%{_libdir}/ocaml/threads/*.cma
%exclude %{_libdir}/ocaml/graphicsX11.cmi
%exclude %{_libdir}/ocaml/stublibs/dlllabltk.so
%doc README LICENSE Changes
%files x11
%defattr(-,root,root,-)
%{_libdir}/ocaml/graphicsX11.cmi
%{_libdir}/ocaml/graphicsX11.mli
%files source
%defattr(-,root,root,-)
%{_libdir}/ocaml/*.ml
%files labltk
%defattr(-,root,root,-)
%{_bindir}/labltk
%dir %{_libdir}/ocaml/labltk
%{_libdir}/ocaml/labltk/*.cmi
%{_libdir}/ocaml/labltk/*.cma
%{_libdir}/ocaml/labltk/*.cmo
%{_libdir}/ocaml/stublibs/dlllabltk.so
%files labltk-devel
%defattr(-,root,root,-)
%{_bindir}/ocamlbrowser
%{_libdir}/ocaml/labltk/labltktop
%{_libdir}/ocaml/labltk/pp
%{_libdir}/ocaml/labltk/tkcompiler
%if %{do_opt}
%{_libdir}/ocaml/labltk/*.a
%{_libdir}/ocaml/labltk/*.cmxa
%{_libdir}/ocaml/labltk/*.cmx
%{_libdir}/ocaml/labltk/*.o
%endif
%{_libdir}/ocaml/labltk/*.mli
%doc otherlibs/labltk/examples_labltk
%doc otherlibs/labltk/examples_camltk
%files camlp4
%defattr(-,root,root,-)
%dir %{_libdir}/ocaml/camlp4
%{_libdir}/ocaml/camlp4/*.cmi
%{_libdir}/ocaml/camlp4/*.cma
%{_libdir}/ocaml/camlp4/*.cmo
%dir %{_libdir}/ocaml/camlp4/Camlp4Filters
%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmi
%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmo
%dir %{_libdir}/ocaml/camlp4/Camlp4Parsers
%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmo
%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmi
%dir %{_libdir}/ocaml/camlp4/Camlp4Printers
%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmi
%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmo
%dir %{_libdir}/ocaml/camlp4/Camlp4Top
%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmi
%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmo
%files camlp4-devel
%defattr(-,root,root,-)
%{_bindir}/camlp4*
%{_bindir}/mkcamlp4
%if %{do_opt}
%{_libdir}/ocaml/camlp4/*.a
%{_libdir}/ocaml/camlp4/*.cmxa
%{_libdir}/ocaml/camlp4/*.cmx
%{_libdir}/ocaml/camlp4/*.o
%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmx
%{_libdir}/ocaml/camlp4/Camlp4Filters/*.o
%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmx
%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.o
%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmx
%{_libdir}/ocaml/camlp4/Camlp4Printers/*.o
%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmx
%{_libdir}/ocaml/camlp4/Camlp4Top/*.o
%endif
%files ocamldoc
%defattr(-,root,root,-)
%{_bindir}/ocamldoc*
%{_libdir}/ocaml/ocamldoc
%doc ocamldoc/Changes.txt
%files docs
%defattr(-,root,root,-)
%doc htmlman
%files emacs
%defattr(-,root,root,-)
%doc emacs/README
%dir %{_datadir}/emacs
%dir %{_datadir}/emacs/site-lisp
%{_datadir}/emacs/site-lisp/*
%{_bindir}/ocamltags
%files compiler-libs
%defattr(-,root,root,-)
%doc LICENSE README
%{_libdir}/ocaml/compiler-libs
%if %{do_opt}
%exclude %{_libdir}/ocaml/compiler-libs/*/*.cmx
%exclude %{_libdir}/ocaml/compiler-libs/*/*.o
%endif
%exclude %{_libdir}/ocaml/compiler-libs/*/*.mli
%exclude %{_libdir}/ocaml/compiler-libs/*/*.ml
%files compiler-libs-devel
%defattr(-,root,root,-)
%doc LICENSE README
%if %{do_opt}
%{_libdir}/ocaml/compiler-libs/*/*.cmx
%{_libdir}/ocaml/compiler-libs/*/*.o
%endif
%{_libdir}/ocaml/compiler-libs/*/*.ml
%{_libdir}/ocaml/compiler-libs/*/*.mli
%changelog