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