Whamcloud - gitweb
LU-6380 scrub: handle update_log during initial scrub
[fs/lustre-release.git] / lustre.spec.in
1 # lustre.spec
2
3 # Declare rpmbuild --with/--without parameters
4 %bcond_without servers
5 %bcond_without ldiskfs
6 %bcond_with zfs
7 %bcond_without lustre_tests
8 %bcond_without lustre_utils
9 %bcond_without lustre_iokit
10 %bcond_without lustre_modules
11 %bcond_with lnet_dlc
12 %bcond_without manpages
13
14 %if %{without servers}
15     # --without servers overrides --with {ldiskfs|zfs}
16     # so undefine the internal variables set by bcond_*
17     %undefine with_ldiskfs
18     %undefine with_zfs
19 %endif
20
21 %{!?version: %global version @VERSION@}
22 %{!?kver:    %global kver    %(uname -r)}
23 %{!?kdir:    %global kdir    /lib/modules/%{kver}/source}
24 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
25
26 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
27 %{!?kversion: %global kversion %(files="include/generated/utsrelease.h include/linux/utsrelease.h include/linux/version.h"; for f in $files; do if test -r %{kobjdir}/$f && grep UTS_RELEASE %{kobjdir}/$f >/dev/null; then sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' %{kobjdir}/$f; break; fi; done)}
28
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
30
31 %if 0%{?build_src_rpm}
32     %{!?myrelease: %global myrelease 1}
33 %else
34     %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
35     %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
36     # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
37     # of %kversion
38     %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/-default$//')
39 %endif
40
41 # always append the buildid, even when the caller defines %release
42 %define fullrelease %{myrelease}%{buildid}
43
44 # in order to get kernel symset and/or kernel module dependencies into
45 # the RPM, in order to support weak-modules, the internal dependency gen-
46 # erator needs to be disabled
47 # this is done with (reduce the double % down to a single %):
48 #
49 # %%global _use_internal_dependency_generator 0
50 #
51 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
52 # defining it here (until Suse changes their mind)
53 #
54 # on RHEL5, however, we do need to explicitly disable the internal dep-
55 # endency generator and allow the external one be used
56 # but since RedHat's kABI is only a subset of the total kernel ABI, it
57 # doesn't include all of the symbols we (or OFED for that matter) need
58 # until RedHat includes all of the symbols we need in their symsets we
59 # cannot support weak-modules
60 # we did e-mail the maintainer of all of this stuff @redhat but got no
61 # response from them
62 #%%global _use_internal_dependency_generator 0
63
64 # Set the package name prefix
65 %if %{undefined lustre_name}
66     %if %{with servers}
67         %global lustre_name lustre
68     %else
69         %global lustre_name lustre-client
70     %endif
71 %endif
72
73 %if %{undefined kmoddir}
74     %if %{defined kernel_module_package_moddir}
75         %global kmoddir %{kernel_module_package_moddir}
76     %else
77         %if %{defined suse_kernel_module_package}
78             %global kmoddir updates
79         %else
80             %global kmoddir extra
81         %endif
82     %endif
83 %endif
84
85 %if %{defined cross_path} && %{defined post_script}
86 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
87 %endif
88
89 # SUSE don't support .debug_info section from cross compiler:
90 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
91 %if %{defined cross_path} && 0%{?suse_version}
92 %global __debug_install_post %{nil}
93 %global __debug_package %{nil}
94 %global debug_package %{nil}
95 %endif
96
97 Summary: Lustre File System
98 Name: %{lustre_name}
99 Version: %{version}
100 Release: %{fullrelease}
101 License: GPL
102 Group: Utilities/System
103 Source: lustre-%{version}.tar.gz
104 URL: https://wiki.hpdd.intel.com/
105 BuildRoot: %{_tmppath}/lustre-%{version}-root
106 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
107 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
108 Requires: %{name}-modules = %{version}
109 BuildRequires: libtool
110 %if %{with manpages}
111 BuildRequires: python-docutils
112 %endif
113 %if %{with servers}
114 Requires: lustre-osd
115 Requires: lustre-osd-mount
116 %endif
117 %if %{defined cross_requires}
118 Requires: %{cross_requires}
119 AutoReqProv: no
120 %else
121 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
122 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
123 #suse don't support selinux
124 BuildRequires: libselinux-devel
125 Requires: libselinux
126 %endif
127 %endif
128
129 %description
130 Userspace tools and files for the Lustre file system.
131
132 %if %{with lustre_modules}
133 %package modules
134 Summary: Kernel Lustre modules for Linux %{kversion}
135 %if %{defined cross_requires}
136 Requires: %{cross_requires}
137 AutoReqProv: no
138 %else
139 # for SLES11, we need nothing here
140 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
141 %if %{defined krequires}
142 # for RHEL we need to require the specific kernel still since weak-modules
143 # support on RH is, well, weak, to be punny about it
144 Requires: kernel = %{krequires}
145 %endif
146 %if %{with lnet_dlc}
147 Requires: libyaml
148 BuildRequires: libyaml-devel
149 %endif
150 %endif
151 %endif
152 Group: Development/Kernel
153
154 %description modules
155 Lustre file system, server and network drivers for Linux %{kversion}.
156
157 %if %{with ldiskfs}
158 %package osd-ldiskfs
159 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
160 Requires: lustre-modules = %{version}
161 Requires: module-init-tools >= 3.9
162 Requires: ldiskfsprogs >= 1.42.7.wc1
163 Requires: lustre-osd-ldiskfs-mount = %{version}
164 Provides: lustre-osd
165 Obsoletes: lustre-ldiskfs
166 Group: Development/Kernel
167
168 %description osd-ldiskfs
169 The Lustre Object Storage Device (OSD) API is the interface to access and
170 modify data that is supposed to be stored persistently. This API is the interface
171 to code that bridges individual file systems. This specific package provides an
172 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
173 backing store of a Lustre server.
174
175 %if %{with lustre_utils}
176 %package osd-ldiskfs-mount
177 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
178 Provides: lustre-osd-mount
179 Group: Development/Kernel
180
181 %description osd-ldiskfs-mount
182 LDISKFS hooks for mount/mkfs into a dynamic library.
183
184 %endif
185 %endif
186
187 %if %{with zfs}
188 %package osd-zfs
189 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
190 Requires: lustre-modules = %{version}, zfs-kmod
191 Requires: lustre-osd-zfs-mount = %{version}
192 Provides: lustre-osd
193 Group: Development/Kernel
194
195 %description osd-zfs
196 The Lustre Object Storage Device (OSD) API is the interface to access and
197 modify data that is supposed to be stored persistently. This API is the interface
198 to code that bridges individual file systems. This specific package provides an
199 implementation of the OSD API for using the ZFS filesystem as the underlying
200 backing store of a Lustre server.
201
202 %if %{with lustre_utils}
203 %package osd-zfs-mount
204 Summary: osd-zfs-mount contains mount's zfs specific dso.
205 Provides: lustre-osd-mount
206 Group: Development/Kernel
207
208 %description osd-zfs-mount
209 ZFS hooks for mount/mkfs into a dynamic library.
210
211 %endif
212 %endif
213 %endif # with lustre_modules
214
215 %package source
216 Summary: Object-Based Disk storage driver source
217 Group: Development/Kernel
218
219 %description source
220 Lustre sources for further development
221
222 # Since the RPMs we ship are to be used on both SLES and RHEL, we
223 # can't include any dependency information (since the package names
224 # are different on the two platforms).
225 #
226 # Instead, we can build these empty meta-packages that only include
227 # dependency information.  These let people get the correct
228 # dependencies for their platform and lets them use tools like yum and
229 # red carpet to install the correct files.
230 #
231 # Unfortunately I have not seen this come up on the lists much, so I
232 # have disabled them (by commenting out their empty files section
233 # below) until it's clear that they resolve more confusion than they
234 # add.
235
236 %package deps-sles
237 Summary: Lustre dependencies meta-package for SLES
238 Group: Utilities/System
239 Provides: lustre-deps = %{version}
240 Requires: %{name} = %{version}, sles-release
241 Conflicts: %{name}-deps-rhel
242
243 %description deps-sles
244 This package has RPM dependencies appropriate for SLES systems.
245
246 %package deps-rhel
247 Summary: Lustre dependencies meta-package for RHEL
248 Group: Utilities/System
249 Provides: lustre-deps = %{version}
250 Requires: %{name} = %{version}, redhat-release
251 Conflicts: %{name}-deps-sles
252
253 %description deps-rhel
254 This package has RPM dependencies appropriate for RHEL, RHL, and FC
255 systems.
256
257 %package tests
258 Summary: Lustre testing framework
259 Group: Development/Kernel
260 Provides: %{name}-tests = %{version}
261 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
262 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
263
264 %description tests
265 This package contains a set of test binaries and scripts that are intended
266 to be used by the Lustre testing framework.
267
268 %if %{with lustre_iokit}
269 %package -n lustre-iokit
270 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
271 Group: Applications/System
272 Requires: python > 2.2, sg3_utils
273
274 %description -n lustre-iokit
275 This package includes five tools:
276 sgpdd-survey:
277 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
278
279 obdfilter-survey
280 This survey can be run in 3 modes to test disk I/O including the filesystem,
281 network I/O, and disk I/O via the network.  The script does sequential I/O
282 with varying numbers of threads and objects (files) by using lctl::test_brw
283 to drive the echo_client connected to local or remote obdfilter instances,
284 or remote obdecho instances.
285
286 ost-survey
287 This survey tests the client-to-disk performance of individual OSTs, and
288 ranks then for comparison.
289
290 stats-collect
291 This script will collect IO stats on a defined set of nodes.
292
293 ior-survey:
294 A script to run the IOR benchmark. The latest version can be downloaded from
295 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
296
297 mds-survey:
298 This survey tests the local metadata performance using the echo_client to drive
299 the MDD layer to perform operations. It is run with multiple threads (to
300 simulate MDT service threads) locally on the MDS node, and does not need Lustre
301 clients in order to run
302 %endif
303
304 %if 0%{?suse_version}
305 %debug_package
306 %endif
307 %prep
308 %setup -qn lustre-%{version}
309 ln lustre/ChangeLog ChangeLog-lustre
310 ln lnet/ChangeLog ChangeLog-lnet
311
312 %build
313
314 # Set an explicit path to our Linux tree, if we can.
315 cd $RPM_BUILD_DIR/lustre-%{version}
316 # override %optflags so that the vendor's overzealous flags don't create
317 # build failures
318 %define optflags -g -O2 -Werror
319
320 CONFIGURE_ARGS="%{?configure_args}"
321 if [ -n "$CONFIGURE_ARGS" ]; then
322         # make sure %%kdir and %%kobjdir are not in the configure arguments
323         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
324         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
325         # remove --with-kmp-moddir from configure arguments,
326         # it will be set --with-kmp-moddir=%%kmoddir
327         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
328 fi
329
330 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
331 # string in it which we don't want word splitted by the shell
332 # also remove (build|host|target) options because they will be specified
333 # inside $CONFIGURE_ARGS
334 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
335
336 %eval_configure $CONFIGURE_ARGS \
337         %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
338         %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
339         %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
340         %{!?with_lustre_iokit:--disable-iokit} \
341         %{!?with_ldiskfs:--disable-ldiskfs} \
342         %{!?with_servers:--disable-server} \
343         %{!?with_zfs:--without-zfs} \
344         %{!?with_lnet_dlc:--disable-dlc} \
345         %{!?with_manpages:--disable-manpages} \
346         --with-release=%{release} \
347         --with-linux=%{kdir} \
348         --with-linux-obj=%{kobjdir} \
349         --with-kmp-moddir=%{kmoddir}
350
351 make %{?_smp_mflags} -s %{?make_args}
352
353 %install
354 make install DESTDIR=$RPM_BUILD_ROOT
355
356 :> lustre.files
357
358 %if %{with servers} && %{with lustre_utils}
359 # The .ha_v2 extension identifies the heartbeat resource agent as using
360 # legacy syntax. Install a compatibility symlink to avoid conflicts when
361 # newer-style agents are added.
362 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
363 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
364 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
365 %endif
366
367 %if %{_vendor}=="redhat"
368 # The following scripts are Red Hat specific
369 %if %{with servers}
370 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
371 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
372 %endif
373 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
374 %endif
375
376 # Create the pristine source directory.
377 cd $RPM_BUILD_DIR/lustre-%{version}
378 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
379 rm -f lustre-source
380 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
381 make distdir distdir=lustre-source/lustre-%{version}
382 chmod -R go-w lustre-source/lustre-%{version}
383 # fc18 needs 'x' permission for library files
384 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
385
386 %if %{with lnet_dlc}
387 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
388 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
389 %endif
390
391 %if %{with ldiskfs}
392 echo '%{_libdir}/libiam.a' >>lustre.files
393 %endif
394
395 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
396         echo '%{_libdir}/lustre/snmp' >>lustre.files
397         echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
398 fi
399
400 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
401     -name \*.la -type f -exec rm -f {} \;
402
403 %if %{with lustre_tests}
404 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
405 echo '%{_bindir}/mcreate' >>lustre-tests.files
406 echo '%{_bindir}/munlink' >>lustre-tests.files
407 echo '%{_bindir}/req_layout' >>lustre-tests.files
408 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
409 echo '%{_sbindir}/wiretest' >>lustre-tests.files
410 %if %{with lustre_modules}
411 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
412 %endif
413 %endif
414
415 %if %{defined cross_path}
416 %if %{defined rpm_post_base}
417 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
418 if [ -f $POST_SCRIPT ]; then
419         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
420         echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
421         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
422 %if %{with ldiskfs}
423         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
424 %if %{with lustre_utils}
425         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
426 %endif
427 %endif
428 %if %{with zfs}
429         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
430 %if %{with lustre_utils}
431         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
432 %endif
433 %endif
434 %if %{with lustre_tests}
435         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
436         echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
437 %endif
438 fi
439 %endif
440 %else
441 %if %{with lustre_modules}
442 # mark modules executable for find-debuginfo.sh
443 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
444     -name \*.ko -type f -exec chmod u+x {} \;
445 %endif
446 %endif
447
448 %files -f lustre.files
449 %defattr(-,root,root)
450 %{_sbindir}/*
451 %exclude %{_sbindir}/wirecheck
452 %exclude %{_sbindir}/wiretest
453 %if %{with zfs}
454 %exclude %{_sbindir}/zfsobj2fid
455 %endif
456 %if %{with lustre_utils}
457 %if %{with servers}
458 %{_libexecdir}/lustre/lc_common
459 %{_libexecdir}/lustre/haconfig
460 %{_bindir}/lustre_req_history
461 %endif
462
463 %{_bindir}/llobdstat
464 %{_bindir}/llstat
465 %{_bindir}/plot-llstat
466
467 %{_bindir}/lfs
468 %{_bindir}/lfs_migrate
469 %{?rootdir}/sbin/mount.lustre
470 %{_libdir}/libptlctl.a
471 %{_libdir}/libcfsutil.a
472 %{_libdir}/liblustreapi.a
473 %{_libdir}/liblustreapi.so
474 %if %{with manpages}
475 %{_mandir}/man?/*
476 %endif
477 %{_includedir}/lustre
478 %{_includedir}/libcfs
479 %endif
480 %{_datadir}/lustre
481 %{_sysconfdir}/udev/rules.d/99-lustre.rules
482 %config(noreplace) %{_sysconfdir}/ldev.conf
483
484 %if %{with lustre_modules}
485 %files modules
486 %defattr(-,root,root)
487 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
488 %if %{with lustre_tests}
489 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
490 %endif
491 %if %{with ldiskfs}
492 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
493 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
494 %endif
495 %if %{with zfs}
496 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
497 %endif
498 %if %{defined rpm_post_base}
499 %attr(0555, root, root) %{rpm_post_base}-modules.sh
500 %endif
501 %doc COPYING
502 %doc ChangeLog-lustre
503 %doc ChangeLog-lnet
504
505 %if %{with ldiskfs}
506 %files osd-ldiskfs
507 %defattr(-,root,root)
508 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
509 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
510 %if %{defined rpm_post_base}
511 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
512 %endif
513 %if %{with lustre_utils}
514 %files osd-ldiskfs-mount
515 %defattr(-,root,root)
516 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
517 %if %{defined rpm_post_base}
518 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
519 %endif
520 %endif
521 %endif
522
523 %if %{with zfs}
524 %files osd-zfs
525 %defattr(-,root,root)
526 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
527 %{_sbindir}/zfsobj2fid
528 %if %{defined rpm_post_base}
529 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
530 %endif
531 %if %{with lustre_utils}
532 %files osd-zfs-mount
533 %defattr(-,root,root)
534 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
535 %if %{defined rpm_post_base}
536 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
537 %endif
538 %endif
539 %endif
540 %endif # with lustre_modules
541
542 %files source
543 %defattr(-,root,root)
544 %{_prefix}/src/lustre-%{version}
545
546 # uncomment these lines to enable deps packages
547 # %files deps-sles
548 # %files deps-rhel
549
550 %if %{with lustre_tests}
551 %files tests -f lustre-tests.files
552 %defattr(-,root,root)
553 %endif
554
555 %if %{with lustre_iokit}
556 %files -n lustre-iokit
557 %defattr(-, root, root)
558 %{_bindir}/iokit-config
559 %{_bindir}/iokit-gather-stats
560 %{_bindir}/iokit-libecho
561 %{_bindir}/iokit-lstats
562 %{_bindir}/iokit-parse-ior
563 %{_bindir}/iokit-plot-obdfilter
564 %{_bindir}/iokit-plot-ost
565 %{_bindir}/iokit-plot-sgpdd
566 %{_bindir}/ior-survey
567 %{_bindir}/mds-survey
568 %{_bindir}/obdfilter-survey
569 %{_bindir}/ost-survey
570 %{_bindir}/sgpdd-survey
571 %doc lustre-iokit/ior-survey/README.ior-survey
572 %doc lustre-iokit/mds-survey/README.mds-survey
573 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
574 %doc lustre-iokit/ost-survey/README.ost-survey
575 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
576 %doc lustre-iokit/stats-collect/README.iokit-lstats
577 %endif
578
579 %if %{defined rpm_post_base}
580 %post
581 if [ -x %{rpm_post_base}.sh ]; then
582         %{rpm_post_base}.sh %{cross_path} create
583 fi
584
585 %preun
586 if [ -x %{rpm_post_base}.sh ]; then
587         %{rpm_post_base}.sh %{cross_path} remove
588 fi
589 %endif
590
591 %if %{with lustre_modules}
592 %post modules
593 %if %{defined rpm_post_base}
594 if [ -x %{rpm_post_base}-modules.sh ]; then
595         %{rpm_post_base}-modules.sh %{cross_path} create
596 fi
597 %else
598 if [ -f /boot/System.map-%{kversion} ]; then
599         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
600 else
601         depmod -ae %{kversion} || exit 0
602 fi
603
604 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
605 # "weak modules" support
606 # Suse
607 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
608     rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
609         /usr/lib/module-init-tools/weak-modules --add-modules
610 fi
611 # RedHat
612 if [ -x /sbin/weak-modules ]; then
613     rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
614         /sbin/weak-modules --add-modules
615 fi
616
617 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
618 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
619 # print a warning so that users are aware of this issue.
620 if sysctl kernel.unsupported >/dev/null 2>&1 &&
621    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
622     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
623      echo "
624      warning: the Lustre modules are not supported by Novell. To use Lustre
625               on this system, you should put
626
627      allow_unsupported_modules 1
628
629      into /etc/modprobe.d/unsupported_modules"
630 fi
631 %endif
632
633 %if %{with ldiskfs}
634 %post osd-ldiskfs
635 %if %{defined rpm_post_base}
636 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
637         %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
638 fi
639 %else
640 if [ -f /boot/System.map-%{kversion} ]; then
641        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
642 else
643        depmod -ae %{kversion} || exit 0
644 fi
645
646 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
647 # "weak modules" support
648 # Suse
649 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
650     rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
651         /usr/lib/module-init-tools/weak-modules --add-modules
652 fi
653 # RedHat
654 if [ -x /sbin/weak-modules ]; then
655     rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
656         /sbin/weak-modules --add-modules
657 fi
658
659 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
660 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
661 # print a warning so that users are aware of this issue.
662 if sysctl kernel.unsupported >/dev/null 2>&1 &&
663    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
664     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
665      echo "
666      warning: the Lustre modules are not supported by Novell. To use Lustre
667               on this system, you should put
668
669      allow_unsupported_modules 1
670
671      into /etc/modprobe.d/unsupported_modules"
672 fi
673 %endif
674 %if %{with lustre_utils} && %{defined rpm_post_base}
675 %post osd-ldiskfs-mount
676 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
677         %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
678 fi
679 %endif
680 %endif
681
682 %if %{with zfs}
683 %post osd-zfs
684 %if %{defined rpm_post_base}
685 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
686         %{rpm_post_base}-osd-zfs.sh %{cross_path} create
687 fi
688 %else
689 if [ -f /boot/System.map-%{kversion} ]; then
690        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
691 else
692        depmod -ae %{kversion} || exit 0
693 fi
694
695 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
696 # "weak modules" support
697 # Suse
698 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
699     rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
700         /usr/lib/module-init-tools/weak-modules --add-modules
701 fi
702 # RedHat
703 if [ -x /sbin/weak-modules ]; then
704     rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
705         /sbin/weak-modules --add-modules
706 fi
707
708 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
709 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
710 # print a warning so that users are aware of this issue.
711 if sysctl kernel.unsupported >/dev/null 2>&1 &&
712    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
713     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
714      echo "
715      warning: the Lustre modules are not supported by Novell. To use Lustre
716               on this system, you should put
717
718      allow_unsupported_modules 1
719
720      into /etc/modprobe.d/unsupported_modules"
721 fi
722 %endif
723 %if %{with lustre_utils} && %{defined rpm_post_base}
724 %post osd-zfs-mount
725 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
726         %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
727 fi
728 %endif
729 %endif
730
731 %preun modules
732 %if %{defined rpm_post_base}
733 if [ -x %{rpm_post_base}-modules.sh ]; then
734         %{rpm_post_base}-modules.sh %{cross_path} remove
735 fi
736 %else
737 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
738 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
739 %endif
740
741 %if %{with ldiskfs}
742 %preun osd-ldiskfs
743 %if %{defined rpm_post_base}
744 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
745         %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
746 fi
747 %else
748 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
749 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
750 %endif
751 %if %{with lustre_utils} && %{defined rpm_post_base}
752 %preun osd-ldiskfs-mount
753 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
754         %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
755 fi
756 %endif
757 %endif
758
759 %if %{with zfs}
760 %preun osd-zfs
761 %if %{defined rpm_post_base}
762 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
763         %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
764 fi
765 %else
766 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
767 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
768 %endif
769 %if %{with lustre_utils} && %{defined rpm_post_base}
770 %preun osd-zfs-mount
771 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
772         %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
773 fi
774 %endif
775 %endif
776
777 %if %{undefined cross_path}
778 %postun modules
779 if [ -f /boot/System.map-%{kversion} ]; then
780         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
781 else
782         depmod -ae %{kversion} || exit 0
783 fi
784
785 # "weak modules" support
786 # Suse
787 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
788     cat /var/run/%{name}-modules |
789         /usr/lib/module-init-tools/weak-modules --remove-modules
790 fi
791 # RedHat
792 if [ -x /sbin/weak-modules ]; then
793     cat /var/run/%{name}-modules |
794         /sbin/weak-modules --remove-modules
795 fi
796 rm /var/run/%{name}-modules
797
798 %if %{with ldiskfs}
799 %postun osd-ldiskfs
800 if [ -f /boot/System.map-%{kversion} ]; then
801        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
802 else
803        depmod -ae %{kversion} || exit 0
804 fi
805
806 # "weak modules" support
807 # Suse
808 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
809     cat /var/run/%{name}-osd-ldiskfs |
810         /usr/lib/module-init-tools/weak-modules --remove-modules
811 fi
812 # RedHat
813 if [ -x /sbin/weak-modules ]; then
814     cat /var/run/%{name}-osd-ldiskfs |
815         /sbin/weak-modules --remove-modules
816 fi
817 rm /var/run/%{name}-osd-ldiskfs
818 %endif
819
820 %if %{with zfs}
821 %postun osd-zfs
822 if [ -f /boot/System.map-%{kversion} ]; then
823        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
824 else
825        depmod -ae %{kversion} || exit 0
826 fi
827
828 # "weak modules" support
829 # Suse
830 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
831     cat /var/run/%{name}-osd-zfs |
832         /usr/lib/module-init-tools/weak-modules --remove-modules
833 fi
834 # RedHat
835 if [ -x /sbin/weak-modules ]; then
836     cat /var/run/%{name}-osd-zfs |
837         /sbin/weak-modules --remove-modules
838 fi
839 rm /var/run/%{name}-osd-zfs
840 %endif
841 %endif
842 %endif # with lustre_modules
843
844 %if %{with lustre_tests}
845 %if %{defined rpm_post_base}
846 %post tests
847 if [ -x %{rpm_post_base}-tests.sh ]; then
848         %{rpm_post_base}-tests.sh %{cross_path} create
849 fi
850
851 %preun tests
852 if [ -x %{rpm_post_base}-tests.sh ]; then
853         %{rpm_post_base}-tests.sh %{cross_path} remove
854 fi
855 %else
856 %if %{with lustre_modules}
857 %post tests
858 if [ -f /boot/System.map-%{kversion} ]; then
859         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
860 else
861         depmod -ae %{kversion} || exit 0
862 fi
863
864 %postun tests
865 if [ -f /boot/System.map-%{kversion} ]; then
866         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
867 else
868         depmod -ae %{kversion} || exit 0
869 fi
870 %endif
871 %endif
872 %endif
873
874 %clean
875 rm -rf $RPM_BUILD_ROOT