From ab4b47dc0def66aa6635af2ad70cc7dc3d8e827e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 8 Mar 2021 11:56:27 +0000 Subject: [PATCH] Better handling of optional camomile subpackage. Remove camomile from dune files on RHEL. Fixes: commit bdcd1e64d0a8d2a6188c6140b513dec99cef1e4e --- ocaml-gettext.spec | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 41c6f98..3de4398 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,8 +1,15 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) +# Optionally disable camomile dep on RHEL. +%if !0%{?rhel} +%bcond_without camomile +%else +%bcond_with camomile +%endif + Name: ocaml-gettext Version: 0.4.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -25,12 +32,14 @@ BuildRequires: chrpath BuildRequires: autoconf %if !0%{?rhel} BuildRequires: ocaml-ounit-devel +%endif +%if %{with camomile} BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif BuildRequires: autoconf, automake -%if !0%{?rhel} +%if %{with camomile} # ocaml-gettext program needs camomile data files Requires: ocaml-camomile-data %endif @@ -64,7 +73,7 @@ The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. -%if !0%{?rhel} +%if %{with camomile} %package camomile Summary: Parts of %{name} which depend on Camomile Requires: %{name} = %{version}-%{release} @@ -96,6 +105,13 @@ signature files for developing applications that use sed -i -e 's/batteries//' test/dune sed -i -e 's/batteries//' test/test-stub/dune +%if %{without camomile} +# Remove dependency on camomile. +rm -r src/lib/gettext-camomile +rm -r test/test-camomile +sed -i -e 's/camomile//' `find -name dune` +%endif + %build make build @@ -114,6 +130,12 @@ dune install --destdir=$RPM_BUILD_ROOT # Remove this, we will use our own rules for documentation. rm -rf $RPM_BUILD_ROOT/usr/doc +%if %{without camomile} +# If you use --without camomile but happen to have the camomile +# packages installed then it will still build them. +rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile +%endif + %files %doc LICENSE.txt @@ -156,7 +178,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_mandir}/man5/ocaml-gettext.5* -%if !0%{?rhel} +%if %{with camomile} %files camomile %doc LICENSE.txt %{_libdir}/ocaml/gettext-camomile @@ -180,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Mon Mar 8 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-2 +- Better handling of optional camomile subpackage. + * Tue Mar 2 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-1 - New upstream version 4.2 - Remove patch now upstream.