Whamcloud - gitweb
LU-17226 build: create config option for l_getsepol 90/54190/2
authorGian-Carlo DeFazio <defazio1@llnl.gov>
Thu, 16 Nov 2023 23:05:45 +0000 (15:05 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 17 Apr 2024 05:24:16 +0000 (05:24 +0000)
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 <defazio1@llnl.gov>
Change-Id: If71a2a4a524047edbd2b31e6fac7a42f36a030bf
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54190
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
config/lustre-build.m4
lustre.spec.in
lustre/autoconf/lustre-core.m4

index 28eb3ec..a81ce27 100644 (file)
@@ -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], [
index f4ac0c8..2678d60 100644 (file)
@@ -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}
index 064347b..8e32757 100644 (file)
@@ -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