Whamcloud - gitweb
LU-17065 build: Remove snmp support
[fs/lustre-release.git] / debian / rules
index 074b59a..1aabf7e 100755 (executable)
@@ -1,11 +1,21 @@
 #!/usr/bin/make -f
+# SPDX-License-Identifier: NOASSERTION
+
+#
+# This file is part of Lustre, http://www.lustre.org/
+#
+# debian/rules
+#
+# Debian rules file
+#
+# Copying and modification is unlimited, provided that the modified
+# version is marked as being modified.
+# (This version has been modified from the original)
 #
 # Created 2009 by Brian J. Murrell based on work by
 # Alastair McKinstry, <alastair.mckinstry@ichec.ie>, <mckinstry@debian.org>
 # Patrick Winnertz, and the pkg-lustre Debian maintainers
 #
-# Copying and modification is unlimited, provided that the modified
-# version is marked as being modified.
 
 # Uncomment this to turn on verbose mode.
 # export DH_VERBOSE=1
@@ -33,11 +43,6 @@ else
         CFLAGS += -O2
 endif
 
-# We need the kernels to be built with gcc-3.3; suspect that gcc-4.1 uses too
-# much stack and crashes because of it.
-#CC?=gcc-3.3
-#export CC
-
 # This is the debhelper compatibility version to use.
 export DH_COMPAT=11
 
@@ -129,7 +134,7 @@ autogen-stamp: patch-stamp
                cp /usr/share/misc/config.sub ldiskfs/config.sub; \
                cp /usr/share/misc/config.guess config.guess; \
                cp /usr/share/misc/config.guess ldiskfs/config.guess; \
-               sh build/autogen.sh; \
+               bash build/autogen.sh; \
        fi; \
        touch $@
 
@@ -189,16 +194,18 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \
                export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \
        fi; \
-       if echo "$${DEB_BUILD_PROFILES}" | grep -qw "gss"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gss"; \
-       elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nogss"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --disable-gss"; \
-       fi; \
-       if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \
-       elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \
-       fi; \
+       options="gss crypto pinger checksum flock health_write lru-resize"; \
+       options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \
+       options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \
+       options="$${options} panic_dumplog readline libpthread"; \
+       options="$${options} backoff gni efence"; \
+       for option in $${options}; do \
+               if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \
+                       export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \
+               elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \
+                       export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \
+               fi; \
+       done; \
        if [ -f "$${CONFIG_CACHE_FILE}" ]; then \
                export TMP_CACHE_FILE=$$(mktemp); \
                sed -e "/ac_cv_env/d" \
@@ -212,7 +219,6 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
                $(SRCDIR)/configure --disable-dependency-tracking \
                        --with-linux=$${KERNEL_SRC} \
                        --with-linux-obj=$${KERNEL_OBJ} \
-                       --disable-snmp \
                        --enable-quota \
                        $${EXTRAFLAGS} \
                        $(EXTRA_OPTIONS) \
@@ -259,7 +265,6 @@ binary-$(UTILS_PKG): build-stamp
        rm -rf debian/$(UTILS_PKG)/usr/bin/iokit-* \
               debian/$(UTILS_PKG)/usr/bin/*-survey \
               debian/$(UTILS_PKG)/usr/bin/mcreate \
-              debian/$(UTILS_PKG)/usr/bin/munlink \
               debian/$(UTILS_PKG)/usr/bin/statx \
               debian/$(UTILS_PKG)/usr/sbin/wirecheck \
               debian/$(UTILS_PKG)/usr/sbin/wiretest
@@ -490,11 +495,18 @@ kdist_config: prep-deb-files patch-stamp
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \
                export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \
        fi; \
-       if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \
-       elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \
-               export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \
-       fi; \
+       options="gss crypto pinger checksum flock health_write lru-resize"; \
+       options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \
+       options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \
+       options="$${options} panic_dumplog readline libpthread"; \
+       options="$${options} backoff gni efence"; \
+       for option in $${options}; do \
+               if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \
+                       export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \
+               elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \
+                       export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \
+               fi; \
+       done; \
        if [ -f "$${CONFIG_CACHE_FILE}" ]; then \
                export TMP_CACHE_FILE=$$(mktemp --tmpdir newconfig-XXXXXXXX.cache); \
                sed -e "/ac_cv_env/d" \
@@ -509,10 +521,9 @@ kdist_config: prep-deb-files patch-stamp
                --disable-dependency-tracking \
                --disable-doc  \
                --disable-iokit \
-               --disable-snmp \
                --disable-tests \
                --enable-quota \
-               --with-kmp-moddir=updates \
+               --with-kmp-moddir=updates/kernel \
                $${EXTRAFLAGS} \
                $(EXTRA_OPTIONS)
 
@@ -534,6 +545,9 @@ binary-modules: prep-deb-files
        dh_installmodules -p $(PKGNAME)
        dh_compress -p $(PKGNAME)
        dh_fixperms -p $(PKGNAME)
+       sed "s/depmod -a/depmod -a $(KVERS)/" $(CURDIR)/debian/postinst > $(CURDIR)/debian/$(PKGNAME).postinst
+       sed "s/depmod -a/depmod -a $(KVERS)/" $(CURDIR)/debian/postrm > $(CURDIR)/debian/$(PKGNAME).postrm
+       chmod +x $(CURDIR)/debian/$(PKGNAME).postinst $(CURDIR)/debian/$(PKGNAME).postrm
        dh_installdeb -p $(PKGNAME)
        dh_gencontrol -- -v$(VERSION)
        dh_md5sums -p $(PKGNAME)