Whamcloud - gitweb
LU-17462 build: make some deb packages optional 88/53788/10
authorShaun Tancheff <shaun.tancheff@hpe.com>
Sat, 3 Feb 2024 07:21:03 +0000 (14:21 +0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 5 Jun 2024 04:49:29 +0000 (04:49 +0000)
make building the utils, tests and iokit packages optional.

Also mpi is option in the --disable-mpitests

If --disable-mpitests or --disable-tests are disable the mpi
package dependancies should also be dropped.

Test-Parameters: trivial
HPE-bug-id: LUS-12091
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Icd232571f7052ec0a4b25c32ff573c3b5f76de21
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53788
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Caleb Carlson <caleb.carlson@hpe.com>
autoMakefile.am
debian/rules

index 11af92b..7b204fe 100644 (file)
@@ -31,6 +31,30 @@ if DEQUOTE_CC_VERSION_TEXT
 DEQUOTE = yes
 endif
 
+if MPITESTS
+ENABLE_MPITESTS = yes
+else
+ENABLE_MPITESTS = no
+endif
+
+if TESTS
+ENABLE_TESTS = yes
+else
+ENABLE_TESTS = no
+endif
+
+if UTILS
+ENABLE_UTILS = yes
+else
+ENABLE_UTILS = no
+endif
+
+if BUILD_LUSTREIOKIT
+ENABLE_IOKIT = yes
+else
+ENABLE_IOKIT = no
+endif
+
 FIND_TAG_FILES_CMD = find $(top_srcdir) \
                     -path $(top_srcdir)/ldiskfs/linux-stage \
                     -prune -false -o -type f -name '*.[hc]'
@@ -353,17 +377,39 @@ debs: undef.h debs_common
        if test "x@CONFIG_CACHE_FILE@" != "x"; then \
                export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
        fi; \
+       debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
+       cp debian/control.main $$debiantmp/control.main.bkp ; \
+       cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
        if test "x@ENABLE_GSS@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
-               debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
-               cp debian/control.main $$debiantmp/control.main.bkp ; \
-               cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
                sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
                awk 'BEGIN{change=0} $$1 == "Package:" {if (($$2 == "lustre-client-utils") || ($$2 == "lustre-server-utils")) change=1; else change=0; fi } {if (($$1 == "Depends:") && change) print $$0 ", libgssapi-krb5-2, libkrb5-3, libssl1.1|libssl3"; else print; fi}' debian/control.main > $$debiantmp/control.main && mv $$debiantmp/control.main debian/control.main ; \
                sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
        elif test "x@ENABLE_GSS@" = "xno"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
        fi; \
+       if test "x$(ENABLE_MPITESTS)" = "xyes"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mpitests"; \
+       elif test "x$(ENABLE_MPITESTS)" = "xno"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nompitests"; \
+               sed -i -e 's/mpi-default-dev,//' -e 's/mpi-default-bin,//' debian/control.main ; \
+       fi; \
+       if test "x$(ENABLE_TESTS)" = "xyes"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} tests"; \
+       elif test "x$(ENABLE_TESTS)" = "xno"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} notests"; \
+               sed -i -e 's/mpi-default-dev,//' -e 's/mpi-default-bin,//' debian/control.main ; \
+       fi; \
+       if test "x$(ENABLE_IOKIT)" = "xyes"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} iokit"; \
+       elif test "x$(ENABLE_IOKIT)" = "xno"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noiokit"; \
+       fi; \
+       if test "x$(ENABLE_UTILS)" = "xyes"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} utils"; \
+       elif test "x$(ENABLE_UTILS)" = "xno"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noutils"; \
+       fi; \
        if test "x@ENABLE_CRYPTO@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
        elif test "x@ENABLE_CRYPTO@" = "xno"; then \
@@ -489,7 +535,6 @@ debs: undef.h debs_common
        }; \
        cp $$debiantmp/control.main.bkp debian/control.main || true && \
        cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
-       cp -v debian/control.main debian/control || true ; \
        export KPKG_DEST_DIR="$$(pwd)/.." && \
        version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
        rm -rf debian/tmp/modules-deb && \
@@ -526,7 +571,7 @@ debs: undef.h debs_common
           ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
           ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
           ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
