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