Whamcloud - gitweb
LU-8403 obd: remove OBD_NOTIFY_SYNC{,_NONBLOCK}
[fs/lustre-release.git] / debian / rules
index 5e59622..21fe689 100755 (executable)
@@ -28,8 +28,8 @@ endif
 #CC?=gcc-3.3
 #export CC
 
-# This is the debhelper compatability version to use.
-export DH_COMPAT=5
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=7
 
 # Module-assistant stuff
 PACKAGE=lustre-client-modules
@@ -40,30 +40,27 @@ MA_DIR ?= /usr/share/modass
 ARCH=$(shell dpkg --print-architecture)
 TOP_DIR:=$(shell pwd)
 
-#  the lustre build process. This is $(KERNEL_VERSION)
+# This is the Lustre version
 VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog)
-#SUPPORTED_KERNELS=2.6.27
-SUPPORTED_KERNELS=2.6.18 2.6.20 2.6.22
 UPVERSION=$(shell echo $VERSION | sed -e 's/-[^-]*$$//')
-#KERNEL_VERSION=2.6.27
-# the kernel version to build all of this with
-#KVER=2.6.27-11-generic
-# if the above is not set, default to whatever kernel is booted
-KVER?=$$(uname -r)
-KERNEL_TREE=/lib/modules/$(KVER)/build
+
+# KVER is set to LINUXRELEASE being by autoconf which is either
+# $(uname -r) or the version of the source specified by the user
+KVER?=$(LINUXRELEASE)
+
 # KVERS, KSRC are the kernel version and source to use when building lustre
 # Will be the default when building lustre-utils, etc but whatever module-assistant
 # supplied when building modules
-KVERS?=$(KERNEL_VERSION)
-#KSRC?=$(KERNEL_TREE)
-KSRC=$(KERNEL_TREE)
+KVERS?=$(KVER)
+KSRC?=$(LINUX_OBJ)
+KSRC_TREE?=$(LINUX)
+IB_OPTIONS?=""
 
 # Packages
 PATCH_PKG=linux-patch-lustre
 UTILS_PKG=lustre-utils
 TESTS_PKG=lustre-tests
 DEV_PKG=lustre-dev
-LIB_PKG=liblustre
 SOURCE_PKG=lustre-source
 MODS_PKG=lustre-client-modules
 
@@ -101,10 +98,8 @@ autogen-stamp: patch-stamp
                        exit 1; \
                fi; \
                cp /usr/share/misc/config.sub config.sub; \
-               cp /usr/share/misc/config.sub libsysio/config.sub; \
                cp /usr/share/misc/config.sub ldiskfs/config.sub; \
                cp /usr/share/misc/config.guess config.guess; \
-               cp /usr/share/misc/config.guess libsysio/config.guess; \
                cp /usr/share/misc/config.guess ldiskfs/config.guess; \
                sh build/autogen.sh; \
        fi; \
@@ -116,10 +111,9 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
        # touch files to same date, to avoid auto*
        find . -type f -print0 | xargs -0 touch -r COPYING; \
        if [ "$(BUILDDIR)" != "." ]; then \
-               mkdir -p $(BUILDDIR)/build $(BUILDDIR)/lustre/contrib $(BUILDDIR)/libsysio; \
+               mkdir -p $(BUILDDIR)/build $(BUILDDIR)/lustre/contrib; \
                cp build/Makefile $(BUILDDIR)/build/; \
                cp lustre/contrib/mpich-*.patch $(BUILDDIR)/lustre/contrib/; \
-               ln -s ../../../libsysio/include $(BUILDDIR)/libsysio/; \
        fi
        ( cd $(BUILDDIR) && \
         $(SRCDIR)/configure --disable-dependency-tracking \
@@ -150,8 +144,9 @@ build-stamp: patch-stamp configure-stamp
 # let's try and operate as close as the user would and not build modules
 # here (for now)
 # 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-$(LIB_PKG) binary-$(MODS_PKG) binary-kern-mods
-binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG)
+# binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) \
+# binary-$(MODS_PKG) binary-kern-mods
+binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG)
 
 binary-indep: binary-$(PATCH_PKG) binary-$(SOURCE_PKG)
 
