From fe03d7d5ed574dfe1d84659ba4a6a5fab3f4a770 Mon Sep 17 00:00:00 2001 From: Gian-Carlo DeFazio Date: Thu, 16 Nov 2023 15:05:45 -0800 Subject: [PATCH] LU-17226 build: create config option for l_getsepol Add a configuration option for l_getsepol. l_getsepol is build by default unless the --disable-l_getsepol option is given to configure. lustre.spec.in builds l_getsepol by default and has its dependencies as build requirements. The implicit configuration check for the dependency openssl-devel is removed and replaced by a BuildRequires. Lustre-change: https://review.whamcloud.com/52849 Lustre-commit: 2777adcabd1032ddb886f913fa04d82a292ab379 Test-Parameters: trivial Signed-off-by: Gian-Carlo DeFazio Change-Id: If71a2a4a524047edbd2b31e6fac7a42f36a030bf Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54162 Reviewed-by: Sebastien Buisson Tested-by: jenkins Tested-by: Andreas Dilger --- config/lustre-build.m4 | 1 + lustre.spec.in | 5 +++++ lustre/autoconf/lustre-core.m4 | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 640c979..1b5ab4c 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -757,6 +757,7 @@ AS_IF([test "x$enable_utils" = xno], [enable_tests="no"]) AS_IF([test "x$enable_utils" = xyes], [ LC_OPENSSL_GETSEPOL + LC_CONFIG_GETSEPOL ]) AS_IF([test "x$enable_tests" = xyes], [ LC_HAVE_LIBAIO diff --git a/lustre.spec.in b/lustre.spec.in index f500407..48e2bfd 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -25,6 +25,7 @@ %bcond_without kabi %bcond_without mlnx %bcond_with ofed +%bcond_without l_getsepol # By default both gss and gss keyring are disabled. # gss keyring requires the gss core. If the builder @@ -247,6 +248,9 @@ Provides: lustre-client = %{version}-%{release} #suse don't support selinux BuildRequires: libselinux-devel %endif +%if %{with l_getsepol} +BuildRequires: pkgconfig(libselinux) openssl-devel +%endif %if %{with lustre_modules} %if %{with mofed} BuildRequires: mlnx-ofa_kernel-devel @@ -720,6 +724,7 @@ fi %{!?with_systemd:--with-systemdsystemunitdir=no} \ %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ %{?with_mofed:--with-o2ib=$o2ib_path} \ + %{!?with_l_getsepol:--disable-l_getsepol} \ --with-linux=%{kdir} \ --with-linux-obj=%{kobjdir} \ --with-kmp-moddir=%{kmoddir}/%{name} diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 5f23dce..733c314 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -473,6 +473,15 @@ AC_MSG_RESULT([$enable_getsepol]) CFLAGS="$saved_flags" ]) # LC_OPENSSL_GETSEPOL +# LC_GCONFIG_GETSEPOL +AC_DEFUN([LC_CONFIG_GETSEPOL], [ +AC_ARG_ENABLE([l_getsepol], [AS_HELP_STRING([--disable-l_getsepol], + [build the l_getsepol utility])], [config_getsepol="no"], + [config_getsepol="yes"]) +AC_MSG_CHECKING([whether to build l_getsepol]) +AC_MSG_RESULT([$config_getsepol]) +]) # LC_GETSEPOL + # LC_HAVE_LIBAIO AC_DEFUN([LC_HAVE_LIBAIO], [ AC_CHECK_HEADER([libaio.h], @@ -4605,7 +4614,8 @@ AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno") AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno") AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes) AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux") -AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes) +AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes && + test x$config_getsepol = xyes) AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes) AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes) ]) # LC_CONDITIONALS -- 1.8.3.1