Olaf Hering 2021-02-01 10:31:42 +00:00 committed by Git OBS Bridge
parent 47408170a0
commit 5ac72f22b9
2 changed files with 30 additions and 4 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>testsuite</package>
</multibuild>

View File

@ -16,7 +16,15 @@
#
Name: ocaml-csexp
%define build_flavor @BUILD_FLAVOR@%{nil}
%if "%{build_flavor}" == "testsuite"
%define nsuffix -testsuite
%else
%define nsuffix %{nil}
%endif
%define pkg ocaml-csexp
Name: %{pkg}%{nsuffix}
Version: 1.3.2
Release: 0
%{?ocaml_preserve_bytecode}
@ -24,11 +32,18 @@ Summary: Parsing and printing of S-expressions in Canonical form
License: MIT
Group: Development/Languages/OCaml
URL: https://opam.ocaml.org/packages/csexp
Source: %{name}-%{version}.tar.xz
Source0: %{pkg}-%{version}.tar.xz
BuildRequires: ocaml
BuildRequires: ocaml-dune
BuildRequires: ocaml-rpm-macros >= 20210121
%if 1
BuildRequires: ocamlfind(result)
%endif
%if "%{build_flavor}" == "testsuite"
BuildRequires: ocamlfind(csexp)
BuildRequires: ocamlfind(ppx_expect)
%endif
%description
This library provides minimal support for Canonical S-expressions. Canonical S-expressions are a binary encoding of S-expressions that is super simple and well suited for communication between programs.
@ -47,23 +62,31 @@ The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%autosetup -p1
%autosetup -p1 -n %{pkg}-%{version}
%build
dune_release_pkgs='csexp'
%ocaml_dune_setup
%if "%{build_flavor}" == ""
%ocaml_dune_build
%endif
%install
%if "%{build_flavor}" == ""
%ocaml_dune_install
%ocaml_create_file_list
%endif
%if "%{build_flavor}" == "testsuite"
%check
dune_test_tolerate_fail='dune_test_tolerate_fail no ppx_expect'
%ocaml_dune_test
%endif
%if "%{build_flavor}" == ""
%files -f %{name}.files
%files devel -f %{name}.files.devel
%endif
%changelog