File ocaml-camomile.spec of Package ocaml-camomile

# spec file for package ocaml-camomile
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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

Name:           ocaml-camomile
Version:        0.8.5
Release:        0
Summary:        Unicode library for OCaml
# Several files are MIT and UCD licensed, but the overall work is LGPLv2+
# and the LGPL/GPL supercedes compatible licenses.
License:        LGPL-2.0+
Group:          Development/Libraries/Other
Source0:        camomile-%{version}.tar.bz2
# Use ocamlopt -g option to enable debuginfo.
Patch1:         camomile-0.8.3-enable-debug.patch
Patch2:         ocaml-camomile.bytecode.patch
BuildRequires:  fdupes
BuildRequires:  ocaml >= 3.12.1-12
BuildRequires:  ocaml-camlp4-devel
BuildRequires:  ocaml-findlib-devel
BuildRequires:  ocaml-ocamldoc
BuildRequires:  ocaml-rpm-macros >= 4.02.1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# ocaml autodep start for pkg: ocaml-camomile
# hardcoded rpm dependency for pre 12.1 to compensate for lack of ocaml() provides/requires
%if 0%{?suse_version} < 1210
Requires:       ocaml-runtime
# ocaml autodep end for pkg: ocaml-camomile

Camomile is a Unicode library for ocaml. Camomile provides Unicode
character type, UTF-8, UTF-16, UTF-32 strings, conversion to/from
about 200 encodings, collation and locale-sensitive case mappings, and

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%package        data
Summary:        Data files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description    data
The %{name}-data package contains data files for developing
applications that use %{name}.

%setup -q -n camomile-%{version}

%patch1 -p1
%patch2 -p1

# Parallel builds don't work.
./configure --prefix=%{_prefix} --datadir=%{_datadir} --libdir=%{_libdir}
make do_byte
%if %{ocaml_native_compiler}
make do_opt
make %{?_smp_mflags} dochtml
make %{?_smp_mflags} man

export DESTDIR=%{buildroot}
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR/stublibs $OCAMLFIND_DESTDIR/camomile
mkdir -p %{buildroot}%{_bindir}
make install prefix=%{buildroot}%{_prefix} DATADIR=%{buildroot}%{_datadir}
%if %{ocaml_native_compiler}
cp tools/camomilecharmap.opt %{buildroot}%{_bindir}/camomilecharmap
cp tools/camomilelocaledef.opt %{buildroot}%{_bindir}/camomilelocaledef
%fdupes %{buildroot}

%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%if %{ocaml_native_compiler}

%files devel
%doc README dochtml/*
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%if %{ocaml_native_compiler}

%files data