Name:       ocaml-vector3
Version:    0.2
Release:    %mkrel 1
Summary:    Module for 3D vectors
License:    BSD
# the _oasis file tells it's BSD-3-Clause
# but the header tells it's BSD-2-Clause
Group:      Development/OCaml
Source0:    opam-vector3.%{version}.tar.bz2
BuildRequires:  ocaml-findlib
BuildRequires:  opam

Module for 3D vectors
(implemented as records of x, y and z floats).

%package    devel
Summary:    Development files for %{name}
Group:      Development/OCaml
Requires:   %{name} = %{version}-%{release}

%description devel
This package contains the development modules you need to use %{name} in
your programs.

%setup -q -n opam-vector3.%{version}
sed -i -e 's,@ARCHIVE@,%{SOURCE1},' \
if [ -f $HOME/.opam ]; then exit 1; fi
opam init --no-setup
opam repo remove default
NR=`opam repo list | wc -l`
if [ $NR != "0" ]; then exit 1; fi
opam repo add mga-local .

opam update

rm -rf %{buildroot}
export DESTDIR=%{buildroot}
export OCAMLFIND_DESTDIR=%{buildroot}/%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR/vector3
opam install vector3

%dir %{_libdir}/ocaml/vector3

%files devel