From b68b0c7ba810e7219ce132e4f2c3729c0cb7690d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 13 Jul 2023 19:23:08 -0400 Subject: [PATCH] Disable tests in RHEL builds ocaml-alcotest and its several dependencies are otherwise unneeded in RHEL and ELN. --- ocaml-calendar.spec | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ocaml-calendar.spec b/ocaml-calendar.spec index dc210d7..74261c2 100644 --- a/ocaml-calendar.spec +++ b/ocaml-calendar.spec @@ -5,6 +5,15 @@ ExcludeArch: %{ix86} %global debug_package %{nil} %endif +# ocaml-alcotest requires ocaml-astring, ocaml-cmdliner, ocaml-fmt, and ocaml-uutf, +# none of which are otherwise needed for building the OCaml-depenedent packages +# found in RHEL and ELN. We want to avoid the extra dependencies there. +%if 0%{?rhel} +%bcond_with tests +%else +%bcond_without tests +%endif + Name: ocaml-calendar Version: 3.0.0 Release: 2%{?dist} @@ -15,10 +24,13 @@ URL: https://ocaml-community.github.io/calendar/ Source0: https://github.com/ocaml-community/calendar/archive/v%{version}/calendar-%{version}.tar.gz BuildRequires: ocaml >= 4.03 -BuildRequires: ocaml-alcotest-devel BuildRequires: ocaml-dune >= 1.0 BuildRequires: ocaml-re-devel >= 1.7.2 +%if %{with tests} +BuildRequires: ocaml-alcotest-devel +%endif + %description Objective Caml library for managing dates and times. @@ -46,8 +58,10 @@ developing applications that use %{name}. %dune_install +%if %{with tests} %check %dune_check +%endif %files -f .ofiles