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