From 2777adcabd1032ddb886f913fa04d82a292ab379 Mon Sep 17 00:00:00 2001 From: Gian-Carlo DeFazio Date: Thu, 16 Nov 2023 15:05:45 -0800 Subject: [PATCH 1/1] 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. Test-Parameters: trivial Signed-off-by: Gian-Carlo DeFazio Change-Id: If71a2a4a524047edbd2b31e6fac7a42f36a030bf Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52849 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- 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 68b623b..da4dc84 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -636,6 +636,7 @@ AS_IF([test "x$enable_utils" = xno], [enable_tests="no"]) AS_IF([test "x$enable_utils" = xyes], [ LC_OPENSSL_GETSEPOL + LC_CONFIG_GETSEPOL LC_FID2PATH_ANON_UNION ]) AS_IF([test "x$enable_tests" = xyes], [ diff --git a/lustre.spec.in b/lustre.spec.in index 25a256d..a534703 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -29,6 +29,7 @@ %bcond_without o2ib %bcond_with kfi %bcond_with gni +%bcond_without l_getsepol %if %{with multiple_lnds} %global enable_multi_lnds 1 @@ -289,6 +290,9 @@ Provides: lustre-client = %{version}-%{release} #suse don't support selinux BuildRequires: pkgconfig(libselinux) %endif +%if %{with l_getsepol} +BuildRequires: pkgconfig(libselinux) openssl-devel +%endif %if %{with lustre_modules} %if %{with mofed} %if 0%{?mofed_source} > 0 @@ -666,6 +670,7 @@ WITH_O2IB="" %{?with_kfi:--with-kfi=/usr/src/cray-kfabric/default} \ %{?with_gni:--enable-gni} \ ${WITH_O2IB} \ + %{!?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 0fbef37..324f6d8 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -480,6 +480,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], @@ -5092,7 +5101,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