@@ -203,7 +198,6 @@ binary-$(UTILS_PKG): build-stamp
        dh_installman -p $(UTILS_PKG)
        dh_install -p $(UTILS_PKG)
        dh_makeshlibs -p $(UTILS_PKG)
-       dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib
        dh_installexamples -p $(UTILS_PKG)
        dh_installchangelogs -p $(UTILS_PKG) lustre/ChangeLog
        dh_compress -p $(UTILS_PKG)
@@ -222,7 +216,6 @@ binary-$(TESTS_PKG): build-stamp
        dh_installman -p $(TESTS_PKG)
        dh_install -p $(TESTS_PKG)
        dh_makeshlibs -p $(TESTS_PKG)
-       dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib
        dh_installexamples -p $(TESTS_PKG)
        dh_installchangelogs -p $(TESTS_PKG) lustre/ChangeLog
        dh_compress -p $(TESTS_PKG)
@@ -247,23 +240,6 @@ binary-$(DEV_PKG): build-stamp
        dh_md5sums -p $(DEV_PKG)
        dh_builddeb -p $(DEV_PKG)
 
-binary-$(LIB_PKG): build-stamp
-       dh_testdir
-       dh_testroot
-       dh_installdirs -p $(LIB_PKG)
-       dh_installdocs -p $(LIB_PKG)
-       dh_install -p $(LIB_PKG)
-       dh_makeshlibs -p $(LIB_PKG)
-       dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib
-       dh_installchangelogs -p $(LIB_PKG) lustre/ChangeLog
-       dh_compress -p $(LIB_PKG)
-       dh_installdeb -p $(LIB_PKG)
-       dh_strip -p $(LIB_PKG)
-       dh_fixperms -p $(LIB_PKG)
-       dh_gencontrol -p $(LIB_PKG)
-       dh_md5sums -p $(LIB_PKG)
-       dh_builddeb -p $(LIB_PKG)
-
 binary-$(SOURCE_PKG): build-stamp
        dh_testdir 
        dh_testroot
@@ -311,7 +287,6 @@ binary-$(MODS_PKG): build-stamp
                dh_installdocs -p $(MODS_PKG)-$(KVER); \
                dh_install -p $(MODS_PKG)-$(KVER); \
                dh_makeshlibs -p $(MODS_PKG)-$(KVER); \
-               dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib; \
                dh_installchangelogs -p $(MODS_PKG)-$(KVER) lustre/ChangeLog; \
                dh_compress -p $(MODS_PKG)-$(KVER); \
                dh_installdeb -p $(MODS_PKG)-$(KVER); \
@@ -360,26 +335,28 @@ kdist_config: prep-deb-files patch-stamp
        # touch files to same date, to avoid auto*
        find . -type f -print0 | xargs -0 touch -r COPYING \;
        # Doesn't seem possible to only build modules...
-       ./configure --with-linux=$(KSRC) \
+       ./configure --with-linux=$(KSRC_TREE) \
+                   --with-linux-obj=$(KSRC) \
+                   --disable-server \
                    --disable-quilt  \
                    --disable-dependency-tracking \
                    --disable-doc  \
                    --disable-utils \
-                   --disable-liblustre \
+                   --disable-iokit \
                    --disable-snmp \
-                   --enable-ldiskfs \
-                   --disable-zerocopy \
                    --disable-tests \
-                   --enable-quota
+                   --enable-quota \
+                   --with-kmp-moddir=updates \
+                   $(IB_OPTIONS)
 
-kdist_configure: kdist_config 
+kdist_configure: kdist_config
 
 # the binary-modules rule is invoked by module-assistant while processing the
 # kdist* targets. It is called by module-assistant or make-kpkg and *not*
 # during a normal build
 binary-modules: prep-deb-files
        dh_testroot
-       dh_clean -k
+       dh_prep
        $(MAKE) $(PMAKEARGS)
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
        # Remove stuff that doesn't belong (no module-only target)
@@ -393,7 +370,7 @@ binary-modules: prep-deb-files
        dh_gencontrol -- -v$(VERSION)
        dh_md5sums -p $(PKGNAME)
        dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME)
-       dh_clean -k -p $(PKGNAME)
+       dh_prep -p $(PKGNAME)
 
 clean:
        dh_testdir