3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_utils
9 %bcond_without lustre_iokit
10 %bcond_without lustre_modules
13 %bcond_with gss_keyring
14 %bcond_without manpages
21 %bcond_without l_getsepol
23 # LUTF Turn off brp-python-precompile script as we don't want the python files
24 # to be compiled on installation
25 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
27 # By default both gss and gss keyring are disabled.
28 # gss keyring requires the gss core. If the builder
29 # request gss_keyring we must enable gss core even if
30 # the builder attempts to disable gss.
31 %if %{with gss_keyring}
35 %if %{without servers}
36 # --without servers overrides --with {ldiskfs|zfs}
37 # so undefine the internal variables set by bcond_*
38 %undefine with_ldiskfs
42 %if %{without shared} && %{without static}
43 # need exit to stop build because error only displays a message
44 %{error: you can't disable both library types}
48 # lustre_tests depends on lustre_utils
49 %if %{without lustre_utils}
50 %undefine with_lustre_tests
53 %{!?version: %global version @VERSION@}
54 # if you want a custom kernel version set it variable with $ver.$arch
55 %{!?kver: %global kver @LINUXRELEASE@}
56 # cut epoch for kmodtool
57 %define _kver %(echo %{kver} | sed -e 's/^[0-9]*://')
58 # trust version from kdir - but it can lost 'epoch'
62 %if %{defined kobjdir}
65 %{!?kdir: %global kdir /lib/modules/%{_kver}/source}
66 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{_kver}/source" ]; then echo "/lib/modules/%{_kver}/build"; else echo "%{kdir}"; fi)}
68 %if 0%{?suse_version} >= 1310 && %{defined _take_kobj}
69 %global _flavor %(echo %{_kver} | sed -e 's/^.*-//')
71 %global _flavor default
74 %if %{defined _take_kver}
75 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
76 %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)
80 # We set this because kernel_module_package has its own method of identifying
81 # which kernel to build against, and it is unlikely that its decision will
82 # match with Lustre's method of selecting which kernel to build against.
83 # By setting this variable, we override kernel_module_package's kernel
84 # selection with our selection.
85 # kmodtool failed to take a version if epoch set
86 %global kernel_version %_kver
88 # in order to get kernel symset and/or kernel module dependencies into
89 # the RPM, in order to support weak-modules, the internal dependency gen-
90 # erator needs to be disabled
91 # this is done with (reduce the double % down to a single %):
93 # %%global _use_internal_dependency_generator 0
95 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
96 # defining it here (until Suse changes their mind)
98 # on RHEL5, however, we do need to explicitly disable the internal dep-
99 # endency generator and allow the external one be used
100 # but since RedHat's kABI is only a subset of the total kernel ABI, it
101 # doesn't include all of the symbols we (or OFED for that matter) need
102 # until RedHat includes all of the symbols we need in their symsets we
103 # cannot support weak-modules
104 # we did e-mail the maintainer of all of this stuff @redhat but got no
106 #%%global _use_internal_dependency_generator 0
108 %if 0%{?rhel} > 7 || 0%{?fedora} > 33
109 ## SUSE uses another tool for provides:
110 ## https://github.com/openSUSE/kernel-source/blob/master/patches.rpmify/Add-ksym-provides-tool.patch
111 %global __find_provides %{_sourcedir}/find-provides
114 # Set the package name prefix
115 %if %{undefined lustre_name}
117 %global lustre_name lustre
119 %global lustre_name lustre-client
123 %if %{with lustre_modules}
124 %if %{undefined kmoddir}
125 %if %{defined kernel_module_package_moddir}
126 %global kmoddir %{kernel_module_package_moddir}
128 %if %{defined suse_kernel_module_package}
129 %global kmoddir updates
131 %global kmoddir extra
136 %global modules_fs_path /lib/modules/%{_kver}/%{kmoddir}
137 # requires want to set a version including epoch
138 %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$//' -e 's/-%{_flavor}//')
140 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora"
141 %global requires_kmod_name kmod-%{lustre_name}
142 %global requires_kmod_osd_zfs_name kmod-%{lustre_name}-osd-zfs
143 %if %{with lustre_tests}
144 %global requires_kmod_tests_name kmod-%{lustre_name}-tests
146 %global requires_kmod_version %{version}
149 %global requires_kmod_name %{lustre_name}-kmp
150 %global requires_kmod_osd_zfs_name %{lustre_name}-osd-zfs-kmp
151 %if %{with lustre_tests}
152 %global requires_kmod_tests_name %{lustre_name}-tests-kmp
154 %if 0%{?suse_version} >= 1200
155 %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
157 %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
162 # RHEL >= 7 comes with systemd
164 %define with_systemd 1
167 # Fedora >= 15 comes with systemd, but only >= 18 has
169 %if 0%{?fedora} >= 18
170 %define with_systemd 1
173 # opensuse >= 12.1 comes with systemd, but only >= 13.1
174 # has the proper macros
175 %if 0%{?suse_version} >= 1310
176 %define with_systemd 1
179 %{!?mpi_name: %global mpi_name openmpi}
181 Summary: Lustre File System
186 Group: System Environment/Kernel
187 Source: lustre-%{version}.tar.gz
188 Source1: kmp-lustre.preamble
189 Source2: kmp-lustre.files
190 Source3: kmp-lustre-osd-ldiskfs.preamble
191 Source4: kmp-lustre-osd-ldiskfs.files
192 Source5: kmp-lustre-osd-zfs.preamble
193 Source6: kmp-lustre-osd-zfs.files
194 Source7: kmp-lustre-tests.files
195 Source8: find-provides
196 Source9: find-provides.ksyms
197 URL: https://wiki.whamcloud.com/
198 BuildRoot: %{_tmppath}/lustre-%{version}-root
199 %if %{with lustre_modules}
200 Requires: %{requires_kmod_name} = %{requires_kmod_version}
202 %if %{with lustre_tests_lutf}
203 Requires: python3 >= 3.6.0
204 BuildRequires: python3-devel >= 3.6.0, swig
206 BuildRequires: libtool libyaml-devel zlib-devel libnl3-devel flex bison
207 %if "%{_vendor}" == "redhat"
208 BuildRequires: redhat-rpm-config
209 BuildRequires: pkgconfig
211 BuildRequires: pkg-config
214 BuildRequires: krb5-devel openssl-devel
218 Requires: lustre-osd-mount
219 Obsoletes: lustre-server < %{version}
220 Provides: lustre-server = %{version}-%{release}
222 Obsoletes: lustre-client < %{version}
223 Provides: lustre-client = %{version}-%{release}
224 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora"
225 #suse don't support selinux
226 BuildRequires: libselinux-devel
228 %if %{with l_getsepol}
229 BuildRequires: pkgconfig(libselinux) openssl-devel
231 %if %{with lustre_modules}
233 BuildRequires: mlnx-ofa_kernel-devel
234 %if "%{_vendor}" == "redhat"
235 Requires: kmod-mlnx-ofa_kernel
237 Requires: mlnx-ofa_kernel-kmp
241 BuildRequires: kernel-rpm-macros
243 BuildRequires: %kernel_module_package_buildreqs
244 # need to provide a /usr/lib/${uname -r)/build dir
245 BuildRequires: kernel
246 %if "%{_vendor}" == "redhat"
248 BuildRequires: kernel-abi-whitelists
254 Requires(post): systemd
255 Requires(preun): systemd
256 Requires(postun): systemd
257 BuildRequires: systemd
261 Userspace tools and files for the Lustre file system.
263 %if %{with lustre_modules}
265 # until we have achieved full kABI compatibility we need to
266 # restrict the kernel range that can be used to the kernel
267 # version from the RHEL minor release
268 # this is supposed to be done for kmods automatically but
269 # RHBZ#1467319 seems to be getting in the way
270 # this is true for el7.0 through el7.4
271 %define preamble %{expand:%(
273 cat %{SOURCE1} > $TMPFILE
274 kver=%{kernel_version}
275 linuxversion=${kver%%%%-*}
276 linuxrelease=${kver##*-}
277 kabiminor=${linuxrelease%%%%.*}
278 echo "Requires: kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
282 %define preamble %{SOURCE1}
284 %kernel_module_package -n %{name} -p %preamble -f %SOURCE2 %{_flavor}
287 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 %{_flavor}
288 %if %{with lustre_utils}
289 %package osd-ldiskfs-mount
290 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
291 BuildRequires: e2fsprogs-devel >= 1.44.3 libmount-devel
292 Requires: ldiskfsprogs >= 1.45.6.wc1 libmount
293 Provides: lustre-osd-mount = %{version}
294 Obsoletes: lustre-osd-mount < %{version}
295 Group: System Environment/Kernel
297 %description osd-ldiskfs-mount
298 LDISKFS hooks for mount/mkfs into a dynamic library.
306 %kernel_module_package -n %{name}-osd-zfs -p %SOURCE5 -f %SOURCE6 %{_flavor}
307 %if %{with lustre_utils}
308 %package osd-zfs-mount
309 Summary: osd-zfs-mount contains mount's zfs specific dso.
310 BuildRequires: libmount-devel
312 Provides: lustre-osd-mount = %{version}
313 Obsoletes: lustre-osd-mount < %{version}
314 # Tests also require zpool from zfs package:
316 Requires: %{requires_kmod_osd_zfs_name}
317 Group: System Environment/Kernel
319 %description osd-zfs-mount
320 ZFS hooks for mount/mkfs into a dynamic library.
326 # with lustre_modules
330 %package resource-agents
331 Summary: HA Resuable Cluster Resource Scripts for Lustre
332 Group: System Environment/Base
334 Requires: resource-agents
336 %description resource-agents
337 A set of scripts to operate Lustre resources in a High Availablity
338 environment for both Pacemaker and rgmanager.
342 Summary: Lustre include headers
343 Group: Development/Kernel
344 Provides: lustre-devel = %{version}
345 Requires: %{lustre_name} = %{version}
346 %if %{with lustre_modules}
347 Requires: %{requires_kmod_name} = %{requires_kmod_version}
351 This package contains the header files needed for building additional
352 applications against the Lustre / LNet utilities libraries.
354 :> lustre-devel.files
356 %if %{with lustre_tests}
358 Summary: Lustre testing framework
359 Group: System Environment/Kernel
360 Provides: lustre-tests = %{version}
361 %if %{with lustre_iokit}
362 Requires: lustre-iokit
364 Requires: lustre-devel = %{version}
365 %if 0%{?rhel} >= 8 || 0%{?suse_version} >= 1500
366 Requires: python3 >= 3.6.0, python3-PyYAML
368 %if %{with lustre_modules}
369 Requires: %{requires_kmod_name} = %{requires_kmod_version}
370 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
372 %if %{with lustre_tests_lutf}
373 Requires: python3 >= 3.6.0
375 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
377 %if "%{mpi_name}" == "mpich"
378 BuildRequires: mpich-devel
380 %if "%{mpi_name}" == "openmpi"
381 %if "%{_vendor}" == "redhat" || 0%{?suse_version} < 1500
382 BuildRequires: openmpi-devel
384 BuildRequires: openmpi2-devel
392 This package contains a set of test binaries and scripts that are intended
393 to be used by the Lustre testing framework.
395 %if %{with lustre_modules}
396 %kernel_module_package -n %{name}-tests -f %SOURCE7 %{_flavor}
400 %if %{with lustre_iokit}
401 %package -n lustre-iokit
402 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
403 Group: Applications/System
404 Requires: python3, sg3_utils
406 %description -n lustre-iokit
407 This package includes five tools:
409 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
412 This survey can be run in 3 modes to test disk I/O including the filesystem,
413 network I/O, and disk I/O via the network. The script does sequential I/O
414 with varying numbers of threads and objects (files) by using lctl::test_brw
415 to drive the echo_client connected to local or remote obdfilter instances,
416 or remote obdecho instances.
419 This survey tests the client-to-disk performance of individual OSTs, and
420 ranks then for comparison.
423 This script will collect IO stats on a defined set of nodes.
426 A script to run the IOR benchmark. The latest version can be downloaded from
427 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
430 This survey tests the local metadata performance using the echo_client to drive
431 the MDD layer to perform operations. It is run with multiple threads (to
432 simulate MDT service threads) locally on the MDS node, and does not need Lustre
433 clients in order to run
436 %if 0%{?suse_version}
440 %setup -qn lustre-%{version}
441 ln lustre/ChangeLog ChangeLog-lustre
442 ln lnet/ChangeLog ChangeLog-lnet
445 # Set an explicit path to our Linux tree, if we can.
446 cd $RPM_BUILD_DIR/lustre-%{version}
448 # Store the CFLAGS and LDFLAGS that would normally be used in the UTILS_CFLAGS
449 # and UTILS_LDFLAGS environment variables so that we use can them when compiling
450 # the user-space code in lustre/utils and lnet/utils. As of RHEL 8.0, the
451 # __global_* variants are deprecated in favour of build_cflags, etc. If neither
452 # style is available (e.g. on SLES), then these just end up as empty strings.
453 export UTILS_CFLAGS="%{?build_cflags:%{build_cflags}}%{!?build_cflags:%{?__global_cflags:%{__global_cflags}}}"
454 export UTILS_LDFLAGS="%{?build_ldflags:%{build_ldflags}}%{!?build_ldflags:%{?__global_ldflags:%{__global_ldflags}}}"
456 # RHEL7 on PPC64 needs __SANE_USERSPACE_TYPES__ defined so that __s64 and __u64
457 # are presented to user-land as long long instead of long long. Without this it
458 # will fail the format check whenever such a variable is printed.
461 export UTILS_CFLAGS="${UTILS_CFLAGS} -D__SANE_USERSPACE_TYPES__=1"
465 # Disable any hardening or annotation since this doesn't make sense for
466 # kernel code, and reset "optflags" so that the vendor's overzealous flags don't
467 # create build failures.
468 %define optflags -g -O2 -Werror
469 %undefine _annotated_build
470 %undefine _hardened_build
472 CONFIGURE_ARGS="%{?configure_args}"
473 if [ -n "$CONFIGURE_ARGS" ]; then
474 # make sure %%kdir and %%kobjdir are not in the configure arguments
475 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
476 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
477 # remove --with-kmp-moddir from configure arguments,
478 # it will be set --with-kmp-moddir=%%kmoddir
479 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
480 # remove env variables from config cache built by initial configure,
481 # and create dedicated cache in temporary build directory
482 if [ -f "$CONFIG_CACHE_FILE" ]; then
483 TMP_CONFIG_CACHE="$(mktemp --tmpdir newconfig-XXXXXXXX.cache)"
484 sed -e "/ac_cv_env/d" \
485 -e "/am_cv_CC_dependencies_compiler_type/d" \
486 -e "/lb_cv_mpi_tests/d" \
487 "$CONFIG_CACHE_FILE" > $TMP_CONFIG_CACHE
488 CONFIGURE_ARGS="$CONFIGURE_ARGS --cache-file=$TMP_CONFIG_CACHE"
492 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
493 # string in it which we don't want word splitted by the shell
494 # also remove (build|host|target) options because they will be specified
495 # inside $CONFIGURE_ARGS
496 # kmod tools/scripts require "name" directory with kernel modules
499 %define _configure eval ./configure
500 %define eval_configure %configure
502 %define eval_configure %(echo -n '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
506 %if "%{mpi_name}" == "mpich"
509 %if "%{mpi_name}" == "openmpi"
516 o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname)
517 if [ -z "$o2ib_path" ]; then
518 echo "ERROR: could not find OFED devel headers"
521 if [ $(echo $o2ib_path | wc -w) -ge 2 ]; then
522 echo "ERROR: multiple OFED versions installed"
527 %eval_configure $CONFIGURE_ARGS \
528 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
529 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
530 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
531 %{!?with_shared:--disable-shared} \
532 %{!?with_static:--disable-static} \
533 %{!?with_lustre_iokit:--disable-iokit} \
534 %{!?with_ldiskfs:--disable-ldiskfs} \
535 %{!?with_servers:--disable-server} \
536 %{!?with_zfs:--without-zfs} \
537 %{!?with_snmp:--disable-snmp} \
538 %{!?with_gss:--disable-gss} \
539 %{!?with_gss_keyring:--disable-gss-keyring} \
540 %{!?with_manpages:--disable-manpages} \
541 %{!?with_systemd:--with-systemdsystemunitdir=no} \
542 %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
543 %{?with_mofed:--with-o2ib=$o2ib_path} \
544 %{!?with_l_getsepol:--disable-l_getsepol} \
545 --with-linux=%{kdir} \
546 --with-linux-obj=%{kobjdir} \
547 --with-kmp-moddir=%{kmoddir}/%{name}
550 if ! grep -q define[[:space:]]*HAVE_SERVER_SUPPORT config.h 2> /dev/null; then
551 echo "Error: Server Support configured but not found"
556 make %{?_smp_mflags} -s %{?make_args}
559 %if "%{mpi_name}" == "mpich"
562 %if "%{mpi_name}" == "openmpi"
571 %if "%{mpi_name}" == "mpich"
574 %if "%{mpi_name}" == "openmpi"
580 make install DESTDIR=$RPM_BUILD_ROOT
582 %if %{with lustre_modules}
583 # RHEL's kernel_module_path macro expects that all the modules
584 # in a kmod package will be in modules_fs_path/<sub packagename>
585 # but Lustre installs all of the modules in a single pass into
586 # a shared location. Since this is a restriction imposed by
587 # RHEL, we handle this here in the spec file rather than in
588 # Lustre's build system. This is not expected to bother SLES's
589 # kernel_module_path macro.
590 basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{name}
591 %{__install} -D -m 0644 ${PWD}/Module.symvers %{buildroot}/Module.symvers
593 mkdir -p $basemodpath-osd-ldiskfs/fs
594 mv $basemodpath/fs/osd_ldiskfs.ko $basemodpath-osd-ldiskfs/fs/osd_ldiskfs.ko
595 mv $basemodpath/fs/ldiskfs.ko $basemodpath-osd-ldiskfs/fs/ldiskfs.ko
598 mkdir -p $basemodpath-osd-zfs/fs
599 mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
601 %if %{with lustre_tests}
602 mkdir -p $basemodpath-tests/fs
603 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
604 mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
605 mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
610 if [ -d $RPM_BUILD_ROOT%{_libdir}/openmpi ] ; then
611 rm -fr $RPM_BUILD_ROOT%{_libdir}/openmpi
613 if [ -d $RPM_BUILD_ROOT%{_libdir}/mpich ] ; then
614 rm -fr $RPM_BUILD_ROOT%{_libdir}/mpich
620 %if %{with servers} && %{with lustre_utils}
621 # The .ha_v2 extension identifies the heartbeat resource agent as using
622 # legacy syntax. Install a compatibility symlink to avoid conflicts when
623 # newer-style agents are added.
624 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
625 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
626 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
629 # systemd is on redhat, fedora, and suse
631 echo '%{_unitdir}/lnet.service' >>lustre.files
634 %if "%{_vendor}" == "redhat"
635 # The following scripts are Red Hat specific
637 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
638 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
639 %if %{with gss_keyring}
640 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
641 echo '%config(noreplace) %{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
645 %if %{without systemd}
646 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
649 %if %{with gss_keyring}
650 echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
653 # fc18 needs 'x' permission for library files
654 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
656 rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la
658 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
661 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre-devel.files
662 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files
666 echo '%{_libdir}/libiam.a' >>lustre.files
670 mkdir -p $RPM_BUILD_ROOT/%{_libdir}/lustre/snmp
671 echo '%{_libdir}/lustre/snmp' >>lustre.files
674 %if %{with lustre_utils}
675 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre
676 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre ] ; then
677 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \;
681 %if %{with lustre_modules}
682 # mark modules executable for find-debuginfo.sh
683 find $RPM_BUILD_ROOT/lib/modules -name \*.ko -type f -exec chmod u+x {} \;
686 rm -f $RPM_BUILD_ROOT%{_libdir}/liblustreapi.la
688 %if %{with lustre_tests}
689 :> lustre-tests.files
691 %if "%{mpi_name}" == "mpich"
694 %if "%{mpi_name}" == "openmpi"
699 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
700 echo '%{_bindir}/mcreate' >>lustre-tests.files
701 echo '%{_bindir}/munlink' >>lustre-tests.files
702 echo '%{_bindir}/statx' >>lustre-tests.files
703 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
704 echo '%{_sbindir}/wiretest' >>lustre-tests.files
705 if [ -n "$MPI_BIN" ]; then
706 echo "$MPI_BIN/*" >>lustre-tests.files
708 %if %{with lustre_tests_lutf}
709 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
713 %if %{with lustre_tests_lutf}
714 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
717 %files devel -f lustre-devel.files
718 %defattr(-,root,root)
719 %{_libdir}/pkgconfig/lustre.pc
721 %{_libdir}/liblustreapi.a
724 %{_libdir}/liblustreapi.so
726 %{_includedir}/lustre
727 %if %{with lustre_modules}
728 %{_includedir}/linux/lnet
729 %{_includedir}/linux/lustre
731 %exclude %{_includedir}/linux/lnet
732 %exclude %{_includedir}/linux/lustre
735 %files -f lustre.files
736 %defattr(-,root,root)
738 %if %{with lustre_tests}
739 %exclude %{_sbindir}/wirecheck
740 %exclude %{_sbindir}/wiretest
743 %exclude %{_sbindir}/zfsobj2fid
745 %if %{with lustre_utils}
747 %{_libexecdir}/lustre/lc_common
748 %{_libexecdir}/lustre/haconfig
749 %{_bindir}/lustre_req_history
754 %{_bindir}/plot-llstat
758 %{_bindir}/lfs_migrate
761 /sbin/mount.lustre_tgt
763 @BASH_COMPLETION_DIR@
771 %{_libdir}/liblustreapi.so.*
773 %{_sysconfdir}/udev/rules.d/99-lustre.rules
775 %{_sysconfdir}/udev/rules.d/99-lustre-server.rules
778 %config(noreplace) %{_sysconfdir}/ldev.conf
780 %config(noreplace) %{_sysconfdir}/lnet.conf
781 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
782 %if %{with lustre_utils}
783 %config(noreplace) %{_sysconfdir}/lnet_routes.conf
785 %if %{with lustre_modules}
786 %exclude /Module.symvers
789 %if %{with lustre_utils}
790 %files osd-ldiskfs-mount
791 %defattr(-,root,root)
792 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
799 %if %{with lustre_utils}
801 %defattr(-,root,root)
802 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
803 %{_sysconfdir}/zfs/zed.d/*
808 # with lustre_modules
812 %files resource-agents
813 %defattr(0755,root,root)
814 %{_prefix}/lib/ocf/resource.d/lustre/
817 %if %{with lustre_tests}
818 %files tests -f lustre-tests.files
819 %defattr(-,root,root)
822 %if %{with lustre_iokit}
823 %files -n lustre-iokit
824 %defattr(-, root, root)
825 %{_bindir}/iokit-config
826 %{_bindir}/iokit-gather-stats
828 %{_bindir}/iokit-libecho
829 %{_bindir}/iokit-lstats
830 %{_bindir}/iokit-parse-ior
831 %{_bindir}/iokit-plot-obdfilter
832 %{_bindir}/iokit-plot-ost
833 %{_bindir}/iokit-plot-sgpdd
834 %{_bindir}/ior-survey
835 %{_bindir}/mds-survey
836 %{_bindir}/obdfilter-survey
837 %{_bindir}/ost-survey
838 %{_bindir}/sgpdd-survey
839 %doc lustre-iokit/ior-survey/README.ior-survey
840 %doc lustre-iokit/mds-survey/README.mds-survey
841 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
842 %doc lustre-iokit/ost-survey/README.ost-survey
843 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
844 %doc lustre-iokit/stats-collect/README.iokit-lstats
849 %systemd_post lnet.service
854 %systemd_preun lnet.service
859 %systemd_postun_with_restart lnet.service
863 rm -rf $RPM_BUILD_ROOT
864 rm -rf %{_tmppath}/kmp