File mirage.spec of Package mirage
#
# spec file for package mirage
#
# Copyright (c) 2023 Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
#
# 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 https://bugs.opensuse.org/
#
Name: mirage
Version: 4.4.0
Release: 0
Summary: MirageOS - a library operating system
License: ISC
Group: Development/Languages/OCaml
URL: https://mirage.io
Source: %{name}-%{version}.tar.gz
BuildRequires: ocaml-dune
BuildRequires: ocaml-rpm-macros
BuildRequires: ocamlfind(alcotest)
BuildRequires: ocamlfind(astring)
BuildRequires: ocamlfind(bos)
BuildRequires: ocamlfind(emile)
BuildRequires: ocamlfind(fmt)
BuildRequires: ocamlfind(ipaddr)
BuildRequires: ocamlfind(logs)
BuildRequires: ocamlfind(opam-monorepo)
BuildRequires: ocamlfind(uri)
%description
MirageOS is a library operating system that constructs secure, performant and resource-efficient unikernels.
%package -n functoria
Summary: DSL to organize functor applications
Group: Development/Languages/OCaml
%description -n functoria
Functoria is a DSL to describe a set of modules and functors, their types and how to apply them in order to produce a complete application.
The main use case is mirage.
%package -n functoria-runtime
Summary: Runtime support for functoria-generated code
Group: Development/Languages/OCaml
%description -n functoria-runtime
This is the runtime support library for code generated by functoria.
%package devel
Summary: Development files for %{name}
Group: Development/Languages/OCaml
Requires: %{name} = %{version}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%package -n functoria-devel
Summary: Development files for functoria
Group: Development/Languages/OCaml
Requires: functoria = %{version}
%description -n functoria-devel
The functoria-devel package contains libraries and signature files for
developing applications that use functoria.
%package -n functoria-runtime-devel
Summary: Development files for functoria-runtime
Group: Development/Languages/OCaml
Requires: functoria-runtime = %{version}
%description -n functoria-runtime-devel
The functoria-runtime-devel package contains libraries and signature files for
developing applications that use functoria-runtime.
%prep
%autosetup
%build
%{ocaml_dune_setup}
%{ocaml_dune_build}
%install
%{ocaml_dune_install}
%{ocaml_create_file_list}
mv mirage.files{,.orig}
grep functoria mirage.files.orig > functoria.files.stage
grep functoria-runtime functoria.files.stage > functoria.files
grep -v functoria-runtime functoria.files.stage > functoria-runtime.files
grep -v functoria mirage.files.orig > mirage.files
mv mirage.files.devel{,.orig}
grep functoria mirage.files.devel.orig > functoria.files.devel.stage
grep functoria-runtime functoria.files.devel.stage > functoria.files.devel
grep -v functoria-runtime functoria.files.devel.stage > functoria-runtime.files.devel
grep -v functoria mirage.files.devel.orig > mirage.files.devel
%check
# no way to skip individual tests?
dune_test_tolerate_fail=y
%{ocaml_dune_test}
%files -f %{name}.files
%doc README.md
%{_bindir}/%{name}
%files -n functoria -f functoria.files
%files -n functoria-runtime -f functoria-runtime.files
%files devel -f %{name}.files.devel
%files -n functoria-devel -f functoria.files.devel
%files -n functoria-runtime-devel -f functoria-runtime.files.devel
%changelog