3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
10 # --without servers overrides --with {ldiskfs|zfs}
11 # so undefine the internal variables set by bcond_*
12 %undefine with_ldiskfs
16 %{!?version: %global version @VERSION@}
17 %{!?kver: %global kver ""}
18 %{!?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)}
20 %{!?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)}
22 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
23 %{!?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)}
25 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
27 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
29 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
31 # always append the buildid, even when the caller defines %release
32 %define fullrelease %{myrelease}%{buildid}
34 # in order to get kernel symset and/or kernel module dependencies into
35 # the RPM, in order to support weak-modules, the internal dependency gen-
36 # erator needs to be disabled
37 # this is done with (reduce the double % down to a single %):
39 # %%global _use_internal_dependency_generator 0
41 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
42 # defining it here (until Suse changes their mind)
44 # on RHEL5, however, we do need to explicitly disable the internal dep-
45 # endency generator and allow the external one be used
46 # but since RedHat's kABI is only a subset of the total kernel ABI, it
47 # doesn't include all of the symbols we (or OFED for that matter) need
48 # until RedHat includes all of the symbols we need in their symsets we
49 # cannot support weak-modules
50 # we did e-mail the maintainer of all of this stuff @redhat but got no
52 #%%global _use_internal_dependency_generator 0
54 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
56 %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$//'")
58 %define sles10 %(bash -c "if [ "%sles_version" = "10" ]; then echo -n '1'; else echo -n '0'; fi")
61 %define flavor %(bash -c "echo %{kversion} | sed -e 's/^.*-//'")
64 # Set the package name prefix
65 %if %{undefined lustre_name}
67 %global lustre_name lustre
69 %global lustre_name lustre-client
73 %if %{defined cross_path} && %{defined post_script}
74 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
77 Summary: Lustre File System
80 Release: %{fullrelease}
82 Group: Utilities/System
83 Source: lustre-%{version}.tar.gz
84 URL: http://wiki.whamcloud.com/
85 BuildRoot: %{_tmppath}/lustre-%{version}-root
86 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
87 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
88 Requires: %{name}-modules = %{version}
92 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
93 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
94 #suse don't support selinux
95 BuildRequires: libselinux-devel
100 Userspace tools and files for the Lustre file system.
103 Summary: Kernel Lustre modules for Linux %{kversion}
104 %if %{defined cross_requires}
105 Requires: %{cross_requires}
107 # for SLES11, we need nothing here
108 # for SLES10, we need (where %{flavor} is, i.e. smp):
110 Requires: kernel-%{flavor}
112 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
113 # for RHEL we need to require the specific kernel still since weak-modules
114 # support on RH is, well, weak, to be punny about it
115 Requires: kernel = %{krequires}
119 Group: Development/Kernel
122 Lustre file system, server and network drivers for Linux %{kversion}.
126 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
127 Requires: lustre-modules = %{version}
128 Requires: modutils >= 2.4.10
129 Requires: ldiskfsprogs >= 1.42.7.wc1
131 Obsoletes: lustre-ldiskfs
132 Group: Development/Kernel
134 %description osd-ldiskfs
135 The Lustre Object Storage Device (OSD) API is the interface to access and
136 modify data that is supposed to be stored persistently. This API is the interface
137 to code that bridges individual file systems. This specific package provides an
138 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
139 backing store of a Lustre server.
144 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
145 Requires: lustre-modules = %{version}, zfs-kmod
147 Group: Development/Kernel
150 The Lustre Object Storage Device (OSD) API is the interface to access and
151 modify data that is supposed to be stored persistently. This API is the interface
152 to code that bridges individual file systems. This specific package provides an
153 implementation of the OSD API for using the ZFS filesystem as the underlying
154 backing store of a Lustre server.
158 Summary: Object-Based Disk storage driver source
159 Group: Development/Kernel
162 Lustre sources for further development
164 # Since the RPMs we ship are to be used on both SLES and RHEL, we
165 # can't include any dependency information (since the package names
166 # are different on the two platforms).
168 # Instead, we can build these empty meta-packages that only include
169 # dependency information. These let people get the correct
170 # dependencies for their platform and lets them use tools like yum and
171 # red carpet to install the correct files.
173 # Unfortunately I have not seen this come up on the lists much, so I
174 # have disabled them (by commenting out their empty files section
175 # below) until it's clear that they resolve more confusion than they
179 Summary: Lustre dependencies meta-package for SLES
180 Group: Utilities/System
181 Provides: lustre-deps = %{version}
182 Requires: %{name} = %{version}, sles-release
183 Conflicts: %{name}-deps-rhel
185 %description deps-sles
186 This package has RPM dependencies appropriate for SLES systems.
189 Summary: Lustre dependencies meta-package for RHEL
190 Group: Utilities/System
191 Provides: lustre-deps = %{version}
192 Requires: %{name} = %{version}, redhat-release
193 Conflicts: %{name}-deps-sles
195 %description deps-rhel
196 This package has RPM dependencies appropriate for RHEL, RHL, and FC
200 Summary: Lustre testing framework
201 Group: Development/Kernel
202 Provides: %{name}-tests = %{version}
203 Requires: %{name} = %{version}, %{name}-modules = %{version}
206 This package contains a set of test binaries and scripts that are intended
207 to be used by the Lustre testing framework.
209 %if 0%{?suse_version}
213 %setup -qn lustre-%{version}
214 ln lustre/ChangeLog ChangeLog-lustre
215 ln lnet/ChangeLog ChangeLog-lnet
218 # if RPM_BUILD_NCPUS unset, set it
219 if [ -z "$RPM_BUILD_NCPUS" ] ; then
220 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
221 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
224 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
229 rm -rf $RPM_BUILD_ROOT
231 # Set an explicit path to our Linux tree, if we can.
232 cd $RPM_BUILD_DIR/lustre-%{version}
233 # override %optflags so that the vendor's overzealous flags don't create
235 %define optflags -g -O2 -Werror
236 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
237 %if %{with lustre_tests}
238 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
240 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
243 # if %%kdir was given, make sure it's not in the configure arguments
244 if [ -n "%kdir" ]; then
245 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
247 # ditto for %%kobjdir
248 if [ -n "%kobjdir" ]; then
249 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
252 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
253 # string in it which we don't want word splitted by the shell
254 # also remove (build|host|target) options because they will be specified
255 # inside $CONFIGURE_ARGS
256 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
259 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
261 make -j $RPM_BUILD_NCPUS -s %{?make_args}
264 make install DESTDIR=$RPM_BUILD_ROOT
265 # hack to avoid changing the libsysio code for "make install"
266 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
268 # hack to include the llog_test module in lustre-tests
269 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
270 if [ -e ${llog_base}.ko ]; then
271 cp ${llog_base}.ko $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
272 elif [ -e ${llog_base}.o ]; then
273 cp ${llog_base}.o $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
276 # The .ha_v2 extension identifies the heartbeat resource agent as using
277 # legacy syntax. Install a compatibility symlink to avoid conflicts when
278 # newer-style agents are added.
279 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
281 # Create the pristine source directory.
282 cd $RPM_BUILD_DIR/lustre-%{version}
283 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
285 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
286 make distdir distdir=lustre-source/lustre-%{version}
287 chmod -R go-w lustre-source/lustre-%{version}
288 # fc18 needs 'x' permission for library files
289 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
291 cat >lustre.files <<EOF
292 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
293 %attr(-, root, root) %{_sbindir}/*
294 %attr(-, root, root) %{_bindir}/*
295 %attr(-, root, root) %{_libdir}/libptlctl.a
296 %attr(-, root, root) %{_libdir}/liblustreapi.a
297 %attr(-, root, root) %{_libdir}/liblustreapi.so
298 %attr(-, root, root) %{_mandir}/man?/*
299 %attr(-, root, root) %{_datadir}/lustre
300 %attr(-, root, root) %{_includedir}/lustre
301 %attr(-, root, root) %{_includedir}/libcfs
302 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
303 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
304 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
305 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
306 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
307 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
308 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
309 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
310 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
313 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
314 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
317 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
318 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
319 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
322 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
323 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
326 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
327 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
328 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
331 # Have universal lustre headers
332 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
333 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
335 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
338 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
339 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
342 %if %{with lustre_tests}
343 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
344 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
345 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
346 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
350 %if %{defined cross_path}
351 %if %{defined rpm_post_base}
352 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
353 if [ -f $POST_SCRIPT ]; then
354 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
355 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
356 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
358 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
361 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
363 %if %{with lustre_tests}
364 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
365 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
370 # mark modules executable for find-debuginfo.sh
371 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
372 xargs --no-run-if-empty chmod u+x
375 %files -f lustre.files
378 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
379 %if %{with lustre_tests}
380 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
383 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
384 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
385 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
388 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
390 %if %{defined rpm_post_base}
391 %attr(0555, root, root) %{rpm_post_base}-modules.sh
393 %attr(-, root, root) %doc COPYING
394 %attr(-, root, root) %doc ChangeLog-lustre
395 %attr(-, root, root) %doc ChangeLog-lnet
399 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
400 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
401 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
402 %if %{defined rpm_post_base}
403 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
409 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
410 %if %{defined rpm_post_base}
411 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
416 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
418 # uncomment these lines to enable deps packages
422 %if %{with lustre_tests}
423 %files tests -f lustre-tests.files
426 %if %{defined rpm_post_base}
428 if [ -x %{rpm_post_base}.sh ]; then
429 %{rpm_post_base}.sh %{cross_path} create
433 if [ -x %{rpm_post_base}.sh ]; then
434 %{rpm_post_base}.sh %{cross_path} remove
439 %if %{defined rpm_post_base}
440 if [ -x %{rpm_post_base}-modules.sh ]; then
441 %{rpm_post_base}-modules.sh %{cross_path} create
444 if [ -f /boot/System.map-%{kversion} ]; then
445 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
447 depmod -ae %{kversion} || exit 0
450 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
451 # "weak modules" support
453 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
454 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
455 /usr/lib/module-init-tools/weak-modules --add-modules
458 if [ -x /sbin/weak-modules ]; then
459 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
460 /sbin/weak-modules --add-modules
463 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
464 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
465 # print a warning so that users are aware of this issue.
466 if sysctl kernel.unsupported >/dev/null 2>&1 &&
467 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
468 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
470 warning: the Lustre modules are not supported by Novell. To use Lustre
471 on this system, you should put
473 allow_unsupported_modules 1
475 into /etc/modprobe.d/unsupported_modules"
481 %if %{defined rpm_post_base}
482 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
483 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
486 if [ -f /boot/System.map-%{kversion} ]; then
487 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
489 depmod -ae %{kversion} || exit 0
492 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
493 # "weak modules" support
495 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
496 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
497 /usr/lib/module-init-tools/weak-modules --add-modules
500 if [ -x /sbin/weak-modules ]; then
501 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
502 /sbin/weak-modules --add-modules
505 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
506 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
507 # print a warning so that users are aware of this issue.
508 if sysctl kernel.unsupported >/dev/null 2>&1 &&
509 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
510 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
512 warning: the Lustre modules are not supported by Novell. To use Lustre
513 on this system, you should put
515 allow_unsupported_modules 1
517 into /etc/modprobe.d/unsupported_modules"
524 %if %{defined rpm_post_base}
525 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
526 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
529 if [ -f /boot/System.map-%{kversion} ]; then
530 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
532 depmod -ae %{kversion} || exit 0
535 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
536 # "weak modules" support
538 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
539 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
540 /usr/lib/module-init-tools/weak-modules --add-modules
543 if [ -x /sbin/weak-modules ]; then
544 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
545 /sbin/weak-modules --add-modules
548 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
549 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
550 # print a warning so that users are aware of this issue.
551 if sysctl kernel.unsupported >/dev/null 2>&1 &&
552 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
553 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
555 warning: the Lustre modules are not supported by Novell. To use Lustre
556 on this system, you should put
558 allow_unsupported_modules 1
560 into /etc/modprobe.d/unsupported_modules"
566 %if %{defined rpm_post_base}
567 if [ -x %{rpm_post_base}-modules.sh ]; then
568 %{rpm_post_base}-modules.sh %{cross_path} remove
571 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
572 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
577 %if %{defined rpm_post_base}
578 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
579 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
582 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
583 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
589 %if %{defined rpm_post_base}
590 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
591 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
594 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
595 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
599 %if %{undefined cross_path}
601 if [ -f /boot/System.map-%{kversion} ]; then
602 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
604 depmod -ae %{kversion} || exit 0
607 # "weak modules" support
609 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
610 cat /var/run/%{name}-modules |
611 /usr/lib/module-init-tools/weak-modules --remove-modules
614 if [ -x /sbin/weak-modules ]; then
615 cat /var/run/%{name}-modules |
616 /sbin/weak-modules --remove-modules
618 rm /var/run/%{name}-modules
622 if [ -f /boot/System.map-%{kversion} ]; then
623 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
625 depmod -ae %{kversion} || exit 0
628 # "weak modules" support
630 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
631 cat /var/run/%{name}-osd-ldiskfs |
632 /usr/lib/module-init-tools/weak-modules --remove-modules
635 if [ -x /sbin/weak-modules ]; then
636 cat /var/run/%{name}-osd-ldiskfs |
637 /sbin/weak-modules --remove-modules
639 rm /var/run/%{name}-osd-ldiskfs
644 if [ -f /boot/System.map-%{kversion} ]; then
645 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
647 depmod -ae %{kversion} || exit 0
650 # "weak modules" support
652 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
653 cat /var/run/%{name}-osd-zfs |
654 /usr/lib/module-init-tools/weak-modules --remove-modules
657 if [ -x /sbin/weak-modules ]; then
658 cat /var/run/%{name}-osd-zfs |
659 /sbin/weak-modules --remove-modules
661 rm /var/run/%{name}-osd-zfs
665 %if %{with lustre_tests}
667 %if %{defined rpm_post_base}
668 if [ -x %{rpm_post_base}-tests.sh ]; then
669 %{rpm_post_base}-tests.sh %{cross_path} create
673 if [ -x %{rpm_post_base}-tests.sh ]; then
674 %{rpm_post_base}-tests.sh %{cross_path} remove
677 if [ -f /boot/System.map-%{kversion} ]; then
678 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
680 depmod -ae %{kversion} || exit 0
684 if [ -f /boot/System.map-%{kversion} ]; then
685 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
687 depmod -ae %{kversion} || exit 0
693 rm -rf $RPM_BUILD_ROOT