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