diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..964176c --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + testsuite + diff --git a/ocaml-csexp.spec b/ocaml-csexp.spec index 22c28ce..e2442a1 100644 --- a/ocaml-csexp.spec +++ b/ocaml-csexp.spec @@ -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