3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_iokit
9 %bcond_without lustre_modules
11 %if %{without servers}
12 # --without servers overrides --with {ldiskfs|zfs}
13 # so undefine the internal variables set by bcond_*
14 %undefine with_ldiskfs
18 %{!?version: %global version @VERSION@}
19 %{!?kver: %global kver ""}
20 %{!?kdir: %global kdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; echo "/lib/modules/$kversion/source"; fi)}
22 %{!?kobjdir: %global kobjdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux-obj=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; if [ "%kdir" = "/lib/modules/$kversion/source" ]; then echo "/lib/modules/$kversion/build"; else echo "%kdir"; fi; fi)}
24 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
25 %{!?kversion: %global kversion %(if test -s %kobjdir/include/generated/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/generated/utsrelease.h ; elif test -s %kobjdir/include/linux/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/linux/utsrelease.h ; else LINUXRELEASEHEADER=%kobjdir/include/linux/version.h; fi; sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' $LINUXRELEASEHEADER)}
27 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
31 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
33 # always append the buildid, even when the caller defines %release
34 %define fullrelease %{myrelease}%{buildid}
36 # in order to get kernel symset and/or kernel module dependencies into
37 # the RPM, in order to support weak-modules, the internal dependency gen-
38 # erator needs to be disabled
39 # this is done with (reduce the double % down to a single %):
41 # %%global _use_internal_dependency_generator 0
43 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
44 # defining it here (until Suse changes their mind)
46 # on RHEL5, however, we do need to explicitly disable the internal dep-
47 # endency generator and allow the external one be used
48 # but since RedHat's kABI is only a subset of the total kernel ABI, it
49 # doesn't include all of the symbols we (or OFED for that matter) need
50 # until RedHat includes all of the symbols we need in their symsets we
51 # cannot support weak-modules
52 # we did e-mail the maintainer of all of this stuff @redhat but got no
54 #%%global _use_internal_dependency_generator 0
56 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
58 %define krequires %(bash -c "echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/-ppc64$//' -e 's/-default$//'")
60 # Set the package name prefix
61 %if %{undefined lustre_name}
63 %global lustre_name lustre
65 %global lustre_name lustre-client
69 %if %{undefined kmoddir}
70 %if %{defined kernel_module_package_moddir}
71 %global kmoddir %{kernel_module_package_moddir}
73 %if %{defined suse_kernel_module_package}
74 %global kmoddir updates
81 %if %{defined cross_path} && %{defined post_script}
82 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
85 Summary: Lustre File System
88 Release: %{fullrelease}
90 Group: Utilities/System
91 Source: lustre-%{version}.tar.gz
92 URL: http://wiki.whamcloud.com/
93 BuildRoot: %{_tmppath}/lustre-%{version}-root
94 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
95 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
96 Requires: %{name}-modules = %{version}
97 BuildRequires: libtool
101 %if %{defined cross_requires}
102 Requires: %{cross_requires}
105 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
106 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
107 #suse don't support selinux
108 BuildRequires: libselinux-devel
114 Userspace tools and files for the Lustre file system.
116 %if %{with lustre_modules}
118 Summary: Kernel Lustre modules for Linux %{kversion}
119 %if %{defined cross_requires}
120 Requires: %{cross_requires}
123 # for SLES11, we need nothing here
124 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
125 # for RHEL we need to require the specific kernel still since weak-modules
126 # support on RH is, well, weak, to be punny about it
127 Requires: kernel = %{krequires}
130 Group: Development/Kernel
133 Lustre file system, server and network drivers for Linux %{kversion}.
137 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
138 Requires: lustre-modules = %{version}
139 Requires: modutils >= 2.4.10
140 Requires: ldiskfsprogs >= 1.42.7.wc1
142 Obsoletes: lustre-ldiskfs
143 Group: Development/Kernel
145 %description osd-ldiskfs
146 The Lustre Object Storage Device (OSD) API is the interface to access and
147 modify data that is supposed to be stored persistently. This API is the interface
148 to code that bridges individual file systems. This specific package provides an
149 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
150 backing store of a Lustre server.
155 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
156 Requires: lustre-modules = %{version}, zfs-kmod
158 Group: Development/Kernel
161 The Lustre Object Storage Device (OSD) API is the interface to access and
162 modify data that is supposed to be stored persistently. This API is the interface
163 to code that bridges individual file systems. This specific package provides an
164 implementation of the OSD API for using the ZFS filesystem as the underlying
165 backing store of a Lustre server.
167 %endif # with lustre_modules
170 Summary: Object-Based Disk storage driver source
171 Group: Development/Kernel
174 Lustre sources for further development
176 # Since the RPMs we ship are to be used on both SLES and RHEL, we
177 # can't include any dependency information (since the package names
178 # are different on the two platforms).
180 # Instead, we can build these empty meta-packages that only include
181 # dependency information. These let people get the correct
182 # dependencies for their platform and lets them use tools like yum and
183 # red carpet to install the correct files.
185 # Unfortunately I have not seen this come up on the lists much, so I
186 # have disabled them (by commenting out their empty files section
187 # below) until it's clear that they resolve more confusion than they
191 Summary: Lustre dependencies meta-package for SLES
192 Group: Utilities/System
193 Provides: lustre-deps = %{version}
194 Requires: %{name} = %{version}, sles-release
195 Conflicts: %{name}-deps-rhel
197 %description deps-sles
198 This package has RPM dependencies appropriate for SLES systems.
201 Summary: Lustre dependencies meta-package for RHEL
202 Group: Utilities/System
203 Provides: lustre-deps = %{version}
204 Requires: %{name} = %{version}, redhat-release
205 Conflicts: %{name}-deps-sles
207 %description deps-rhel
208 This package has RPM dependencies appropriate for RHEL, RHL, and FC
212 Summary: Lustre testing framework
213 Group: Development/Kernel
214 Provides: %{name}-tests = %{version}
215 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
218 This package contains a set of test binaries and scripts that are intended
219 to be used by the Lustre testing framework.
221 %if %{with lustre_iokit}
222 %package -n lustre-iokit
223 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
224 Group: Applications/System
225 Requires: python > 2.2, sg3_utils
227 %description -n lustre-iokit
228 This package includes five tools:
230 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
233 This survey can be run in 3 modes to test disk I/O including the filesystem,
234 network I/O, and disk I/O via the network. The script does sequential I/O
235 with varying numbers of threads and objects (files) by using lctl::test_brw
236 to drive the echo_client connected to local or remote obdfilter instances,
237 or remote obdecho instances.
240 This survey tests the client-to-disk performance of individual OSTs, and
241 ranks then for comparison.
244 This script will collect IO stats on a defined set of nodes.
247 A script to run the IOR benchmark. The latest version can be downloaded from
248 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
251 This survey tests the local metadata performance using the echo_client to drive
252 the MDD layer to perform operations. It is run with multiple threads (to
253 simulate MDT service threads) locally on the MDS node, and does not need Lustre
254 clients in order to run
257 %if 0%{?suse_version}
261 %setup -qn lustre-%{version}
262 ln lustre/ChangeLog ChangeLog-lustre
263 ln lnet/ChangeLog ChangeLog-lnet
267 # Set an explicit path to our Linux tree, if we can.
268 cd $RPM_BUILD_DIR/lustre-%{version}
269 # override %optflags so that the vendor's overzealous flags don't create
271 %define optflags -g -O2 -Werror
272 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
273 %if %{with lustre_tests}
274 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
276 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
278 %if %{without lustre_iokit}
279 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
282 %if %{with lustre_modules}
283 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
285 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
289 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
292 # if %%kdir was given, make sure it's not in the configure arguments
293 if [ -n "%kdir" ]; then
294 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
296 # ditto for %%kobjdir
297 if [ -n "%kobjdir" ]; then
298 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
300 # remove --with-kmp-moddir from configure arguments,
301 # it will be set --with-kmp-moddir=%%kmoddir
302 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
304 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
305 # string in it which we don't want word splitted by the shell
306 # also remove (build|host|target) options because they will be specified
307 # inside $CONFIGURE_ARGS
308 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
311 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
312 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
313 make %{?_smp_mflags} -s %{?make_args}
316 make install DESTDIR=$RPM_BUILD_ROOT
321 # The .ha_v2 extension identifies the heartbeat resource agent as using
322 # legacy syntax. Install a compatibility symlink to avoid conflicts when
323 # newer-style agents are added.
324 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
325 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
326 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
328 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
329 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
330 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
334 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
335 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
338 # Create the pristine source directory.
339 cd $RPM_BUILD_DIR/lustre-%{version}
340 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
342 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
343 make distdir distdir=lustre-source/lustre-%{version}
344 chmod -R go-w lustre-source/lustre-%{version}
345 # fc18 needs 'x' permission for library files
346 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
348 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
349 echo '%{_libdir}/libiam.a' >>lustre.files
352 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
353 echo '%{_libdir}/lustre/snmp' >>lustre.files
354 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
357 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@/ -name \*.la -delete
359 %if %{with lustre_tests}
360 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
361 echo '%{_bindir}/mcreate' >>lustre-tests.files
362 echo '%{_bindir}/munlink' >>lustre-tests.files
363 %if %{with lustre_modules}
364 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
368 %if %{defined cross_path}
369 %if %{defined rpm_post_base}
370 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
371 if [ -f $POST_SCRIPT ]; then
372 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
373 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
374 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
376 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
379 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
381 %if %{with lustre_tests}
382 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
383 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
388 # mark modules executable for find-debuginfo.sh
389 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko" -type f | \
390 xargs --no-run-if-empty chmod u+x
393 %files -f lustre.files
394 %defattr(-,root,root)
395 %{?rootdir}/sbin/mount.lustre
398 %{_bindir}/lfs_migrate
402 %{_bindir}/lustre_req_history
403 %{_bindir}/plot-llstat
404 %{_bindir}/req_layout
405 %{_libdir}/libptlctl.a
406 %{_libdir}/libcfsutil.a
407 %{_libdir}/liblustreapi.a
408 %{_libdir}/liblustreapi.so
411 %{_includedir}/lustre
412 %{_includedir}/libcfs
413 %{_includedir}/linux/lustre_user.h
414 %{_libexecdir}/lustre/lc_common
415 %{_libexecdir}/lustre/haconfig
416 %{_sysconfdir}/udev/rules.d/99-lustre.rules
417 %config(noreplace) %{_sysconfdir}/ldev.conf
419 %if %{with lustre_modules}
421 %defattr(-,root,root)
422 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
423 %if %{with lustre_tests}
424 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
427 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
428 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
431 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
433 %if %{defined rpm_post_base}
434 %attr(0555, root, root) %{rpm_post_base}-modules.sh
437 %doc ChangeLog-lustre
442 %defattr(-,root,root)
443 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
444 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
445 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
446 %if %{defined rpm_post_base}
447 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
453 %defattr(-,root,root)
454 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
455 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
456 %if %{defined rpm_post_base}
457 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
460 %endif # with lustre_modules
463 %defattr(-,root,root)
464 %{_prefix}/src/lustre-%{version}
466 # uncomment these lines to enable deps packages
470 %if %{with lustre_tests}
471 %files tests -f lustre-tests.files
472 %defattr(-,root,root)
475 %if %{with lustre_iokit}
476 %files -n lustre-iokit
477 %defattr(-, root, root)
478 %{_bindir}/iokit-config
479 %{_bindir}/iokit-gather-stats
480 %{_bindir}/iokit-libecho
481 %{_bindir}/iokit-lstats
482 %{_bindir}/iokit-parse-ior
483 %{_bindir}/iokit-plot-obdfilter
484 %{_bindir}/iokit-plot-ost
485 %{_bindir}/iokit-plot-sgpdd
486 %{_bindir}/ior-survey
487 %{_bindir}/mds-survey
488 %{_bindir}/obdfilter-survey
489 %{_bindir}/ost-survey
490 %{_bindir}/sgpdd-survey
491 %doc lustre-iokit/ior-survey/README.ior-survey
492 %doc lustre-iokit/mds-survey/README.mds-survey
493 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
494 %doc lustre-iokit/ost-survey/README.ost-survey
495 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
496 %doc lustre-iokit/stats-collect/README.iokit-lstats
499 %if %{defined rpm_post_base}
501 if [ -x %{rpm_post_base}.sh ]; then
502 %{rpm_post_base}.sh %{cross_path} create
506 if [ -x %{rpm_post_base}.sh ]; then
507 %{rpm_post_base}.sh %{cross_path} remove
511 %if %{with lustre_modules}
513 %if %{defined rpm_post_base}
514 if [ -x %{rpm_post_base}-modules.sh ]; then
515 %{rpm_post_base}-modules.sh %{cross_path} create
518 if [ -f /boot/System.map-%{kversion} ]; then
519 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
521 depmod -ae %{kversion} || exit 0
524 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
525 # "weak modules" support
527 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
528 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
529 /usr/lib/module-init-tools/weak-modules --add-modules
532 if [ -x /sbin/weak-modules ]; then
533 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
534 /sbin/weak-modules --add-modules
537 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
538 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
539 # print a warning so that users are aware of this issue.
540 if sysctl kernel.unsupported >/dev/null 2>&1 &&
541 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
542 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
544 warning: the Lustre modules are not supported by Novell. To use Lustre
545 on this system, you should put
547 allow_unsupported_modules 1
549 into /etc/modprobe.d/unsupported_modules"
555 %if %{defined rpm_post_base}
556 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
557 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
560 if [ -f /boot/System.map-%{kversion} ]; then
561 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
563 depmod -ae %{kversion} || exit 0
566 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
567 # "weak modules" support
569 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
570 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
571 /usr/lib/module-init-tools/weak-modules --add-modules
574 if [ -x /sbin/weak-modules ]; then
575 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
576 /sbin/weak-modules --add-modules
579 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
580 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
581 # print a warning so that users are aware of this issue.
582 if sysctl kernel.unsupported >/dev/null 2>&1 &&
583 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
584 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
586 warning: the Lustre modules are not supported by Novell. To use Lustre
587 on this system, you should put
589 allow_unsupported_modules 1
591 into /etc/modprobe.d/unsupported_modules"
598 %if %{defined rpm_post_base}
599 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
600 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
603 if [ -f /boot/System.map-%{kversion} ]; then
604 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
606 depmod -ae %{kversion} || exit 0
609 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
610 # "weak modules" support
612 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
613 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
614 /usr/lib/module-init-tools/weak-modules --add-modules
617 if [ -x /sbin/weak-modules ]; then
618 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
619 /sbin/weak-modules --add-modules
622 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
623 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
624 # print a warning so that users are aware of this issue.
625 if sysctl kernel.unsupported >/dev/null 2>&1 &&
626 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
627 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
629 warning: the Lustre modules are not supported by Novell. To use Lustre
630 on this system, you should put
632 allow_unsupported_modules 1
634 into /etc/modprobe.d/unsupported_modules"
640 %if %{defined rpm_post_base}
641 if [ -x %{rpm_post_base}-modules.sh ]; then
642 %{rpm_post_base}-modules.sh %{cross_path} remove
645 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
646 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
651 %if %{defined rpm_post_base}
652 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
653 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
656 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
657 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
663 %if %{defined rpm_post_base}
664 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
665 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
668 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
669 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
673 %if %{undefined cross_path}
675 if [ -f /boot/System.map-%{kversion} ]; then
676 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
678 depmod -ae %{kversion} || exit 0
681 # "weak modules" support
683 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
684 cat /var/run/%{name}-modules |
685 /usr/lib/module-init-tools/weak-modules --remove-modules
688 if [ -x /sbin/weak-modules ]; then
689 cat /var/run/%{name}-modules |
690 /sbin/weak-modules --remove-modules
692 rm /var/run/%{name}-modules
696 if [ -f /boot/System.map-%{kversion} ]; then
697 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
699 depmod -ae %{kversion} || exit 0
702 # "weak modules" support
704 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
705 cat /var/run/%{name}-osd-ldiskfs |
706 /usr/lib/module-init-tools/weak-modules --remove-modules
709 if [ -x /sbin/weak-modules ]; then
710 cat /var/run/%{name}-osd-ldiskfs |
711 /sbin/weak-modules --remove-modules
713 rm /var/run/%{name}-osd-ldiskfs
718 if [ -f /boot/System.map-%{kversion} ]; then
719 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
721 depmod -ae %{kversion} || exit 0
724 # "weak modules" support
726 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
727 cat /var/run/%{name}-osd-zfs |
728 /usr/lib/module-init-tools/weak-modules --remove-modules
731 if [ -x /sbin/weak-modules ]; then
732 cat /var/run/%{name}-osd-zfs |
733 /sbin/weak-modules --remove-modules
735 rm /var/run/%{name}-osd-zfs
738 %endif # with lustre_modules
740 %if %{with lustre_tests}
741 %if %{defined rpm_post_base}
743 if [ -x %{rpm_post_base}-tests.sh ]; then
744 %{rpm_post_base}-tests.sh %{cross_path} create
748 if [ -x %{rpm_post_base}-tests.sh ]; then
749 %{rpm_post_base}-tests.sh %{cross_path} remove
752 %if %{with lustre_modules}
754 if [ -f /boot/System.map-%{kversion} ]; then
755 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
757 depmod -ae %{kversion} || exit 0
761 if [ -f /boot/System.map-%{kversion} ]; then
762 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
764 depmod -ae %{kversion} || exit 0
771 rm -rf $RPM_BUILD_ROOT