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 %if %{defined cross_requires}
93 Requires: %{cross_requires}
96 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
97 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
98 #suse don't support selinux
99 BuildRequires: libselinux-devel
105 Userspace tools and files for the Lustre file system.
108 Summary: Kernel Lustre modules for Linux %{kversion}
109 %if %{defined cross_requires}
110 Requires: %{cross_requires}
113 # for SLES11, we need nothing here
114 # for SLES10, we need (where %{flavor} is, i.e. smp):
116 Requires: kernel-%{flavor}
118 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
119 # for RHEL we need to require the specific kernel still since weak-modules
120 # support on RH is, well, weak, to be punny about it
121 Requires: kernel = %{krequires}
125 Group: Development/Kernel
128 Lustre file system, server and network drivers for Linux %{kversion}.
132 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
133 Requires: lustre-modules = %{version}
134 Requires: modutils >= 2.4.10
135 Requires: ldiskfsprogs >= 1.42.7.wc1
137 Obsoletes: lustre-ldiskfs
138 Group: Development/Kernel
140 %description osd-ldiskfs
141 The Lustre Object Storage Device (OSD) API is the interface to access and
142 modify data that is supposed to be stored persistently. This API is the interface
143 to code that bridges individual file systems. This specific package provides an
144 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
145 backing store of a Lustre server.
150 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
151 Requires: lustre-modules = %{version}, zfs-kmod
153 Group: Development/Kernel
156 The Lustre Object Storage Device (OSD) API is the interface to access and
157 modify data that is supposed to be stored persistently. This API is the interface
158 to code that bridges individual file systems. This specific package provides an
159 implementation of the OSD API for using the ZFS filesystem as the underlying
160 backing store of a Lustre server.
164 Summary: Object-Based Disk storage driver source
165 Group: Development/Kernel
168 Lustre sources for further development
170 # Since the RPMs we ship are to be used on both SLES and RHEL, we
171 # can't include any dependency information (since the package names
172 # are different on the two platforms).
174 # Instead, we can build these empty meta-packages that only include
175 # dependency information. These let people get the correct
176 # dependencies for their platform and lets them use tools like yum and
177 # red carpet to install the correct files.
179 # Unfortunately I have not seen this come up on the lists much, so I
180 # have disabled them (by commenting out their empty files section
181 # below) until it's clear that they resolve more confusion than they
185 Summary: Lustre dependencies meta-package for SLES
186 Group: Utilities/System
187 Provides: lustre-deps = %{version}
188 Requires: %{name} = %{version}, sles-release
189 Conflicts: %{name}-deps-rhel
191 %description deps-sles
192 This package has RPM dependencies appropriate for SLES systems.
195 Summary: Lustre dependencies meta-package for RHEL
196 Group: Utilities/System
197 Provides: lustre-deps = %{version}
198 Requires: %{name} = %{version}, redhat-release
199 Conflicts: %{name}-deps-sles
201 %description deps-rhel
202 This package has RPM dependencies appropriate for RHEL, RHL, and FC
206 Summary: Lustre testing framework
207 Group: Development/Kernel
208 Provides: %{name}-tests = %{version}
209 Requires: %{name} = %{version}, %{name}-modules = %{version}
212 This package contains a set of test binaries and scripts that are intended
213 to be used by the Lustre testing framework.
215 %if 0%{?suse_version}
219 %setup -qn lustre-%{version}
220 ln lustre/ChangeLog ChangeLog-lustre
221 ln lnet/ChangeLog ChangeLog-lnet
224 # if RPM_BUILD_NCPUS unset, set it
225 if [ -z "$RPM_BUILD_NCPUS" ] ; then
226 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
227 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
230 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
235 rm -rf $RPM_BUILD_ROOT
237 # Set an explicit path to our Linux tree, if we can.
238 cd $RPM_BUILD_DIR/lustre-%{version}
239 # override %optflags so that the vendor's overzealous flags don't create
241 %define optflags -g -O2 -Werror
242 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
243 %if %{with lustre_tests}
244 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
246 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
249 # if %%kdir was given, make sure it's not in the configure arguments
250 if [ -n "%kdir" ]; then
251 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
253 # ditto for %%kobjdir
254 if [ -n "%kobjdir" ]; then
255 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
258 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
259 # string in it which we don't want word splitted by the shell
260 # also remove (build|host|target) options because they will be specified
261 # inside $CONFIGURE_ARGS
262 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
265 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
267 make -j $RPM_BUILD_NCPUS -s %{?make_args}
270 make install DESTDIR=$RPM_BUILD_ROOT
271 # hack to avoid changing the libsysio code for "make install"
272 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
274 # hack to include the llog_test module in lustre-tests
275 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
276 if [ -e ${llog_base}.ko ]; then
277 cp ${llog_base}.ko $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
278 elif [ -e ${llog_base}.o ]; then
279 cp ${llog_base}.o $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
282 # The .ha_v2 extension identifies the heartbeat resource agent as using
283 # legacy syntax. Install a compatibility symlink to avoid conflicts when
284 # newer-style agents are added.
285 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
287 # Create the pristine source directory.
288 cd $RPM_BUILD_DIR/lustre-%{version}
289 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
291 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
292 make distdir distdir=lustre-source/lustre-%{version}
293 chmod -R go-w lustre-source/lustre-%{version}
294 # fc18 needs 'x' permission for library files
295 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
297 cat >lustre.files <<EOF
298 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
299 %attr(-, root, root) %{_sbindir}/*
300 %attr(-, root, root) %{_bindir}/*
301 %attr(-, root, root) %{_libdir}/libptlctl.a
302 %attr(-, root, root) %{_libdir}/liblustreapi.a
303 %attr(-, root, root) %{_libdir}/liblustreapi.so
304 %attr(-, root, root) %{_mandir}/man?/*
305 %attr(-, root, root) %{_datadir}/lustre
306 %attr(-, root, root) %{_includedir}/lustre
307 %attr(-, root, root) %{_includedir}/libcfs
308 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
309 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
310 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
311 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
312 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
313 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
314 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
315 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
316 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
319 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
320 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
323 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
324 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
325 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
328 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
329 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
332 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
333 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
334 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
337 # Have universal lustre headers
338 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
339 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
341 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
344 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
345 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
348 %if %{with lustre_tests}
349 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
350 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
351 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
352 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
356 %if %{defined cross_path}
357 %if %{defined rpm_post_base}
358 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
359 if [ -f $POST_SCRIPT ]; then
360 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
361 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
362 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
364 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
367 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
369 %if %{with lustre_tests}
370 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
371 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
376 # mark modules executable for find-debuginfo.sh
377 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
378 xargs --no-run-if-empty chmod u+x
381 %files -f lustre.files
384 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
385 %if %{with lustre_tests}
386 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
389 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
390 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
391 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
394 %exclude %{?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}-modules.sh
399 %attr(-, root, root) %doc COPYING
400 %attr(-, root, root) %doc ChangeLog-lustre
401 %attr(-, root, root) %doc ChangeLog-lnet
405 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
406 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
407 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
408 %if %{defined rpm_post_base}
409 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
415 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
416 %if %{defined rpm_post_base}
417 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
422 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
424 # uncomment these lines to enable deps packages
428 %if %{with lustre_tests}
429 %files tests -f lustre-tests.files
432 %if %{defined rpm_post_base}
434 if [ -x %{rpm_post_base}.sh ]; then
435 %{rpm_post_base}.sh %{cross_path} create
439 if [ -x %{rpm_post_base}.sh ]; then
440 %{rpm_post_base}.sh %{cross_path} remove
445 %if %{defined rpm_post_base}
446 if [ -x %{rpm_post_base}-modules.sh ]; then
447 %{rpm_post_base}-modules.sh %{cross_path} create
450 if [ -f /boot/System.map-%{kversion} ]; then
451 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
453 depmod -ae %{kversion} || exit 0
456 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
457 # "weak modules" support
459 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
460 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
461 /usr/lib/module-init-tools/weak-modules --add-modules
464 if [ -x /sbin/weak-modules ]; then
465 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
466 /sbin/weak-modules --add-modules
469 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
470 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
471 # print a warning so that users are aware of this issue.
472 if sysctl kernel.unsupported >/dev/null 2>&1 &&
473 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
474 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
476 warning: the Lustre modules are not supported by Novell. To use Lustre
477 on this system, you should put
479 allow_unsupported_modules 1
481 into /etc/modprobe.d/unsupported_modules"
487 %if %{defined rpm_post_base}
488 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
489 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
492 if [ -f /boot/System.map-%{kversion} ]; then
493 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
495 depmod -ae %{kversion} || exit 0
498 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
499 # "weak modules" support
501 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
502 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
503 /usr/lib/module-init-tools/weak-modules --add-modules
506 if [ -x /sbin/weak-modules ]; then
507 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
508 /sbin/weak-modules --add-modules
511 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
512 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
513 # print a warning so that users are aware of this issue.
514 if sysctl kernel.unsupported >/dev/null 2>&1 &&
515 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
516 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
518 warning: the Lustre modules are not supported by Novell. To use Lustre
519 on this system, you should put
521 allow_unsupported_modules 1
523 into /etc/modprobe.d/unsupported_modules"
530 %if %{defined rpm_post_base}
531 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
532 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
535 if [ -f /boot/System.map-%{kversion} ]; then
536 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
538 depmod -ae %{kversion} || exit 0
541 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
542 # "weak modules" support
544 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
545 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
546 /usr/lib/module-init-tools/weak-modules --add-modules
549 if [ -x /sbin/weak-modules ]; then
550 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
551 /sbin/weak-modules --add-modules
554 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
555 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
556 # print a warning so that users are aware of this issue.
557 if sysctl kernel.unsupported >/dev/null 2>&1 &&
558 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
559 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
561 warning: the Lustre modules are not supported by Novell. To use Lustre
562 on this system, you should put
564 allow_unsupported_modules 1
566 into /etc/modprobe.d/unsupported_modules"
572 %if %{defined rpm_post_base}
573 if [ -x %{rpm_post_base}-modules.sh ]; then
574 %{rpm_post_base}-modules.sh %{cross_path} remove
577 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
578 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
583 %if %{defined rpm_post_base}
584 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
585 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
588 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
589 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
595 %if %{defined rpm_post_base}
596 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
597 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
600 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
601 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
605 %if %{undefined cross_path}
607 if [ -f /boot/System.map-%{kversion} ]; then
608 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
610 depmod -ae %{kversion} || exit 0
613 # "weak modules" support
615 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
616 cat /var/run/%{name}-modules |
617 /usr/lib/module-init-tools/weak-modules --remove-modules
620 if [ -x /sbin/weak-modules ]; then
621 cat /var/run/%{name}-modules |
622 /sbin/weak-modules --remove-modules
624 rm /var/run/%{name}-modules
628 if [ -f /boot/System.map-%{kversion} ]; then
629 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
631 depmod -ae %{kversion} || exit 0
634 # "weak modules" support
636 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
637 cat /var/run/%{name}-osd-ldiskfs |
638 /usr/lib/module-init-tools/weak-modules --remove-modules
641 if [ -x /sbin/weak-modules ]; then
642 cat /var/run/%{name}-osd-ldiskfs |
643 /sbin/weak-modules --remove-modules
645 rm /var/run/%{name}-osd-ldiskfs
650 if [ -f /boot/System.map-%{kversion} ]; then
651 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
653 depmod -ae %{kversion} || exit 0
656 # "weak modules" support
658 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
659 cat /var/run/%{name}-osd-zfs |
660 /usr/lib/module-init-tools/weak-modules --remove-modules
663 if [ -x /sbin/weak-modules ]; then
664 cat /var/run/%{name}-osd-zfs |
665 /sbin/weak-modules --remove-modules
667 rm /var/run/%{name}-osd-zfs
671 %if %{with lustre_tests}
673 %if %{defined rpm_post_base}
674 if [ -x %{rpm_post_base}-tests.sh ]; then
675 %{rpm_post_base}-tests.sh %{cross_path} create
679 if [ -x %{rpm_post_base}-tests.sh ]; then
680 %{rpm_post_base}-tests.sh %{cross_path} remove
683 if [ -f /boot/System.map-%{kversion} ]; then
684 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
686 depmod -ae %{kversion} || exit 0
690 if [ -f /boot/System.map-%{kversion} ]; then
691 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
693 depmod -ae %{kversion} || exit 0
699 rm -rf $RPM_BUILD_ROOT