From e12e831794cd172ba687567b7b50548740d83b49 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: Sebastien Buisson Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54190 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Olaf Faaland --- 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 28eb3ec..a81ce27 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -693,6 +693,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 f4ac0c8..2678d60 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -18,6 +18,7 @@ %bcond_with mofed %bcond_without mpi %bcond_with kabi +%bcond_without l_getsepol # LUTF Turn off brp-python-precompile script as we don't want the python files # to be compiled on installation @@ -224,6 +225,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 @@ -537,6 +541,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 064347b..8e32757 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -499,6 +499,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], @@ -4312,7 +4321,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