2 # SPDX-License-Identifier: NOASSERTION
5 # This file is part of Lustre, http://www.lustre.org/
11 # Copying and modification is unlimited, provided that the modified
12 # version is marked as being modified.
13 # (This version has been modified from the original)
15 # Created 2009 by Brian J. Murrell based on work by
16 # Alastair McKinstry, <alastair.mckinstry@ichec.ie>, <mckinstry@debian.org>
17 # Patrick Winnertz, and the pkg-lustre Debian maintainers
20 # Uncomment this to turn on verbose mode.
23 DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
24 DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
27 # whether to use module-assistant to build the kernel modules or not
30 # Whether to build the DKMS packages
33 ifeq ($(BUILD_DKMS),true)
34 DKMS_TARGET = binary-$(DKMS_PKG)
40 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
46 # This is the debhelper compatibility version to use.
49 # Module-assistant stuff
50 ifneq (,$(findstring server,$(DEB_BUILD_PROFILES)))
51 PACKAGE=lustre-server-modules
53 PACKAGE=lustre-client-modules
55 MA_DIR ?= /usr/share/modass
56 -include $(MA_DIR)/include/generic.make
57 -include $(MA_DIR)/include/common-rules.make
59 ARCH=$(shell dpkg --print-architecture)
62 # This is the Lustre version
63 VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog)
64 UPVERSION=$(shell echo $(VERSION) | sed -e 's/-[^-]*$$//')
66 # KVER is set to LINUXRELEASE being by autoconf which is either
67 # $(uname -r) or the version of the source specified by the user
70 # KVERS, KSRC are the kernel version and source to use when building lustre
71 # Will be the default when building lustre-{server,client}-utils, etc but whatever module-assistant
72 # supplied when building modules
76 EXTRA_OPTIONS?=$(IB_OPTIONS)
78 ifneq ($(SYSTEMD_OPTIONS),)
79 EXTRA_OPTIONS += $(SYSTEMD_OPTIONS)
82 # Packages provided for both client and server builds
83 IOKIT_PKG=lustre-iokit
84 TESTS_PKG=lustre-tests
86 SOURCE_PKG=lustre-source
88 # Packages that are only built for server OR client builds
89 # The difference is that server build contain more modules & utils
90 ifneq (,$(findstring server,$(DEB_BUILD_PROFILES)))
91 UTILS_PKG=lustre-server-utils
92 MODS_PKG=lustre-server-modules
93 RESOURCE_PKG=lustre-resource-agents
94 RESOURCE_TARGET=binary-$(RESOURCE_PKG)
97 UTILS_PKG=lustre-client-utils
98 MODS_PKG=lustre-client-modules
101 DKMS_PKG=lustre-client-modules-dkms
105 #BUILDDIR=debian/build
107 # I'm afraid we seem to have broken the BUILDDIR concept in Lustre's
112 AVAIL_CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
113 ifneq ($(AVAIL_CPUS),1)
114 PMAKEARGS := -j $(AVAIL_CPUS)
117 autogen: autogen-stamp
118 autogen-stamp: patch-stamp
119 # see if any patches requires us to run autogen
120 # (for a distribution release tarball, it is expected that if
121 # downstream adds any patches that requires autogen.sh to be
122 # run, a patch will be added by downstream to install the
123 # needed autogen.sh scripts
124 # see https://bugzilla.lustre.org/attachment.cgi?id=27156
126 if grep -e "^--- .*\/autoconf\/" \
127 -e "^--- .*\/autoMakefile\.am" \
128 -e "^--- .*\/Makefile\.am" \
129 -e "^--- .*\/configure\.ac" \
130 -e "^--- .*\/configure\.in" \
131 debian/patches/*; then \
132 if [ ! -f build/autogen.sh ]; then \
133 echo "You have patches which require autogen.sh to be run, but it doesn't exist"; \
134 echo "Please see https://bugzilla.lustre.org/attachment.cgi?id=27156"; \
137 cp /usr/share/misc/config.sub config.sub; \
138 cp /usr/share/misc/config.sub ldiskfs/config.sub; \
139 cp /usr/share/misc/config.guess config.guess; \
140 cp /usr/share/misc/config.guess ldiskfs/config.guess; \
141 bash build/autogen.sh; \
145 # This section configures the lustre-utilities packages.
147 # Both client and server builds are quite similar, as the utilities build
148 # must create the modules too, to produce the "osd_<fstype>.so" libraries.
150 # The main difference is that the utilities build does not archive the
151 # modules, whereas the modules build omits the utilities, to create two
152 # neatly separated debian files.
154 # Note: KERNEL_SRC, KERNEL_OBJ, ZFS_SRC and SPL_SRC need to be set from the
155 # outside. This is done by "make debs". As such, invoking "debuild" or such
156 # direct debian build tools will lead to a client-only build.
157 configure: configure-stamp
158 configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
160 # touch files to same date, to avoid auto*
161 find . -type f -print0 | xargs -0 touch -r COPYING; \
162 if [ "$(BUILDDIR)" != "." ]; then \
163 mkdir -p $(BUILDDIR)/build $(BUILDDIR)/lustre/contrib; \
164 cp build/Makefile $(BUILDDIR)/build/; \
166 # Determine flags that are different between server/client module builds
167 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"
168 if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \
169 export EXTRAFLAGS="--enable-server"; \
170 if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \
171 systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \
172 sed -e "s/--with-systemdsystemunitdir=\///g" \
173 -e "s/\//\\\\\//g"); \
174 sed "s/lib\/systemd\/system/$${systemd_dir}/g" \
175 debian/lustre-server-utils.install.in \
176 > debian/lustre-server-utils.install; \
178 sed /systemd/d debian/lustre-server-utils.install.in \
179 > debian/lustre-server-utils.install; \
182 export EXTRAFLAGS="--disable-server"; \
183 if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \
184 systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \
185 sed -e "s/--with-systemdsystemunitdir=\///g" \
186 -e "s/\//\\\\\//g"); \
187 sed "s/lib\/systemd\/system/$${systemd_dir}/g" \
188 debian/lustre-client-utils.install.in \
189 > debian/lustre-client-utils.install; \
191 sed /systemd/d debian/lustre-client-utils.install.in \
192 > debian/lustre-client-utils.install; \
195 if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \
196 export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \
198 export EXTRAFLAGS="$${EXTRAFLAGS} --without-zfs" ; \
200 if echo "$${DEB_BUILD_PROFILES}" | grep -q "ldiskfs"; then \
201 export EXTRAFLAGS="$${EXTRAFLAGS} \
202 --enable-ldiskfs --enable-quilt"; \
204 export EXTRAFLAGS="$${EXTRAFLAGS} --disable-ldiskfs"; \
206 if echo "$${DEB_BUILD_PROFILES}" | grep -q "multiple-lnds"; then \
207 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-multiple-lnds"; \
209 if echo "$${DEB_BUILD_PROFILES}" | grep -q "ext_o2ib"; then \
210 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \
211 elif echo "$${DEB_BUILD_PROFILES}" | grep -q "int_o2ib"; then \
212 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=yes"; \
214 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=no"; \
216 if echo "$${DEB_BUILD_PROFILES}" | grep -q "gnilnd"; then \
217 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gni"; \
219 if echo "$${DEB_BUILD_PROFILES}" | grep -q "kfilnd"; then \
220 export EXTRAFLAGS="$${EXTRAFLAGS} --with-kfi=/usr/src/kfabric"; \
222 options="gss crypto pinger checksum flock lru-resize"; \
223 options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \
224 options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \
225 options="$${options} panic_dumplog readline libpthread"; \
226 options="$${options} backoff gni efence"; \
227 for option in $${options}; do \
228 if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \
229 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \
230 elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \
231 export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \
234 if [ -f "$${CONFIG_CACHE_FILE}" ]; then \
235 export TMP_CACHE_FILE=$$(mktemp); \
236 sed -e "/ac_cv_env/d" \
237 -e "/am_cv_CC_dependencies_compiler_type/d" \
238 -e "/lb_cv_mpi_tests/d" \
239 "$${CONFIG_CACHE_FILE}" > $${TMP_CACHE_FILE}; \
240 export EXTRAFLAGS="$${EXTRAFLAGS} --cache-file=$${TMP_CACHE_FILE}"; \
242 echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \
243 ( cd $(BUILDDIR) && \
244 $(SRCDIR)/configure --disable-dependency-tracking \
245 --with-linux=$${KERNEL_SRC} \
246 --with-linux-obj=$${KERNEL_OBJ} \
253 build-arch build-indep: build
256 build-stamp: patch-stamp configure-stamp
258 $(MAKE) -C $(BUILDDIR) $(PMAKEARGS)
259 $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install
260 # jump our lustre-[client|server]-modules into the control file if not using m-a
261 if ! $(USE_MA); then \
262 (cat debian/control.main; sed -e '1,/^$$/d' -e "s/_KVERS_/$(KVER)/g" < debian/control.modules.in) > debian/control; \
263 for file in debian/*_KVERS_*; do \
264 newfile=$$(echo $$file | sed -e "s/_KVERS_/$(KVER)/g"); \
265 cp $$file $$newfile; \
270 # let's try and operate as close as the user would and not build modules
272 # instead we will build the modules with m-a in the "make debs" target
273 # binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) \
274 # binary-$(MODS_PKG) binary-kern-mods
275 binary-arch: binary-$(UTILS_PKG) binary-$(DEV_PKG) \
276 binary-$(IOKIT_PKG) binary-$(TESTS_PKG) \
279 binary-indep: binary-$(SOURCE_PKG) $(DKMS_TARGET)
281 binary: binary-indep binary-arch
283 binary-$(UTILS_PKG): build-stamp
286 dh_installdirs -p $(UTILS_PKG)
287 dh_installdocs -p $(UTILS_PKG)
288 dh_installman -p $(UTILS_PKG)
289 dh_install -p $(UTILS_PKG)
290 rm -rf debian/$(UTILS_PKG)/usr/bin/iokit-* \
291 debian/$(UTILS_PKG)/usr/bin/*-survey \
292 debian/$(UTILS_PKG)/usr/bin/mcreate \
293 debian/$(UTILS_PKG)/usr/bin/statx \
294 debian/$(UTILS_PKG)/usr/sbin/wirecheck \
295 debian/$(UTILS_PKG)/usr/sbin/wiretest
296 dh_makeshlibs -p $(UTILS_PKG)
297 dh_installexamples -p $(UTILS_PKG)
298 dh_installchangelogs -p $(UTILS_PKG) lustre/ChangeLog
299 dh_compress -p $(UTILS_PKG)
300 dh_strip -p $(UTILS_PKG)
301 dh_installdeb -p $(UTILS_PKG)
302 dh_fixperms -p $(UTILS_PKG)
303 dh_gencontrol -p $(UTILS_PKG)
304 dh_md5sums -p $(UTILS_PKG)
305 dh_builddeb -p $(UTILS_PKG)
307 binary-$(RESOURCE_PKG): build-stamp
310 dh_installdirs -p $(RESOURCE_PKG)
311 dh_installdocs -p $(RESOURCE_PKG)
312 dh_installman -p $(RESOURCE_PKG)
313 dh_install -p $(RESOURCE_PKG)
314 dh_makeshlibs -p $(RESOURCE_PKG)
315 dh_installexamples -p $(RESOURCE_PKG)
316 dh_installchangelogs -p $(RESOURCE_PKG) lustre/ChangeLog
317 dh_compress -p $(RESOURCE_PKG)
318 dh_strip -p $(RESOURCE_PKG)
319 dh_installdeb -p $(RESOURCE_PKG)
320 dh_fixperms -p $(RESOURCE_PKG)
321 dh_gencontrol -p $(RESOURCE_PKG)
322 dh_md5sums -p $(RESOURCE_PKG)
323 dh_builddeb -p $(RESOURCE_PKG)
325 binary-$(IOKIT_PKG): build-stamp
328 dh_installdirs -p $(IOKIT_PKG)
329 dh_installdocs -p $(IOKIT_PKG)
330 dh_installman -p $(IOKIT_PKG)
331 dh_install -p $(IOKIT_PKG)
332 rm -rf debian/$(IOKIT_PKG)/usr/bin/lustre_req_history \
333 debian/$(IOKIT_PKG)/usr/bin/*ll*stat \
334 debian/$(IOKIT_PKG)/usr/bin/lfs-*
335 dh_makeshlibs -p $(IOKIT_PKG)
336 dh_installexamples -p $(IOKIT_PKG)
337 dh_installchangelogs -p $(IOKIT_PKG) lustre/ChangeLog
338 dh_compress -p $(IOKIT_PKG)
339 dh_strip -p $(IOKIT_PKG)
340 dh_installdeb -p $(IOKIT_PKG)
341 dh_fixperms -p $(IOKIT_PKG)
342 dh_gencontrol -p $(IOKIT_PKG)
343 dh_md5sums -p $(IOKIT_PKG)
344 dh_builddeb -p $(IOKIT_PKG)
346 binary-$(TESTS_PKG): build-stamp
349 dh_installdirs -p $(TESTS_PKG)
350 dh_installdocs -p $(TESTS_PKG)
351 dh_installman -p $(TESTS_PKG)
352 dh_install -p $(TESTS_PKG)
353 dh_makeshlibs -p $(TESTS_PKG)
354 dh_installexamples -p $(TESTS_PKG)
355 dh_installchangelogs -p $(TESTS_PKG) lustre/ChangeLog
356 dh_compress -p $(TESTS_PKG)
357 dh_strip -p $(TESTS_PKG)
358 dh_installdeb -p $(TESTS_PKG)
359 dh_fixperms -p $(TESTS_PKG)
360 dh_gencontrol -p $(TESTS_PKG)
361 dh_md5sums -p $(TESTS_PKG)
362 dh_builddeb -p $(TESTS_PKG)
364 binary-$(DEV_PKG): build-stamp
367 dh_installdirs -p $(DEV_PKG)
368 dh_install -p $(DEV_PKG)
369 dh_installdocs -p $(DEV_PKG)
370 dh_installchangelogs -p $(DEV_PKG) lustre/ChangeLog
371 dh_compress -p $(DEV_PKG)
372 dh_installdeb -p $(DEV_PKG)
373 dh_fixperms -p $(DEV_PKG)
374 dh_gencontrol -p $(DEV_PKG)
375 dh_md5sums -p $(DEV_PKG)
376 dh_builddeb -p $(DEV_PKG)
378 binary-$(SOURCE_PKG): build-stamp
382 dh_installdirs -p $(SOURCE_PKG) usr/src/modules/lustre/debian
383 rsync -av --exclude='debian/$(SOURCE_PKG)/*' \
385 . debian/$(SOURCE_PKG)/usr/src/modules/lustre
386 # Remove FULLCLEAN setting
387 rm debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/rules
388 cp -v debian/rules debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/rules
389 sed -i -e 's/FULLCLEAN=full-clean/FULLCLEAN=/' debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/rules
391 rm -rf debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patched \
392 debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patches/*
393 $(MAKE) -C debian/$(SOURCE_PKG)/usr/src/modules/lustre -f debian/rules clean
394 # Create the module-source tarball.
395 cd debian/$(SOURCE_PKG)/usr/src && tar --exclude-vcs -jcf lustre-$${SRC_GIT_HASH}.tar.bz2 modules
396 rm -rf debian/$(SOURCE_PKG)/usr/src/modules
397 dh_install -p$(SOURCE_PKG)
398 dh_installchangelogs -p $(SOURCE_PKG) lustre/ChangeLog
399 dh_installdocs -p $(SOURCE_PKG)
400 dh_link -p $(SOURCE_PKG) /usr/share/modass/packages/default.sh /usr/share/modass/overrides/lustre-source
401 dh_compress -p $(SOURCE_PKG)
402 dh_installdeb -p $(SOURCE_PKG)
403 dh_fixperms -p $(SOURCE_PKG)
404 dh_gencontrol -p $(SOURCE_PKG)
405 dh_md5sums -p $(SOURCE_PKG)
406 dh_builddeb -p $(SOURCE_PKG)
408 binary-$(DKMS_PKG): build-stamp
411 # Create /usr/src/lustre-client-modules-<version>
412 dh_installdirs -p $(DKMS_PKG) usr/src/lustre-client-modules-$(UPVERSION)
414 rsync -av --exclude='debian/$(DKMS_PKG)/*' --exclude='.git/' \
416 . debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION)
418 $(MAKE) -C debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION) -f debian/rules clean
420 # Put the DKMS configuration file in place
421 sed -e 's/[@]UPVERSION[@]/$(UPVERSION)/' debian/dkms.conf.in > debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION)/dkms.conf
422 dh_install -p $(DKMS_PKG)
423 dh_installchangelogs -p $(DKMS_PKG) lustre/ChangeLog
424 dh_installdocs -p $(DKMS_PKG)
425 dh_compress -p $(DKMS_PKG)
426 dh_installdeb -p $(DKMS_PKG)
427 dh_strip -p $(DKMS_PKG)
428 dh_fixperms -p $(DKMS_PKG)
429 dh_gencontrol -p $(DKMS_PKG)
430 dh_md5sums -p $(DKMS_PKG)
431 dh_builddeb -p $(DKMS_PKG)
433 # if only we could use m-a for this, but this stupid "compliant.list"
434 # thing fouls that up
436 # Build client or server modules
437 mkdir -p debian/m-a_root/usr_src/modules
438 ln -s ../../../../ debian/m-a_root/usr_src/modules/lustre
439 m-a -t -u debian/m-a_root/ -d -v -k $(KSRC) build lustre
440 mv -f debian/m-a_root/*.deb ..
442 # an alternative (to module-assistant) method of building the kernel modules
443 binary-$(MODS_PKG): build-stamp
444 if ! $(USE_MA); then \
445 cp debian/$(MODS_PKG).install debian/$(MODS_PKG)-$(KVER).install ; \
448 dh_installdirs -p $(MODS_PKG)-$(KVER); \
449 dh_installdocs -p $(MODS_PKG)-$(KVER); \
450 dh_install -p $(MODS_PKG)-$(KVER); \
451 dh_makeshlibs -p $(MODS_PKG)-$(KVER); \
452 dh_installchangelogs -p $(MODS_PKG)-$(KVER) lustre/ChangeLog; \
453 dh_compress -p $(MODS_PKG)-$(KVER); \
454 dh_installdeb -p $(MODS_PKG)-$(KVER); \
455 dh_strip -p $(MODS_PKG)-$(KVER); \
456 dh_fixperms -p $(MODS_PKG)-$(KVER); \
457 dh_gencontrol -p $(MODS_PKG)-$(KVER); \
458 dh_md5sums -p $(MODS_PKG)-$(KVER); \
459 dh_builddeb -p $(MODS_PKG)-$(KVER); \
464 ### For module-assistant
467 # the kdist_clean target is called by make-kpkg modules_clean and from
468 # kdist* rules. It is responsible for cleaning up any changes that have
469 # been made by the other kdist_commands (except for the .deb files created)
472 # can't dh_clean here or we remove the build artifacts for the other packages
475 #-$(MAKE) $(MFLAGS) -f debian/rules clean
476 # put the userspace tools' control file back
477 cp debian/control.main debian/control
480 # module assistant calculates all needed things for us and sets
481 # # following variables:
482 # # KSRC (kernel source directory), KVERS (kernel version string), KDREV
483 # # (revision of the Debian kernel-image package), CC (the correct
484 # # compiler), VERSION (the final package version string), PKGNAME (full
485 # # package name with KVERS included), DEB_DESTDIR (path to store DEBs)
487 # # The kdist_configure target is called by make-kpkg modules_config and
488 # # by kdist* rules by dependency. It should configure the module so it is
489 # # ready for compilation (mostly useful for calling configure).
490 # # prep-deb-files from module-assistant creates the neccessary debian/
491 kdist_config: prep-deb-files patch-stamp
492 # Check build dependencies again, needs to be done since we just
493 # replaced the control file.
495 # Prepare the kernel to lustres' liking
496 # as non-root, we won't have permission for this
497 #-$(MAKE) -C $(KSRC) prepare scripts
498 # touch files to same date, to avoid auto*
499 find . -type f -print0 | xargs -0 touch -r COPYING \;
500 # Determine flags that are different between server/client module builds
501 # Note: It doesn't seem possible to *only* build modules.
502 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"
503 if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \
504 export EXTRAFLAGS="--enable-server"; \
506 export EXTRAFLAGS="--disable-server"; \
508 if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \
509 export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \
511 export EXTRAFLAGS="$${EXTRAFLAGS} --without-zfs" ; \
513 if echo "$${DEB_BUILD_PROFILES}" | grep -q "ldiskfs"; then \
514 export EXTRAFLAGS="$${EXTRAFLAGS} \
515 --enable-ldiskfs --enable-quilt"; \
517 export EXTRAFLAGS="$${EXTRAFLAGS} \
518 --disable-ldiskfs --disable-quilt"; \
520 if echo "$${DEB_BUILD_PROFILES}" | grep -q "multiple-lnds"; then \
521 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-multiple-lnds"; \
523 if echo "$${DEB_BUILD_PROFILES}" | grep -q "ext_o2ib"; then \
524 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \
525 elif echo "$${DEB_BUILD_PROFILES}" | grep -q "int_o2ib"; then \
526 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=yes"; \
528 export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=no"; \
530 if echo "$${DEB_BUILD_PROFILES}" | grep -q "gnilnd"; then \
531 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gni"; \
533 if echo "$${DEB_BUILD_PROFILES}" | grep -q "kfilnd"; then \
534 export EXTRAFLAGS="$${EXTRAFLAGS} --with-kfi=/usr/src/kfabric"; \
536 options="gss crypto pinger checksum flock lru-resize"; \
537 options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \
538 options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \
539 options="$${options} panic_dumplog readline libpthread"; \
540 options="$${options} backoff gni efence"; \
541 for option in $${options}; do \
542 if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \
543 export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \
544 elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \
545 export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \
548 if echo "$${DEB_BUILD_PROFILES}" | grep -q "notests"; then \
549 export EXTRAFLAGS="$${EXTRAFLAGS} --disable-tests"; \
551 if [ -f "$${CONFIG_CACHE_FILE}" ]; then \
552 export TMP_CACHE_FILE=$$(mktemp --tmpdir newconfig-XXXXXXXX.cache); \
553 sed -e "/ac_cv_env/d" \
554 -e "/am_cv_CC_dependencies_compiler_type/d" \
555 -e "/lb_cv_mpi_tests/d" \
556 "$${CONFIG_CACHE_FILE}" > $${TMP_CACHE_FILE}; \
557 export EXTRAFLAGS="$${EXTRAFLAGS} --cache-file=$${TMP_CACHE_FILE}"; \
559 echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \
560 ./configure --with-linux=$(KSRC_TREE) \
561 --with-linux-obj=$(KSRC) \
562 --disable-dependency-tracking \
566 --with-kmp-moddir=updates/kernel \
571 kdist_configure: kdist_config
573 # the binary-modules rule is invoked by module-assistant while processing the
574 # kdist* targets. It is called by module-assistant or make-kpkg and *not*
575 # during a normal build
576 binary-modules: prep-deb-files
580 $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
581 # Remove stuff that doesn't belong (no module-only target)
582 cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr/bin usr/sbin usr/lib usr/share usr/include/lustre lib/systemd sbin etc
583 dh_installdocs -p$(PKGNAME)
584 dh_installchangelogs -p$(PKGNAME)
585 dh_installmodules -p $(PKGNAME)
586 dh_compress -p $(PKGNAME)
587 dh_fixperms -p $(PKGNAME)
588 sed "s/depmod -a/depmod -a $(KVERS)/" $(CURDIR)/debian/postinst > $(CURDIR)/debian/$(PKGNAME).postinst
589 sed "s/depmod -a/depmod -a $(KVERS)/" $(CURDIR)/debian/postrm > $(CURDIR)/debian/$(PKGNAME).postrm
590 chmod +x $(CURDIR)/debian/$(PKGNAME).postinst $(CURDIR)/debian/$(PKGNAME).postrm
591 dh_installdeb -p $(PKGNAME)
592 dh_gencontrol -- -v$(VERSION)
593 dh_md5sums -p $(PKGNAME)
594 dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME)
595 dh_prep -p $(PKGNAME)
600 dpatch deapply-all -v
602 rm -rf debian/substvars debian/*.bak debian/*~ *~ *-stamp
603 ls -d debian/lustre-*-modules-* | grep -v _KVERS_ | grep -v dkms | xargs rm -f || true
604 # only remove this if the clean was not called from kdist_clean
605 if [ "$$MA_SOURCE_PKG" = "" ]; then \
606 rm -rf debian/m-a_root; \
609 # make sure we have at least a basic control in place (see build-stamp)
611 cp debian/control.main debian/control
619 dpatch deapply-all -v
620 rm -rf debian/patched patch-stamp
622 .PHONY: binary-arch clean source diff binary binary-indep binary-arch install configure