-          debs/
+          debs/ 2> /dev/null || true
 
 dkms-debs: undef.h debs_common
        cp -v debian/changelog.in debian/changelog ; \
index 366bdce..22d3c4d 100755 (executable)
@@ -80,21 +80,47 @@ ifneq ($(SYSTEMD_OPTIONS),)
 endif
 
 # Packages provided for both client and server builds
-IOKIT_PKG=lustre-iokit
-TESTS_PKG=lustre-tests
 DEV_PKG=lustre-dev
 SOURCE_PKG=lustre-source
 
+ifneq (,$(findstring notests,$(DEB_BUILD_PROFILES)))
+       TESTS_PKG=
+       BINARY_TESTS_PKG=
+else
+       TESTS_PKG=lustre-tests
+       BINARY_TESTS_PKG=binary-$(TESTS_PKG)
+endif
+
+ifneq (,$(findstring noiokit,$(DEB_BUILD_PROFILES)))
+       IOKIT_PKG=
+       BINARY_IOKIT_PKG=
+else
+       IOKIT_PKG=lustre-iokit
+       BINARY_IOKIT_PKG=binary-$(IOKIT_PKG)
+endif
+
 # Packages that are only built for server OR client builds
 # The difference is that server build contain more modules & utils
 ifneq (,$(findstring server,$(DEB_BUILD_PROFILES)))
+ifneq (,$(findstring noutils,$(DEB_BUILD_PROFILES)))
+       UTILS_PKG=
+       BINARY_UTILS_PKG=
+else
        UTILS_PKG=lustre-server-utils
+       BINARY_UTILS_PKG=binary-$(UTILS_PKG)
+endif
        MODS_PKG=lustre-server-modules
        RESOURCE_PKG=lustre-resource-agents
        RESOURCE_TARGET=binary-$(RESOURCE_PKG)
        DKMS_PKG=
 else
+ifneq (,$(findstring noutils,$(DEB_BUILD_PROFILES)))
+       UTILS_PKG=
+       BINARY_UTILS_PKG=
+else
        UTILS_PKG=lustre-client-utils
+       BINARY_UTILS_PKG=binary-$(UTILS_PKG)
+endif
        MODS_PKG=lustre-client-modules
        RESOURCE_TARGET=
        RESOURCE_PKG=
@@ -192,6 +218,18 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
                                > debian/lustre-client-utils.install; \
                fi; \
        fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "nompi"; then \
+               export EXTRAFLAGS="$${EXTRAFLAGS} --disable-mpitests" ; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "notests"; then \
+               export EXTRAFLAGS="--disable-tests"; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "noutils"; then \
+               export EXTRAFLAGS="--disable-utils"; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "noiokit"; then \
+               export EXTRAFLAGS="--disable-iokit"; \
+       fi; \
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \
                export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \
        else \
@@ -272,8 +310,8 @@ build-stamp: patch-stamp configure-stamp
 # instead we will build the modules with m-a in the "make debs" target
 # binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) \
 # binary-$(MODS_PKG) binary-kern-mods
-binary-arch: binary-$(UTILS_PKG) binary-$(DEV_PKG) \
-            binary-$(IOKIT_PKG) binary-$(TESTS_PKG) \
+binary-arch: binary-$(DEV_PKG) \
+            $(BINARY_UTILS_PKG) $(BINARY_IOKIT_PKG) $(BINARY_TESTS_PKG) \
             $(RESOURCE_TARGET)
 
 binary-indep: binary-$(SOURCE_PKG) $(DKMS_TARGET)
@@ -505,6 +543,18 @@ kdist_config: prep-deb-files patch-stamp
        else \
                export EXTRAFLAGS="--disable-server"; \
        fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "nompi"; then \
+               export EXTRAFLAGS="$${EXTRAFLAGS} --disable-mpitests" ; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "notests"; then \
+               export EXTRAFLAGS="--disable-tests"; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "noutils"; then \
+               export EXTRAFLAGS="--disable-utils"; \
+       fi; \
+       if echo "$${DEB_BUILD_PROFILES}" | grep -q "noiokit"; then \
+               export EXTRAFLAGS="--disable-iokit"; \
+       fi; \
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \
                export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \
        else \