Blob Blame History Raw
%undefine _package_note_flags
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}

%global srcname bos

Name:           ocaml-%{srcname}
Version:        0.2.1
Release:        3%{?dist}
Summary:        Basic OS interaction for OCaml

License:        ISC
Source0:        %{url}/releases/%{srcname}-%{version}.tbz

BuildRequires:  ocaml >= 4.08.0
BuildRequires:  ocaml-astring-devel
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-fmt-devel >= 0.8.10
BuildRequires:  ocaml-fpath-devel
BuildRequires:  ocaml-logs-devel
BuildRequires:  ocaml-mtime-devel
BuildRequires:  ocaml-ocamlbuild
BuildRequires:  ocaml-rresult-devel >= 0.7.0
BuildRequires:  ocaml-topkg-devel >= 1.0.3

Bos provides support for basic and robust interaction with the operating
system in OCaml.  It has functions to access the process environment,
parse command line arguments, interact with the file system and run
command line programs.  Bos works equally well on POSIX and Windows
operating systems.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       ocaml-astring-devel%{?_isa}
Requires:       ocaml-fmt-devel%{?_isa}
Requires:       ocaml-fpath-devel%{?_isa}
Requires:       ocaml-logs-devel%{?_isa}
Requires:       ocaml-rresult-devel%{?_isa}

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

%autosetup -n %{srcname}-%{version}

ocaml pkg/ build --dev-pkg false --tests true

# Relink with Fedora linker flags
cd _build
ocamlfind ocamlopt -shared -linkall -cclib '%{build_ldflags}' -g \
  -package rresult -package astring -package fpath -package fmt -package logs \
  -package unix -I src src/bos.cmxa -o src/bos.cmxs
ocamlfind ocamlopt -shared -linkall -cclib '%{build_ldflags}' -g \
  -package fmt.tty -package logs.fmt -package rresult -package astring \
  -package fpath -package fmt -package logs -package unix -I src \
  src/bos_setup.cmxa -o src/bos_setup.cmxs
ocamlfind ocamlopt -shared -linkall -cclib '%{build_ldflags}' -g \
  -package compiler-libs.toplevel -package rresult -package astring \
  -package fpath -package fmt -package logs -package unix -I src \
  src/bos_top.cmxa -o src/bos_top.cmxs
cd -

mkdir -p %{buildroot}%{_libdir}/ocaml/%{srcname}
cp -p _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} _build/pkg/META \
   _build/opam %{buildroot}%{_libdir}/ocaml/%{srcname}

ocaml pkg/ test

%dir %{_libdir}/ocaml/%{srcname}/
%ifarch %{ocaml_native_compiler}

%files         devel
%if %{with docs}
%doc _build/default/_doc/*
%ifarch %{ocaml_native_compiler}

* Fri Feb 04 2022 Richard W.M. Jones <> - 0.2.1-3
- OCaml 4.13.1 rebuild to remove package notes

* Thu Jan 20 2022 Fedora Release Engineering <> - 0.2.1-2
- Rebuilt for

* Fri Dec 10 2021 Jerry James <> - 0.2.1-1
- Initial RPM