Whamcloud - gitweb
LU-17226 build: create config option for l_getsepol 49/52849/5
authorGian-Carlo DeFazio <defazio1@llnl.gov>
Thu, 16 Nov 2023 23:05:45 +0000 (15:05 -0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:12:46 +0000 (07:12 +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.

Test-Parameters: trivial
Signed-off-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Change-Id: If71a2a4a524047edbd2b31e6fac7a42f36a030bf
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52849
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build.m4
lustre.spec.in
lustre/autoconf/lustre-core.m4

index 68b623b..da4dc84 100644 (file)
@@ -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], [
index 25a256d..a534703 100644 (file)
@@ -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}
index 0fbef37..324f6d8 100644 (file)
@@ -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