From 081eee2a6ef2161b0c8c09031d3df6b16725c778 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jan 07 2022 23:21:52 +0000 Subject: Initial import. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b39883 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bos-*.tbz diff --git a/README.md b/README.md index bd599af..11a687d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # ocaml-bos -The ocaml-bos package +[Bos](https://erratique.ch/software/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. diff --git a/ocaml-bos.spec b/ocaml-bos.spec new file mode 100644 index 0000000..9f839e2 --- /dev/null +++ b/ocaml-bos.spec @@ -0,0 +1,103 @@ +%ifnarch %{ocaml_native_compiler} +%global debug_package %{nil} +%endif + +%global srcname bos + +Name: ocaml-%{srcname} +Version: 0.2.1 +Release: 1%{?dist} +Summary: Basic OS interaction for OCaml + +License: ISC +URL: https://erratique.ch/software/bos +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 + +%description +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}. + +%prep +%autosetup -n %{srcname}-%{version} + +%build +ocaml pkg/pkg.ml 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 - + +%install +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} + +%check +ocaml pkg/pkg.ml test + +%files +%doc CHANGES.md README.md +%license LICENSE.md +%dir %{_libdir}/ocaml/%{srcname}/ +%{_libdir}/ocaml/%{srcname}/META +%{_libdir}/ocaml/%{srcname}/*.cma +%{_libdir}/ocaml/%{srcname}/*.cmi +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/*.cmxs +%endif + +%files devel +%if %{with docs} +%doc _build/default/_doc/* +%endif +%{_libdir}/ocaml/%{srcname}/opam +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/*.a +%{_libdir}/ocaml/%{srcname}/*.cmx +%{_libdir}/ocaml/%{srcname}/*.cmxa +%endif +%{_libdir}/ocaml/%{srcname}/*.cmt +%{_libdir}/ocaml/%{srcname}/*.cmti +%{_libdir}/ocaml/%{srcname}/*.mli + +%changelog +* Fri Dec 10 2021 Jerry James - 0.2.1-1 +- Initial RPM diff --git a/sources b/sources new file mode 100644 index 0000000..9aa3a54 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (bos-0.2.1.tbz) = 8daeb8a4c2dd1f2460f6274ada19f4f1b6ebe875ff83a938c93418ce0e6bdb74b8afc5c9a7d410c1c9df2dad030e4fa276b6ed2da580639484e8b5bc92610b1d