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 is the mandatory glue for LDISKFS support in Lustre.
127 Requires: lustre-modules = %{version}, lustre-ldiskfs >= 4.1.0
129 Group: Development/Kernel
131 %description osd-ldiskfs
132 The Lustre Object Storage Device (OSD) API is the interface to access and
133 modify data that is supposed to be stored persistently. This API is the interface
134 to code that bridges individual file systems. This specific package provides an
135 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
136 backing store of a Lustre server.
141 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
142 Requires: lustre-modules = %{version}, zfs-kmod
144 Group: Development/Kernel
147 The Lustre Object Storage Device (OSD) API is the interface to access and
148 modify data that is supposed to be stored persistently. This API is the interface
149 to code that bridges individual file systems. This specific package provides an
150 implementation of the OSD API for using the ZFS filesystem as the underlying
151 backing store of a Lustre server.
155 Summary: Object-Based Disk storage driver source
156 Group: Development/Kernel
159 Lustre sources for further development
161 # Since the RPMs we ship are to be used on both SLES and RHEL, we
162 # can't include any dependency information (since the package names
163 # are different on the two platforms).
165 # Instead, we can build these empty meta-packages that only include
166 # dependency information. These let people get the correct
167 # dependencies for their platform and lets them use tools like yum and
168 # red carpet to install the correct files.
170 # Unfortunately I have not seen this come up on the lists much, so I
171 # have disabled them (by commenting out their empty files section
172 # below) until it's clear that they resolve more confusion than they
176 Summary: Lustre dependencies meta-package for SLES
177 Group: Utilities/System
178 Provides: lustre-deps = %{version}
179 Requires: %{name} = %{version}, sles-release
180 Conflicts: %{name}-deps-rhel
182 %description deps-sles
183 This package has RPM dependencies appropriate for SLES systems.
186 Summary: Lustre dependencies meta-package for RHEL
187 Group: Utilities/System
188 Provides: lustre-deps = %{version}
189 Requires: %{name} = %{version}, redhat-release
190 Conflicts: %{name}-deps-sles
192 %description deps-rhel
193 This package has RPM dependencies appropriate for RHEL, RHL, and FC
197 Summary: Lustre testing framework
198 Group: Development/Kernel
199 Provides: %{name}-tests = %{version}
200 Requires: %{name} = %{version}, %{name}-modules = %{version}
203 This package contains a set of test binaries and scripts that are intended
204 to be used by the Lustre testing framework.
206 %if 0%{?suse_version}
210 %setup -qn lustre-%{version}
211 ln lustre/ChangeLog ChangeLog-lustre
212 ln lnet/ChangeLog ChangeLog-lnet
215 # if RPM_BUILD_NCPUS unset, set it
216 if [ -z "$RPM_BUILD_NCPUS" ] ; then
217 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
218 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
221 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
226 rm -rf $RPM_BUILD_ROOT
228 # Set an explicit path to our Linux tree, if we can.
229 cd $RPM_BUILD_DIR/lustre-%{version}
230 # override %optflags so that the vendor's overzealous flags don't create
232 %define optflags -g -O2 -Werror
233 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
234 %if %{with lustre_tests}
235 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
237 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
240 # if %%kdir was given, make sure it's not in the configure arguments
241 if [ -n "%kdir" ]; then
242 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
244 # ditto for %%kobjdir
245 if [ -n "%kobjdir" ]; then
246 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
249 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
250 # string in it which we don't want word splitted by the shell
251 # also remove (build|host|target) options because they will be specified
252 # inside $CONFIGURE_ARGS
253 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
256 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
258 make -j $RPM_BUILD_NCPUS -s %{?make_args}
261 make install DESTDIR=$RPM_BUILD_ROOT
262 # hack to avoid changing the libsysio code for "make install"
263 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
264 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
265 rm -rf $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs
267 # hack to include the llog_test module in lustre-tests
268 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
269 if [ -e ${llog_base}.ko ]; then
270 cp ${llog_base}.ko $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
271 elif [ -e ${llog_base}.o ]; then
272 cp ${llog_base}.o $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
275 # The .ha_v2 extension identifies the heartbeat resource agent as using
276 # legacy syntax. Install a compatibility symlink to avoid conflicts when
277 # newer-style agents are added.
278 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
280 # Create the pristine source directory.
281 cd $RPM_BUILD_DIR/lustre-%{version}
282 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
284 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
285 make distdir distdir=lustre-source/lustre-%{version}
286 chmod -R go-w lustre-source/lustre-%{version}
287 # fc18 needs 'x' permission for library files
288 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
290 cat >lustre.files <<EOF
291 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
292 %attr(-, root, root) %{_sbindir}/*
293 %attr(-, root, root) %{_bindir}/*
294 %attr(-, root, root) %{_libdir}/libptlctl.a
295 %attr(-, root, root) %{_libdir}/liblustreapi.a
296 %attr(-, root, root) %{_libdir}/liblustreapi.so
297 %attr(-, root, root) %{_mandir}/man?/*
298 %attr(-, root, root) %{_datadir}/lustre
299 %attr(-, root, root) %{_includedir}/lustre
300 %attr(-, root, root) %{_includedir}/libcfs
301 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
302 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
303 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
304 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
305 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
306 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
307 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
308 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
309 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
312 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
313 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
316 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
317 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
318 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
321 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
322 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
325 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
326 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
327 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
330 # Have universal lustre headers
331 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
332 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
334 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
337 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
338 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
341 %if %{with lustre_tests}
342 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
343 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
344 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
345 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
349 %if %{defined cross_path}
350 %if %{defined rpm_post_base}
351 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
352 if [ -f $POST_SCRIPT ]; then
353 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
354 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
355 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
357 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
360 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
362 %if %{with lustre_tests}
363 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
364 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
369 # mark modules executable for find-debuginfo.sh
370 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
371 xargs --no-run-if-empty chmod u+x
374 %files -f lustre.files
377 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
378 %if %{with lustre_tests}
379 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
382 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
383 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
386 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
388 %if %{defined rpm_post_base}
389 %attr(0555, root, root) %{rpm_post_base}-modules.sh
391 %attr(-, root, root) %doc COPYING
392 %attr(-, root, root) %doc ChangeLog-lustre
393 %attr(-, root, root) %doc ChangeLog-lnet
397 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
398 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
399 %if %{defined rpm_post_base}
400 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
406 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
407 %if %{defined rpm_post_base}
408 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
413 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
415 # uncomment these lines to enable deps packages
419 %if %{with lustre_tests}
420 %files tests -f lustre-tests.files
423 %if %{defined rpm_post_base}
425 if [ -x %{rpm_post_base}.sh ]; then
426 %{rpm_post_base}.sh %{cross_path} create
430 if [ -x %{rpm_post_base}.sh ]; then
431 %{rpm_post_base}.sh %{cross_path} remove
436 %if %{defined rpm_post_base}
437 if [ -x %{rpm_post_base}-modules.sh ]; then
438 %{rpm_post_base}-modules.sh %{cross_path} create
441 if [ -f /boot/System.map-%{kversion} ]; then
442 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
444 depmod -ae %{kversion} || exit 0
447 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
448 # "weak modules" support
450 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
451 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
452 /usr/lib/module-init-tools/weak-modules --add-modules
455 if [ -x /sbin/weak-modules ]; then
456 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
457 /sbin/weak-modules --add-modules
460 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
461 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
462 # print a warning so that users are aware of this issue.
463 if sysctl kernel.unsupported >/dev/null 2>&1 &&
464 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
465 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
467 warning: the Lustre modules are not supported by Novell. To use Lustre
468 on this system, you should put
470 allow_unsupported_modules 1
472 into /etc/modprobe.d/unsupported_modules"
478 %if %{defined rpm_post_base}
479 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
480 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
483 if [ -f /boot/System.map-%{kversion} ]; then
484 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
486 depmod -ae %{kversion} || exit 0
489 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
490 # "weak modules" support
492 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
493 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
494 /usr/lib/module-init-tools/weak-modules --add-modules
497 if [ -x /sbin/weak-modules ]; then
498 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
499 /sbin/weak-modules --add-modules
502 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
503 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
504 # print a warning so that users are aware of this issue.
505 if sysctl kernel.unsupported >/dev/null 2>&1 &&
506 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
507 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
509 warning: the Lustre modules are not supported by Novell. To use Lustre
510 on this system, you should put
512 allow_unsupported_modules 1
514 into /etc/modprobe.d/unsupported_modules"
521 %if %{defined rpm_post_base}
522 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
523 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
526 if [ -f /boot/System.map-%{kversion} ]; then
527 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
529 depmod -ae %{kversion} || exit 0
532 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
533 # "weak modules" support
535 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
536 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
537 /usr/lib/module-init-tools/weak-modules --add-modules
540 if [ -x /sbin/weak-modules ]; then
541 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
542 /sbin/weak-modules --add-modules
545 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
546 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
547 # print a warning so that users are aware of this issue.
548 if sysctl kernel.unsupported >/dev/null 2>&1 &&
549 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
550 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
552 warning: the Lustre modules are not supported by Novell. To use Lustre
553 on this system, you should put
555 allow_unsupported_modules 1
557 into /etc/modprobe.d/unsupported_modules"
563 %if %{defined rpm_post_base}
564 if [ -x %{rpm_post_base}-modules.sh ]; then
565 %{rpm_post_base}-modules.sh %{cross_path} remove
568 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
569 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
574 %if %{defined rpm_post_base}
575 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
576 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
579 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
580 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
586 %if %{defined rpm_post_base}
587 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
588 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
591 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
592 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
596 %if %{undefined cross_path}
598 if [ -f /boot/System.map-%{kversion} ]; then
599 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
601 depmod -ae %{kversion} || exit 0
604 # "weak modules" support
606 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
607 cat /var/run/%{name}-modules |
608 /usr/lib/module-init-tools/weak-modules --remove-modules
611 if [ -x /sbin/weak-modules ]; then
612 cat /var/run/%{name}-modules |
613 /sbin/weak-modules --remove-modules
615 rm /var/run/%{name}-modules
619 if [ -f /boot/System.map-%{kversion} ]; then
620 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
622 depmod -ae %{kversion} || exit 0
625 # "weak modules" support
627 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
628 cat /var/run/%{name}-osd-ldiskfs |
629 /usr/lib/module-init-tools/weak-modules --remove-modules
632 if [ -x /sbin/weak-modules ]; then
633 cat /var/run/%{name}-osd-ldiskfs |
634 /sbin/weak-modules --remove-modules
636 rm /var/run/%{name}-osd-ldiskfs
641 if [ -f /boot/System.map-%{kversion} ]; then
642 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
644 depmod -ae %{kversion} || exit 0
647 # "weak modules" support
649 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
650 cat /var/run/%{name}-osd-zfs |
651 /usr/lib/module-init-tools/weak-modules --remove-modules
654 if [ -x /sbin/weak-modules ]; then
655 cat /var/run/%{name}-osd-zfs |
656 /sbin/weak-modules --remove-modules
658 rm /var/run/%{name}-osd-zfs
662 %if %{with lustre_tests}
664 %if %{defined rpm_post_base}
665 if [ -x %{rpm_post_base}-tests.sh ]; then
666 %{rpm_post_base}-tests.sh %{cross_path} create
670 if [ -x %{rpm_post_base}-tests.sh ]; then
671 %{rpm_post_base}-tests.sh %{cross_path} remove
674 if [ -f /boot/System.map-%{kversion} ]; then
675 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
677 depmod -ae %{kversion} || exit 0
681 if [ -f /boot/System.map-%{kversion} ]; then
682 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
684 depmod -ae %{kversion} || exit 0
690 rm -rf $RPM_BUILD_ROOT