Name:           ocaml-iostream
Version:        0.2.2
Release:        1%{?dist}
Summary:        Generic I/O streams of bytes

License:        MIT
URL:            https://github.com/c-cube/ocaml-iostream
Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires:  ocaml-dune
BuildRequires:  ocaml-odoc
BuildRequires:  ocaml-ounit-devel
BuildRequires:  ocaml-camlzip-devel

%description
This library defines generic I/O streams of bytes. The streams should be
composable, user-definable, and agnostic to the underlying I/O mechanism; with
OCaml 5 it means that they might be backed by an effect-based scheduler.

The goal is to provide a reasonable interoperability layer that multiple
libraries and applications in the OCaml ecosystem can rely on, while providing
the modularity that standard IO channels lack. Modern statically typed languages
like Go and Rust provide this layer in their stdlib and their whole ecosystem
can build on it.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

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

%package        doc
Summary:        Documentation files for %{name}
%description    doc
%{summary}.

%prep
%autosetup -p1

%build
%dune_build @install @doc

%install
%dune_install
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -rv -t %{buildroot}%{_docdir}/%{name} _build/default/_doc/_html/*
rm -rfv %{buildroot}%{_docdir}/%{name}/odoc.support

%check
%dune_check

%files -f .ofiles
%files devel -f .ofiles-devel

%files doc
%{_docdir}/%{name}/*

%changelog
* Tue Jul 16 2024 Marian Koncek <mkoncek@redhat.com> - 0.7.32-1
- Initial build