2 %{!?version: %global version @VERSION@}
3 %{!?kver: %global kver ""}
4 %{!?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)}
6 %{!?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)}
8 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
9 %{!?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)}
11 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
13 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
15 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
17 # always append the buildid, even when the caller defines %release
18 %define fullrelease %{myrelease}%{buildid}
20 %{!?lustre_name: %global lustre_name lustre}
21 %{!?build_lustre_tests: %global build_lustre_tests 1}
23 %{!?build_lustre_osd_ldiskfs: %global build_lustre_osd_ldiskfs 0}
24 %{!?build_lustre_osd_zfs: %global build_lustre_osd_zfs 0}
26 # in order to get kernel symset and/or kernel module dependencies into
27 # the RPM, in order to support weak-modules, the internal dependency gen-
28 # erator needs to be disabled
29 # this is done with (reduce the double % down to a single %):
31 # %%global _use_internal_dependency_generator 0
33 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
34 # defining it here (until Suse changes their mind)
36 # on RHEL5, however, we do need to explicitly disable the internal dep-
37 # endency generator and allow the external one be used
38 # but since RedHat's kABI is only a subset of the total kernel ABI, it
39 # doesn't include all of the symbols we (or OFED for that matter) need
40 # until RedHat includes all of the symbols we need in their symsets we
41 # cannot support weak-modules
42 # we did e-mail the maintainer of all of this stuff @redhat but got no
44 #%%global _use_internal_dependency_generator 0
46 %define is_client %(bash -c "if [[ %{lustre_name} = *-client* ]]; then echo -n '1'; else echo -n '0'; fi")
47 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
49 %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$//'")
51 %define sles10 %(bash -c "if [ "%sles_version" = "10" ]; then echo -n '1'; else echo -n '0'; fi")
54 %define flavor %(bash -c "echo %{kversion} | sed -e 's/^.*-//'")
58 %define build_lustre_osd_ldiskfs 0
59 %define build_lustre_osd_zfs 0
62 %if %{defined cross_path} && %{defined post_script}
63 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
66 Summary: Lustre File System
69 Release: %{fullrelease}
71 Group: Utilities/System
72 Source: lustre-%{version}.tar.gz
73 URL: http://wiki.whamcloud.com/
74 BuildRoot: %{_tmppath}/lustre-%{version}-root
75 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
76 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
77 Requires: %{name}-modules = %{version}
81 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
82 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
83 #suse don't support selinux
84 BuildRequires: libselinux-devel
89 Userspace tools and files for the Lustre file system.
92 Summary: Kernel Lustre modules for Linux %{kversion}
93 %if %{defined cross_requires}
94 Requires: %{cross_requires}
96 # for SLES11, we need nothing here
97 # for SLES10, we need (where %{flavor} is, i.e. smp):
99 Requires: kernel-%{flavor}
101 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
102 # for RHEL we need to require the specific kernel still since weak-modules
103 # support on RH is, well, weak, to be punny about it
104 Requires: kernel = %{krequires}
108 Group: Development/Kernel
111 Lustre file system, server and network drivers for Linux %{kversion}.
113 %if %{build_lustre_osd_ldiskfs}
115 Summary: osd-ldiskfs is the mandatory glue for LDISKFS support in Lustre.
116 Requires: lustre-modules = %{version}, lustre-ldiskfs >= 4.1.0
118 Group: Development/Kernel
120 %description osd-ldiskfs
121 The Lustre Object Storage Device (OSD) API is the interface to access and
122 modify data that is supposed to be stored persistently. This API is the interface
123 to code that bridges individual file systems. This specific package provides an
124 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
125 backing store of a Lustre server.
128 %if %{build_lustre_osd_zfs}
130 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
131 Requires: lustre-modules = %{version}, zfs-kmod
133 Group: Development/Kernel
136 The Lustre Object Storage Device (OSD) API is the interface to access and
137 modify data that is supposed to be stored persistently. This API is the interface
138 to code that bridges individual file systems. This specific package provides an
139 implementation of the OSD API for using the ZFS filesystem as the underlying
140 backing store of a Lustre server.
144 Summary: Object-Based Disk storage driver source
145 Group: Development/Kernel
148 Lustre sources for further development
150 # Since the RPMs we ship are to be used on both SLES and RHEL, we
151 # can't include any dependency information (since the package names
152 # are different on the two platforms).
154 # Instead, we can build these empty meta-packages that only include
155 # dependency information. These let people get the correct
156 # dependencies for their platform and lets them use tools like yum and
157 # red carpet to install the correct files.
159 # Unfortunately I have not seen this come up on the lists much, so I
160 # have disabled them (by commenting out their empty files section
161 # below) until it's clear that they resolve more confusion than they
165 Summary: Lustre dependencies meta-package for SLES
166 Group: Utilities/System
167 Provides: lustre-deps = %{version}
168 Requires: %{name} = %{version}, sles-release
169 Conflicts: %{name}-deps-rhel
171 %description deps-sles
172 This package has RPM dependencies appropriate for SLES systems.
175 Summary: Lustre dependencies meta-package for RHEL
176 Group: Utilities/System
177 Provides: lustre-deps = %{version}
178 Requires: %{name} = %{version}, redhat-release
179 Conflicts: %{name}-deps-sles
181 %description deps-rhel
182 This package has RPM dependencies appropriate for RHEL, RHL, and FC
186 Summary: Lustre testing framework
187 Group: Development/Kernel
188 Provides: %{name}-tests = %{version}
189 Requires: %{name} = %{version}, %{name}-modules = %{version}
192 This package contains a set of test binaries and scripts that are intended
193 to be used by the Lustre testing framework.
195 %if 0%{?suse_version}
199 %setup -qn lustre-%{version}
200 ln lustre/ChangeLog ChangeLog-lustre
201 ln lnet/ChangeLog ChangeLog-lnet
204 # if RPM_BUILD_NCPUS unset, set it
205 if [ -z "$RPM_BUILD_NCPUS" ] ; then
206 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
207 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
210 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
215 rm -rf $RPM_BUILD_ROOT
217 # Set an explicit path to our Linux tree, if we can.
218 cd $RPM_BUILD_DIR/lustre-%{version}
219 # override %optflags so that the vendor's overzealous flags don't create
221 %define optflags -g -O2 -Werror
222 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
223 %if %{build_lustre_tests}
224 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
226 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
229 # if %%kdir was given, make sure it's not in the configure arguments
230 if [ -n "%kdir" ]; then
231 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
233 # ditto for %%kobjdir
234 if [ -n "%kobjdir" ]; then
235 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
238 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
239 # string in it which we don't want word splitted by the shell
240 # also remove (build|host|target) options because they will be specified
241 # inside $CONFIGURE_ARGS
242 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
245 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
247 make -j $RPM_BUILD_NCPUS -s %{?make_args}
250 make install DESTDIR=$RPM_BUILD_ROOT
251 # hack to avoid changing the libsysio code for "make install"
252 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
253 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
254 rm -rf $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs
256 # hack to include the llog_test module in lustre-tests
257 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
258 if [ -e ${llog_base}.ko ]; then
259 cp ${llog_base}.ko $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
260 elif [ -e ${llog_base}.o ]; then
261 cp ${llog_base}.o $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
264 # The .ha_v2 extension identifies the heartbeat resource agent as using
265 # legacy syntax. Install a compatibility symlink to avoid conflicts when
266 # newer-style agents are added.
267 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
269 # Create the pristine source directory.
270 cd $RPM_BUILD_DIR/lustre-%{version}
271 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
273 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
274 make distdir distdir=lustre-source/lustre-%{version}
275 chmod -R go-w lustre-source/lustre-%{version}
276 # fc18 needs 'x' permission for library files
277 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
279 cat >lustre.files <<EOF
280 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
281 %attr(-, root, root) %{_sbindir}/*
282 %attr(-, root, root) %{_bindir}/*
283 %attr(-, root, root) %{_libdir}/libptlctl.a
284 %attr(-, root, root) %{_libdir}/liblustreapi.a
285 %attr(-, root, root) %{_libdir}/liblustreapi.so
286 %attr(-, root, root) %{_mandir}/man?/*
287 %attr(-, root, root) %{_datadir}/lustre
288 %attr(-, root, root) %{_includedir}/lustre
289 %attr(-, root, root) %{_includedir}/libcfs
290 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
291 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
292 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
293 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
294 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
295 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
296 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
297 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
298 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
301 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
302 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
305 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
306 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
307 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
310 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
311 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
314 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
315 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
316 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
319 # Have universal lustre headers
320 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
321 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
323 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
326 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
327 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
330 %if %{build_lustre_tests}
331 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
332 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
333 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
334 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
338 %if %{defined cross_path}
339 %if %{defined rpm_post_base}
340 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
341 if [ -f $POST_SCRIPT ]; then
342 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
343 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
344 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
345 %if %{build_lustre_osd_ldiskfs}
346 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
348 %if %{build_lustre_osd_zfs}
349 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
351 %if %{build_lustre_tests}
352 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
353 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
358 # mark modules executable for find-debuginfo.sh
359 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
360 xargs --no-run-if-empty chmod u+x
363 %files -f lustre.files
366 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
367 %if %{build_lustre_tests}
368 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
370 %if %{build_lustre_osd_ldiskfs}
371 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
372 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
374 %if %{build_lustre_osd_zfs}
375 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
377 %if %{defined rpm_post_base}
378 %attr(0555, root, root) %{rpm_post_base}-modules.sh
380 %attr(-, root, root) %doc COPYING
381 %attr(-, root, root) %doc ChangeLog-lustre
382 %attr(-, root, root) %doc ChangeLog-lnet
384 %if %{build_lustre_osd_ldiskfs}
386 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
387 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
388 %if %{defined rpm_post_base}
389 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
393 %if %{build_lustre_osd_zfs}
395 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
396 %if %{defined rpm_post_base}
397 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
402 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
404 # uncomment these lines to enable deps packages
408 %if %{build_lustre_tests}
409 %files tests -f lustre-tests.files
412 %if %{defined rpm_post_base}
414 if [ -x %{rpm_post_base}.sh ]; then
415 %{rpm_post_base}.sh %{cross_path} create
419 if [ -x %{rpm_post_base}.sh ]; then
420 %{rpm_post_base}.sh %{cross_path} remove
425 %if %{defined rpm_post_base}
426 if [ -x %{rpm_post_base}-modules.sh ]; then
427 %{rpm_post_base}-modules.sh %{cross_path} create
430 if [ -f /boot/System.map-%{kversion} ]; then
431 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
433 depmod -ae %{kversion} || exit 0
436 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
437 # "weak modules" support
439 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
440 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
441 /usr/lib/module-init-tools/weak-modules --add-modules
444 if [ -x /sbin/weak-modules ]; then
445 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
446 /sbin/weak-modules --add-modules
449 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
450 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
451 # print a warning so that users are aware of this issue.
452 if sysctl kernel.unsupported >/dev/null 2>&1 &&
453 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
454 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
456 warning: the Lustre modules are not supported by Novell. To use Lustre
457 on this system, you should put
459 allow_unsupported_modules 1
461 into /etc/modprobe.d/unsupported_modules"
465 %if %{build_lustre_osd_ldiskfs}
467 %if %{defined rpm_post_base}
468 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
469 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
472 if [ -f /boot/System.map-%{kversion} ]; then
473 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
475 depmod -ae %{kversion} || exit 0
478 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
479 # "weak modules" support
481 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
482 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
483 /usr/lib/module-init-tools/weak-modules --add-modules
486 if [ -x /sbin/weak-modules ]; then
487 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
488 /sbin/weak-modules --add-modules
491 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
492 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
493 # print a warning so that users are aware of this issue.
494 if sysctl kernel.unsupported >/dev/null 2>&1 &&
495 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
496 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
498 warning: the Lustre modules are not supported by Novell. To use Lustre
499 on this system, you should put
501 allow_unsupported_modules 1
503 into /etc/modprobe.d/unsupported_modules"
508 %if %{build_lustre_osd_zfs}
510 %if %{defined rpm_post_base}
511 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
512 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
515 if [ -f /boot/System.map-%{kversion} ]; then
516 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
518 depmod -ae %{kversion} || exit 0
521 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
522 # "weak modules" support
524 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
525 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
526 /usr/lib/module-init-tools/weak-modules --add-modules
529 if [ -x /sbin/weak-modules ]; then
530 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
531 /sbin/weak-modules --add-modules
534 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
535 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
536 # print a warning so that users are aware of this issue.
537 if sysctl kernel.unsupported >/dev/null 2>&1 &&
538 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
539 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
541 warning: the Lustre modules are not supported by Novell. To use Lustre
542 on this system, you should put
544 allow_unsupported_modules 1
546 into /etc/modprobe.d/unsupported_modules"
552 %if %{defined rpm_post_base}
553 if [ -x %{rpm_post_base}-modules.sh ]; then
554 %{rpm_post_base}-modules.sh %{cross_path} remove
557 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
558 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
561 %if %{build_lustre_osd_ldiskfs}
563 %if %{defined rpm_post_base}
564 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
565 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
568 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
569 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
573 %if %{build_lustre_osd_zfs}
575 %if %{defined rpm_post_base}
576 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
577 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
580 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
581 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
585 %if %{undefined cross_path}
587 if [ -f /boot/System.map-%{kversion} ]; then
588 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
590 depmod -ae %{kversion} || exit 0
593 # "weak modules" support
595 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
596 cat /var/run/%{name}-modules |
597 /usr/lib/module-init-tools/weak-modules --remove-modules
600 if [ -x /sbin/weak-modules ]; then
601 cat /var/run/%{name}-modules |
602 /sbin/weak-modules --remove-modules
604 rm /var/run/%{name}-modules
606 %if %{build_lustre_osd_ldiskfs}
608 if [ -f /boot/System.map-%{kversion} ]; then
609 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
611 depmod -ae %{kversion} || exit 0
614 # "weak modules" support
616 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
617 cat /var/run/%{name}-osd-ldiskfs |
618 /usr/lib/module-init-tools/weak-modules --remove-modules
621 if [ -x /sbin/weak-modules ]; then
622 cat /var/run/%{name}-osd-ldiskfs |
623 /sbin/weak-modules --remove-modules
625 rm /var/run/%{name}-osd-ldiskfs
628 %if %{build_lustre_osd_zfs}
630 if [ -f /boot/System.map-%{kversion} ]; then
631 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
633 depmod -ae %{kversion} || exit 0
636 # "weak modules" support
638 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
639 cat /var/run/%{name}-osd-zfs |
640 /usr/lib/module-init-tools/weak-modules --remove-modules
643 if [ -x /sbin/weak-modules ]; then
644 cat /var/run/%{name}-osd-zfs |
645 /sbin/weak-modules --remove-modules
647 rm /var/run/%{name}-osd-zfs
651 %if %{build_lustre_tests}
653 %if %{defined rpm_post_base}
654 if [ -x %{rpm_post_base}-tests.sh ]; then
655 %{rpm_post_base}-tests.sh %{cross_path} create
659 if [ -x %{rpm_post_base}-tests.sh ]; then
660 %{rpm_post_base}-tests.sh %{cross_path} remove
663 if [ -f /boot/System.map-%{kversion} ]; then
664 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
666 depmod -ae %{kversion} || exit 0
670 if [ -f /boot/System.map-%{kversion} ]; then
671 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
673 depmod -ae %{kversion} || exit 0
679 rm -rf $RPM_BUILD_ROOT