Whamcloud - gitweb
00b592d0f6fcce3e23a8d81ca60639aa8fd3aab3
[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 snmp
12 %bcond_with gss
13 %bcond_with gss_keyring
14 %bcond_without manpages
15 %bcond_without shared
16 %bcond_without static
17 %bcond_with    systemd
18 %bcond_with mofed
19 %bcond_without mpi
20 %bcond_with kabi
21
22 # By default both gss and gss keyring are disabled.
23 # gss keyring requires the gss core. If the builder
24 # request gss_keyring we must enable gss core even if
25 # the builder attempts to disable gss.
26 %if %{with gss_keyring}
27     %define with_gss 1
28 %endif
29
30 %if %{without servers}
31     # --without servers overrides --with {ldiskfs|zfs}
32     # so undefine the internal variables set by bcond_*
33     %undefine with_ldiskfs
34     %undefine with_zfs
35 %endif
36
37 %if %{without shared} && %{without static}
38 # need exit to stop build because error only displays a message
39 %{error: you can't disable both library types}
40 %{exit 1}
41 %endif
42
43 # lustre_tests depends on lustre_utils
44 %if %{without lustre_utils}
45 %undefine with_lustre_tests
46 %endif
47
48 %{!?version: %global version @VERSION@}
49 # if you want a custom kernel version set it variable with $ver.$arch
50 %{!?kver:    %global kver    %(uname -r)}
51 # cut epoch for kmodtool
52 %define _kver %(echo %{kver} | sed -e 's/^[0-9]*://')
53 # trust version from kdir - but it can lost 'epoch'
54 %if %{defined kdir}
55         %define _take_kver 1
56 %endif
57 %{!?kdir:    %global kdir    /lib/modules/%{_kver}/source}
58 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{_kver}/source" ]; then echo "/lib/modules/%{_kver}/build"; else echo "%{kdir}"; fi)}
59
60 %if %{defined _take_kver}
61 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
62 %global kver %(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)
63 %define _kver %kver
64 %endif
65
66 # We set this because kernel_module_package has its own method of identifying
67 # which kernel to build against, and it is unlikely that its decision will
68 # match with Lustre's method of selecting which kernel to build against.
69 # By setting this variable, we override kernel_module_package's kernel
70 # selection with our selection.
71 # kmodtool failed to take a version if epoch set
72 %global kernel_version %_kver
73
74 # in order to get kernel symset and/or kernel module dependencies into
75 # the RPM, in order to support weak-modules, the internal dependency gen-
76 # erator needs to be disabled
77 # this is done with (reduce the double % down to a single %):
78 #
79 # %%global _use_internal_dependency_generator 0
80 #
81 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
82 # defining it here (until Suse changes their mind)
83 #
84 # on RHEL5, however, we do need to explicitly disable the internal dep-
85 # endency generator and allow the external one be used
86 # but since RedHat's kABI is only a subset of the total kernel ABI, it
87 # doesn't include all of the symbols we (or OFED for that matter) need
88 # until RedHat includes all of the symbols we need in their symsets we
89 # cannot support weak-modules
90 # we did e-mail the maintainer of all of this stuff @redhat but got no
91 # response from them
92 #%%global _use_internal_dependency_generator 0
93
94 # Set the package name prefix
95 %if %{undefined lustre_name}
96     %if %{with servers}
97         %global lustre_name lustre
98     %else
99         %global lustre_name lustre-client
100     %endif
101 %endif
102
103 %if %{with lustre_modules}
104 %if %{undefined kmoddir}
105     %if %{defined kernel_module_package_moddir}
106         %global kmoddir %{kernel_module_package_moddir}
107     %else
108         %if %{defined suse_kernel_module_package}
109             %global kmoddir updates
110         %else
111             %global kmoddir extra
112         %endif
113     %endif
114 %endif
115
116 %global modules_fs_path /lib/modules/%{_kver}/%{kmoddir}
117 # requires want to set a version including epoch
118 %global krequires %(echo %{kver} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//')
119
120 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
121         %global requires_kmod_name kmod-%{lustre_name}
122         %global requires_kmod_osd_zfs_name kmod-%{lustre_name}-osd-zfs
123         %if %{with lustre_tests}
124                 %global requires_kmod_tests_name kmod-%{lustre_name}-tests
125         %endif
126         %global requires_kmod_version %{version}
127 %else   #for Suse
128         %global requires_kmod_name %{lustre_name}-kmp
129         %global requires_kmod_osd_zfs_name %{lustre_name}-osd-zfs-kmp
130         %if %{with lustre_tests}
131                 %global requires_kmod_tests_name %{lustre_name}-tests-kmp
132         %endif
133         %if 0%{?suse_version} >= 1200
134                 %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
135         %else
136                 %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
137         %endif
138 %endif
139 %endif
140
141 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
142         %global requires_yaml_name libyaml
143 %else   #for Suse
144         %global requires_yaml_name libyaml-0-2
145 %endif
146
147 # RHEL >= 7 comes with systemd
148 %if 0%{?rhel} >= 7
149 %define with_systemd 1
150 %endif
151
152 # Fedora >= 15 comes with systemd, but only >= 18 has
153 # the proper macros
154 %if 0%{?fedora} >= 18
155 %define with_systemd 1
156 %endif
157
158 # opensuse >= 12.1 comes with systemd, but only >= 13.1
159 # has the proper macros
160 %if 0%{?suse_version} >= 1310
161 %define with_systemd 1
162 %endif
163
164 %{!?mpi_name: %global mpi_name openmpi}
165
166 Summary: Lustre File System
167 Name: %{lustre_name}
168 Version: %{version}
169 Release: 1%{?dist}
170 License: GPL
171 Group: System Environment/Kernel
172 Source: lustre-%{version}.tar.gz
173 Source1: kmp-lustre.preamble
174 Source2: kmp-lustre.files
175 Source3: kmp-lustre-osd-ldiskfs.preamble
176 Source4: kmp-lustre-osd-ldiskfs.files
177 Source5: kmp-lustre-osd-zfs.preamble
178 Source6: kmp-lustre-osd-zfs.files
179 Source7: kmp-lustre-tests.files
180 URL: https://wiki.whamcloud.com/
181 BuildRoot: %{_tmppath}/lustre-%{version}-root
182 %if %{with lustre_modules}
183 Requires: %{requires_kmod_name} = %{requires_kmod_version}
184 %endif
185 Requires: zlib
186 Requires: %{requires_yaml_name}
187 BuildRequires: libtool libyaml-devel zlib-devel binutils-devel
188 %if %{_vendor}=="redhat"
189 BuildRequires: redhat-rpm-config
190 BuildRequires: pkgconfig
191 %else
192 BuildRequires: pkg-config
193 %endif
194 %if %{with gss}
195 BuildRequires: krb5-devel openssl-devel
196 Requires: krb5-libs openssl-libs
197 %endif
198 %if %{with servers}
199 Requires: lustre-osd
200 Requires: lustre-osd-mount
201 Obsoletes: lustre-server < %{version}
202 Provides: lustre-server = %{version}-%{release}
203 %endif
204 Obsoletes: lustre-client < %{version}
205 Provides: lustre-client = %{version}-%{release}
206 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
207 #suse don't support selinux
208 BuildRequires: libselinux-devel
209 %endif
210 %if %{with lustre_modules}
211 %if %{with mofed}
212 BuildRequires: mlnx-ofa_kernel-devel
213 %if %{_vendor} == "redhat"
214 Requires: kmod-mlnx-ofa_kernel
215 %else
216 Requires: mlnx-ofa_kernel-kmp
217 %endif
218 %endif
219 %if 0%{?rhel} >= 8
220 BuildRequires: kernel-rpm-macros
221 %endif
222 BuildRequires: %kernel_module_package_buildreqs
223 # need to provide a /usr/lib/${uname -r)/build dir
224 BuildRequires: kernel
225 %if %{_vendor}=="redhat"
226 %if %{with kabi}
227 BuildRequires: kernel-abi-whitelists
228 %endif
229 %endif
230 %endif
231
232 %if %{with systemd}
233 Requires(post): systemd
234 Requires(preun): systemd
235 Requires(postun): systemd
236 BuildRequires: systemd
237 %endif
238
239 %description
240 Userspace tools and files for the Lustre file system.
241
242 %if %{with lustre_modules}
243 %if 0%{?rhel} == 7
244 # until we have achieved full kABI compatibility we need to
245 # restrict the kernel range that can be used to the kernel
246 # version from the RHEL minor release
247 # this is supposed to be done for kmods automatically but
248 # RHBZ#1467319 seems to be getting in the way
249 # this is true for el7.0 through el7.4
250 %define preamble %{expand:%(
251 TMPFILE=`mktemp`
252 cat %{SOURCE1} > $TMPFILE
253 kver=%{kernel_version}
254 linuxversion=${kver%%%%-*}
255 linuxrelease=${kver##*-}
256 kabiminor=${linuxrelease%%%%.*}
257 echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
258 echo $TMPFILE
259 )}
260 %else
261 %define preamble %{SOURCE1}
262 %endif
263 %kernel_module_package -n %{name} -p %preamble -f %SOURCE2 default
264
265 %if %{with ldiskfs}
266 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 default
267 %if %{with lustre_utils}
268 %package osd-ldiskfs-mount
269 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
270 BuildRequires: e2fsprogs-devel
271 Requires: ldiskfsprogs
272 Provides: lustre-osd-mount = %{version}
273 Obsoletes: lustre-osd-mount < %{version}
274 Group: System Environment/Kernel
275
276 %description osd-ldiskfs-mount
277 LDISKFS hooks for mount/mkfs into a dynamic library.
278
279 %endif  # with lustre_utils
280 %endif  # with ldiskfs
281
282 %if %{with zfs}
283 %kernel_module_package -n %{name}-osd-zfs -p %SOURCE5 -f %SOURCE6 default
284 %if %{with lustre_utils}
285 %package osd-zfs-mount
286 Summary: osd-zfs-mount contains mount's zfs specific dso.
287 Provides: lustre-osd-mount = %{version}
288 Obsoletes: lustre-osd-mount < %{version}
289 # Tests also require zpool from zfs package:
290 Requires: zfs
291 Requires: %{requires_kmod_osd_zfs_name}
292 Group: System Environment/Kernel
293
294 %description osd-zfs-mount
295 ZFS hooks for mount/mkfs into a dynamic library.
296
297 %endif  # with lustre_utils
298 %endif  # with zfs
299
300 %endif # with lustre_modules
301
302 %if %{with servers}
303 %package resource-agents
304 Summary: HA Resuable Cluster Resource Scripts for Lustre
305 Group: System Environment/Base
306 Requires: %{name}
307 Requires: resource-agents
308
309 %description resource-agents
310 A set of scripts to operate Lustre resources in a High Availablity
311 environment for both Pacemaker and rgmanager.
312 %endif
313
314 %if %{with lustre_tests}
315 %package tests
316 Summary: Lustre testing framework
317 Group: System Environment/Kernel
318 Provides: lustre-tests = %{version}
319 %if %{with lustre_iokit}
320 Requires: lustre-iokit
321 %endif
322 Requires: lustre-client = %{version}
323 %if %{with lustre_modules}
324 Requires: %{requires_kmod_name} = %{requires_kmod_version}
325 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
326 %endif
327 Requires: attr, rsync, perl, lsof, libtool, /usr/bin/getconf
328 %if %{with mpi}
329 %if %{mpi_name} == "mpich"
330 BuildRequires: mpich-devel
331 %endif
332 %if %{mpi_name} == "openmpi"
333 %if %{_vendor} == "redhat" || 0%{?suse_version} < 1500
334 BuildRequires: openmpi-devel
335 %else
336 BuildRequires: openmpi2-devel
337 %endif
338 %endif
339 %endif
340
341 %description tests
342 This package contains a set of test binaries and scripts that are intended
343 to be used by the Lustre testing framework.
344
345 %if %{with lustre_modules}
346 %kernel_module_package -n %{name}-tests -f %SOURCE7 default
347 %endif
348 %endif
349
350 %if %{with lustre_iokit}
351 %package -n lustre-iokit
352 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
353 Group: Applications/System
354 Requires: python2 > 2.2, sg3_utils
355
356 %description -n lustre-iokit
357 This package includes five tools:
358 sgpdd-survey:
359 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
360
361 obdfilter-survey
362 This survey can be run in 3 modes to test disk I/O including the filesystem,
363 network I/O, and disk I/O via the network.  The script does sequential I/O
364 with varying numbers of threads and objects (files) by using lctl::test_brw
365 to drive the echo_client connected to local or remote obdfilter instances,
366 or remote obdecho instances.
367
368 ost-survey
369 This survey tests the client-to-disk performance of individual OSTs, and
370 ranks then for comparison.
371
372 stats-collect
373 This script will collect IO stats on a defined set of nodes.
374
375 ior-survey:
376 A script to run the IOR benchmark. The latest version can be downloaded from
377 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
378
379 mds-survey:
380 This survey tests the local metadata performance using the echo_client to drive
381 the MDD layer to perform operations. It is run with multiple threads (to
382 simulate MDT service threads) locally on the MDS node, and does not need Lustre
383 clients in order to run
384 %endif
385
386 %if 0%{?suse_version}
387 %debug_package
388 %endif
389 %prep
390 %setup -qn lustre-%{version}
391 ln lustre/ChangeLog ChangeLog-lustre
392 ln lnet/ChangeLog ChangeLog-lnet
393
394 %build
395 # Set an explicit path to our Linux tree, if we can.
396 cd $RPM_BUILD_DIR/lustre-%{version}
397
398 # Store the CFLAGS and LDFLAGS that would normally be used in the UTILS_CFLAGS
399 # and UTILS_LDFLAGS environment variables so that we use can them when compiling
400 # the user-space code in lustre/utils and lnet/utils. As of RHEL 8.0, the
401 # __global_* variants are deprecated in favour of build_cflags, etc. If neither
402 # style is available (e.g. on SLES), then these just end up as empty strings.
403 export UTILS_CFLAGS="%{?build_cflags:%{build_cflags}}%{!?build_cflags:%{?__global_cflags:%{__global_cflags}}}"
404 export UTILS_LDFLAGS="%{?build_ldflags:%{build_ldflags}}%{!?build_ldflags:%{?__global_ldflags:%{__global_ldflags}}}"
405
406 # RHEL7 on PPC64 needs __SANE_USERSPACE_TYPES__ defined so that __s64 and __u64
407 # are presented to user-land as long long instead of long long. Without this it
408 # will fail the format check whenever such a variable is printed.
409 %if 0%{?rhel}
410 %ifarch ppc64
411 export UTILS_CFLAGS="${UTILS_CFLAGS} -D__SANE_USERSPACE_TYPES__=1"
412 %endif
413 %endif
414
415 # Disable any hardening or annotation since this doesn't make sense for
416 # kernel code, and reset %optflags so that the vendor's overzealous flags don't
417 # create build failures.
418 %define optflags -g -O2 -Werror
419 %undefine _annotated_build
420 %undefine _hardened_build
421
422 CONFIGURE_ARGS="%{?configure_args}"
423 if [ -n "$CONFIGURE_ARGS" ]; then
424         # make sure %%kdir and %%kobjdir are not in the configure arguments
425         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
426         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
427         # remove --with-kmp-moddir from configure arguments,
428         # it will be set --with-kmp-moddir=%%kmoddir
429         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
430 fi
431
432 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
433 # string in it which we don't want word splitted by the shell
434 # also remove (build|host|target) options because they will be specified
435 # inside $CONFIGURE_ARGS
436 # kmod tools/scripts require %{name} directory with kernel modules
437 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
438
439 %{?_openmpi_load}
440 %{?_mpich_load}
441
442 %eval_configure $CONFIGURE_ARGS \
443         %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
444         %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
445         %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
446         %{!?with_shared:--disable-shared} \
447         %{!?with_static:--disable-static} \
448         %{!?with_lustre_iokit:--disable-iokit} \
449         %{!?with_ldiskfs:--disable-ldiskfs} \
450         %{!?with_servers:--disable-server} \
451         %{!?with_zfs:--without-zfs} \
452         %{!?with_snmp:--disable-snmp} \
453         %{!?with_gss:--disable-gss} \
454         %{!?with_gss_keyring:--disable-gss-keyring} \
455         %{!?with_manpages:--disable-manpages} \
456         %{!?with_systemd:--with-systemdsystemunitdir=no} \
457         %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
458         %{?with_mofed:--with-o2ib=/usr/src/ofa_kernel/default} \
459         --with-linux=%{kdir} \
460         --with-linux-obj=%{kobjdir} \
461         --with-kmp-moddir=%{kmoddir}/%{name}
462
463 %if %{with servers}
464 if ! grep -q define[[:space:]]*HAVE_SERVER_SUPPORT config.h 2> /dev/null; then
465         echo "Error: Server Support configured but not found"
466         false
467 fi
468 %endif
469
470 make %{?_smp_mflags} -s %{?make_args}
471
472 %install
473 %{?_openmpi_load}
474 %{?_mpich_load}
475
476 make install DESTDIR=$RPM_BUILD_ROOT
477
478 %if %{with lustre_modules}
479 # RHEL's kernel_module_path macro expects that all the modules
480 # in a kmod package will be in modules_fs_path/<sub packagename>
481 # but Lustre installs all of the modules in a single pass into
482 # a shared location.  Since this is a restriction imposed by
483 # RHEL, we handle this here in the spec file rather than in
484 # Lustre's build system.  This is not expected to bother SLES's
485 # kernel_module_path macro.
486 basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{name}
487 %if %{with ldiskfs}
488 mkdir -p $basemodpath-osd-ldiskfs/fs
489 mv $basemodpath/fs/osd_ldiskfs.ko $basemodpath-osd-ldiskfs/fs/osd_ldiskfs.ko
490 mv $basemodpath/fs/ldiskfs.ko $basemodpath-osd-ldiskfs/fs/ldiskfs.ko
491 %endif
492 %if %{with zfs}
493 mkdir -p $basemodpath-osd-zfs/fs
494 mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
495 %endif
496 %if %{with lustre_tests}
497 mkdir -p $basemodpath-tests/fs
498 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
499 mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
500 mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
501 %endif
502 %endif
503
504 :> lustre.files
505
506 %if %{with servers} && %{with lustre_utils}
507 # The .ha_v2 extension identifies the heartbeat resource agent as using
508 # legacy syntax. Install a compatibility symlink to avoid conflicts when
509 # newer-style agents are added.
510 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
511 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
512 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
513 %endif
514
515 # systemd is on redhat, fedora, and suse
516 %if %{with systemd}
517 echo '%{_unitdir}/lnet.service' >>lustre.files
518 %endif
519
520 %if %{_vendor}=="redhat"
521 # The following scripts are Red Hat specific
522 %if %{with servers}
523 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
524 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
525 %if %{with gss_keyring}
526 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
527 echo '%config(noreplace) %{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
528 %endif
529 %endif
530
531 %if %{without systemd}
532 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
533 %endif
534 %endif
535 %if %{with gss_keyring}
536 echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
537 %endif
538
539 # fc18 needs 'x' permission for library files
540 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
541
542 rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la
543 %if %{with static}
544 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
545 %endif
546 %if %{with shared}
547 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
548 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files
549 %endif
550
551 %if %{with ldiskfs}
552 echo '%{_libdir}/libiam.a' >>lustre.files
553 %endif
554
555 %if %{with snmp}
556 mkdir -p $RPM_BUILD_ROOT/%{_libdir}/lustre/snmp
557 echo '%{_libdir}/lustre/snmp' >>lustre.files
558 %endif
559
560 %if %{with lustre_utils}
561 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre
562 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre ] ; then
563         find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \;
564 fi
565 %endif
566
567 %if %{with lustre_modules}
568 # mark modules executable for find-debuginfo.sh
569 find $RPM_BUILD_ROOT/lib/modules -name \*.ko -type f -exec chmod u+x {} \;
570 %endif
571
572 rm -f $RPM_BUILD_ROOT%{_libdir}/liblustreapi.la
573
574 %if %{with lustre_tests}
575 :> lustre-tests.files
576 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
577 echo '%{_bindir}/mcreate' >>lustre-tests.files
578 echo '%{_bindir}/munlink' >>lustre-tests.files
579 echo '%{_bindir}/statx' >>lustre-tests.files
580 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
581 echo '%{_sbindir}/wiretest' >>lustre-tests.files
582 if [ -n "$MPI_BIN" ]; then
583         echo "$MPI_BIN/*" >>lustre-tests.files
584 fi
585 %endif
586
587 %files -f lustre.files
588 %defattr(-,root,root)
589 %{_sbindir}/*
590 %if %{with lustre_tests}
591 %exclude %{_sbindir}/wirecheck
592 %exclude %{_sbindir}/wiretest
593 %endif
594 %if %{with zfs}
595 %exclude %{_sbindir}/zfsobj2fid
596 %endif
597 %if %{with lustre_utils}
598 %if %{with servers}
599 %{_libexecdir}/lustre/lc_common
600 %{_libexecdir}/lustre/haconfig
601 %{_bindir}/lustre_req_history
602 %endif
603
604 %{_bindir}/llobdstat
605 %{_bindir}/llstat
606 %{_bindir}/plot-llstat
607 %{_datadir}/lustre
608
609 %{_bindir}/lfs
610 %{_bindir}/lfs_migrate
611 /sbin/mount.lustre
612 /sbin/mount.lustre_tgt
613 @BASH_COMPLETION_DIR@
614 %endif
615
616 %if %{with manpages}
617 %{_mandir}/man?/*
618 %endif
619
620 %if %{with static}
621 %{_libdir}/liblustreapi.a
622 %endif
623 %if %{with shared}
624 %{_libdir}/liblustreapi.so*
625 %endif
626 %{_includedir}/lustre
627 %{_includedir}/linux/lnet
628 %{_includedir}/linux/lustre
629 %{_sysconfdir}/udev/rules.d/99-lustre.rules
630 %if %{with servers}
631 %{_sysconfdir}/udev/rules.d/99-lustre-server.rules
632 %endif
633 %if %{with zfs}
634 %config(noreplace) %{_sysconfdir}/ldev.conf
635 %endif
636 %config(noreplace) %{_sysconfdir}/lnet.conf
637 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
638 %if %{with lustre_utils}
639 %config(noreplace) %{_sysconfdir}/lnet_routes.conf
640 %endif
641 %if %{with lustre_modules}
642
643 %if %{with shared}
644 %if %{with ldiskfs}
645 %if %{with lustre_utils}
646 %files osd-ldiskfs-mount
647 %defattr(-,root,root)
648 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
649 %endif
650 %endif
651 %endif
652
653 %if %{with shared}
654 %if %{with zfs}
655 %if %{with lustre_utils}
656 %files osd-zfs-mount
657 %defattr(-,root,root)
658 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
659 %{_sysconfdir}/zfs/zed.d/*
660 %endif
661 %endif
662 %endif
663
664 %endif # with lustre_modules
665
666 %if %{with servers}
667 %files resource-agents
668 %defattr(0755,root,root)
669 %{_prefix}/lib/ocf/resource.d/lustre/
670 %endif
671
672 %if %{with lustre_tests}
673 %files tests -f lustre-tests.files
674 %defattr(-,root,root)
675 %endif
676
677 %if %{with lustre_iokit}
678 %files -n lustre-iokit
679 %defattr(-, root, root)
680 %{_bindir}/iokit-config
681 %{_bindir}/iokit-gather-stats
682 %{_bindir}/iokit-libecho
683 %{_bindir}/iokit-lstats
684 %{_bindir}/iokit-parse-ior
685 %{_bindir}/iokit-plot-obdfilter
686 %{_bindir}/iokit-plot-ost
687 %{_bindir}/iokit-plot-sgpdd
688 %{_bindir}/ior-survey
689 %{_bindir}/mds-survey
690 %{_bindir}/obdfilter-survey
691 %{_bindir}/ost-survey
692 %{_bindir}/sgpdd-survey
693 %doc lustre-iokit/ior-survey/README.ior-survey
694 %doc lustre-iokit/mds-survey/README.mds-survey
695 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
696 %doc lustre-iokit/ost-survey/README.ost-survey
697 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
698 %doc lustre-iokit/stats-collect/README.iokit-lstats
699 %endif
700
701 %post
702 %if %{with systemd}
703 %systemd_post lnet.service
704 %endif
705
706 %preun
707 %if %{with systemd}
708 %systemd_preun lnet.service
709 %endif
710
711 %postun
712 %if %{with systemd}
713 %systemd_postun_with_restart lnet.service
714 %endif
715
716 %clean
717 rm -rf $RPM_BUILD_ROOT
718 rm -rf %{_tmppath}/kmp