1 # SPDX-License-Identifier: GPL-2.0
4 # This file is part of Lustre, http://www.lustre.org/
8 # spec file template for RHEL package builds
11 # Declare rpmbuild --with/--without parameters
12 %bcond_without servers
13 %bcond_without ldiskfs
15 %bcond_without lustre_tests
16 %bcond_without lustre_utils
17 %bcond_without lustre_iokit
18 %bcond_without lustre_modules
20 %bcond_with gss_keyring
21 %bcond_without manpages
29 # LUTF Turn off brp-python-precompile script as we don't want the python files
30 # to be compiled on installation
31 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
33 # By default both gss and gss keyring are disabled.
34 # gss keyring requires the gss core. If the builder
35 # request gss_keyring we must enable gss core even if
36 # the builder attempts to disable gss.
37 %if %{with gss_keyring}
41 %if %{without servers}
42 # --without servers overrides --with {ldiskfs|zfs}
43 # so undefine the internal variables set by bcond_*
44 %undefine with_ldiskfs
48 %if %{without shared} && %{without static}
49 # need exit to stop build because error only displays a message
50 %{error: you can't disable both library types}
54 # lustre_tests depends on lustre_utils
55 %if %{without lustre_utils}
56 %undefine with_lustre_tests
59 %{!?version: %global version @VERSION@}
60 # if you want a custom kernel version set it variable with $ver.$arch
61 %{!?kver: %global kver %(uname -r)}
62 # cut epoch for kmodtool
63 %define _kver %(echo %{kver} | sed -e 's/^[0-9]*://')
64 # trust version from kdir - but it can lost 'epoch'
68 %if %{defined kobjdir}
71 %{!?kdir: %global kdir /lib/modules/%{_kver}/source}
72 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{_kver}/source" ]; then echo "/lib/modules/%{_kver}/build"; else echo "%{kdir}"; fi)}
74 %if 0%{?suse_version} >= 1310 && %{defined _take_kobj}
75 %global _flavor %(echo %{_kver} | sed -e 's/^.*-//')
77 %global _flavor default
80 %if %{defined _take_kver}
81 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
82 %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)
86 # We set this because kernel_module_package has its own method of identifying
87 # which kernel to build against, and it is unlikely that its decision will
88 # match with Lustre's method of selecting which kernel to build against.
89 # By setting this variable, we override kernel_module_package's kernel
90 # selection with our selection.
91 # kmodtool failed to take a version if epoch set
92 %global kernel_version %_kver
94 # in order to get kernel symset and/or kernel module dependencies into
95 # the RPM, in order to support weak-modules, the internal dependency gen-
96 # erator needs to be disabled
97 # this is done with (reduce the double % down to a single %):
99 # %%global _use_internal_dependency_generator 0
101 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
102 # defining it here (until Suse changes their mind)
104 # on RHEL5, however, we do need to explicitly disable the internal dep-
105 # endency generator and allow the external one be used
106 # but since RedHat's kABI is only a subset of the total kernel ABI, it
107 # doesn't include all of the symbols we (or OFED for that matter) need
108 # until RedHat includes all of the symbols we need in their symsets we
109 # cannot support weak-modules
110 # we did e-mail the maintainer of all of this stuff @redhat but got no
112 #%%global _use_internal_dependency_generator 0
114 %if 0%{?rhel} > 7 || 0%{?fedora} > 33
115 ## SUSE uses another tool for provides:
116 ## https://github.com/openSUSE/kernel-source/blob/master/patches.rpmify/Add-ksym-provides-tool.patch
117 %global __find_provides %{_sourcedir}/find-provides
120 # Set the package name prefix
121 %if %{undefined lustre_name}
123 %global lustre_name lustre
125 %global lustre_name lustre-client
129 %if %{with lustre_modules}
130 %if %{undefined kmoddir}
131 %if %{defined kernel_module_package_moddir}
132 %global kmoddir %{kernel_module_package_moddir}
134 %if %{defined suse_kernel_module_package}
135 %global kmoddir updates
137 %global kmoddir extra
142 %global modules_fs_path /lib/modules/%{_kver}/%{kmoddir}
143 # requires want to set a version including epoch
144 %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}//')
146 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora" || "%{_vendor}" == "openEuler"
147 %global requires_kmod_name kmod-%{lustre_name}
148 %global requires_kmod_osd_zfs_name kmod-%{lustre_name}-osd-zfs
149 %if %{with lustre_tests}
150 %global requires_kmod_tests_name kmod-%{lustre_name}-tests
152 %global requires_kmod_version %{version}
155 %global requires_kmod_name %{lustre_name}-kmp
156 %global requires_kmod_osd_zfs_name %{lustre_name}-osd-zfs-kmp
157 %if %{with lustre_tests}
158 %global requires_kmod_tests_name %{lustre_name}-tests-kmp
160 %if 0%{?suse_version} >= 1200
161 %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
163 %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
168 # RHEL >= 7 comes with systemd
170 %define with_systemd 1
173 # Fedora >= 15 comes with systemd, but only >= 18 has
175 %if 0%{?fedora} >= 18
176 %define with_systemd 1
179 # opensuse >= 12.1 comes with systemd, but only >= 13.1
180 # has the proper macros
181 %if 0%{?suse_version} >= 1310
182 %define with_systemd 1
185 # openEuler comes with systemd
186 %if "%{_vendor}" == "openEuler"
187 %define with_systemd 1
190 %{!?mpi_name: %global mpi_name openmpi}
192 Summary: Lustre File System
196 License: GPL-2.0-only AND LGPL-2.1-or-later
197 %if 0%{?suse_version} >= 1310
198 # SUSE needs Group for the kernel_module_package macro
201 Source: lustre-%{version}.tar.gz
202 Source1: kmp-lustre.preamble
203 Source2: kmp-lustre.files
204 Source3: kmp-lustre-osd-ldiskfs.preamble
205 Source4: kmp-lustre-osd-ldiskfs.files
206 Source5: kmp-lustre-osd-zfs.preamble
207 Source6: kmp-lustre-osd-zfs.files
208 Source7: kmp-lustre-tests.preamble
209 Source8: kmp-lustre-tests.files
210 Source9: find-provides
211 Source10: find-provides.ksyms
212 URL: https://wiki.whamcloud.com/
213 BuildRoot: %{_tmppath}/lustre-%{version}-root
214 %if %{with lustre_modules}
215 Requires: %{requires_kmod_name} = %{requires_kmod_version}
217 %if %{with lustre_tests_lutf}
218 Requires: python3 >= 3.6.0
219 BuildRequires: python3-devel >= 3.6.0, swig
221 BuildRequires: libtool pkgconfig(yaml-0.1) pkgconfig(zlib) pkgconfig(libnl-3.0) flex bison
222 %if "%{_vendor}" == "redhat"
223 BuildRequires: redhat-rpm-config
224 BuildRequires: pkgconfig
225 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
226 Suggests: bash-completion
229 %if "%{_vendor}" == "openEuler"
230 BuildRequires: openEuler-rpm-config
232 BuildRequires: kernel-debugsource
235 BuildRequires: pkg-config
238 BuildRequires: krb5-devel openssl-devel
240 %if %{with lustre_modules}
241 # abuild (auto-build) used by SUSE Open Build Service
242 # need kernel-source as a build requirement, but the code
243 # which extracts these requirements don't understand %()
244 # and treats all such as failures. So the following dance
245 # Allows the requirements to be seen by abuild, but ignored
247 %if "%(echo $USER)" != "abuild"
249 BuildRequires: kernel-source
253 Requires: %{name}-osd
254 Requires: %{name}-osd-mount
255 Obsoletes: lustre-server < %{version}
256 Provides: lustre-server = %{version}-%{release}
258 Obsoletes: lustre-client < %{version}
259 Provides: lustre-client = %{version}-%{release}
260 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora" || "%{_vendor}" == "openEuler"
261 #suse don't support selinux
262 BuildRequires: pkgconfig(libselinux)
264 %if %{with lustre_modules}
266 BuildRequires: mlnx-ofa_kernel-devel
267 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler"
268 Requires: kmod-mlnx-ofa_kernel
270 Requires: mlnx-ofa_kernel-kmp
273 %if 0%{?rhel} >= 8 || "%{_vendor}" == "openEuler"
274 BuildRequires: kernel-rpm-macros
276 %if 0%{?suse_version} >= 1530
277 BuildRequires: rpm-build >= 4.14.3
279 BuildRequires: %kernel_module_package_buildreqs
280 # need to provide a /usr/lib/${uname -r)/build dir
281 BuildRequires: kernel >= 3.10
282 %if "%{_vendor}" == "redhat"
284 BuildRequires: kernel-abi-whitelists
290 Requires(post): systemd
291 Requires(preun): systemd
292 Requires(postun): systemd
293 BuildRequires: pkgconfig(systemd)
297 Userspace tools and files for the Lustre file system.
299 %if %{with lustre_modules}
301 # until we have achieved full kABI compatibility we need to
302 # restrict the kernel range that can be used to the kernel
303 # version from the RHEL minor release
304 # this is supposed to be done for kmods automatically but
305 # RHBZ#1467319 seems to be getting in the way
306 # this is true for el7.0 through el7.4
307 %define preamble %{expand:%(
309 cat %{SOURCE1} > $TMPFILE
310 kver=%{kernel_version}
311 linuxversion=${kver%%%%-*}
312 linuxrelease=${kver##*-}
313 kabiminor=${linuxrelease%%%%.*}
314 echo "Requires: kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
318 %define preamble %{SOURCE1}
320 %kernel_module_package -n %{name} -p %preamble -f %SOURCE2 %{_flavor}
323 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 %{_flavor}
324 %if %{with lustre_utils}
325 %package osd-ldiskfs-mount
326 Summary: Lustre mount's ldiskfs-specific helper library
327 BuildRequires: e2fsprogs-devel >= 1.44.3 pkgconfig(mount)
328 Requires: ldiskfsprogs > 1.45.6
329 Provides: lustre-osd-mount = %{version}
330 Provides: %{name}-osd-mount = %{version}
331 Obsoletes: %{name}-osd-mount < %{version}
332 Obsoletes: lustre-osd-mount < %{version}
334 %description osd-ldiskfs-mount
335 Provide a shared library (dso) that can be loaded into various
336 lustre tools (mount/mkfs) to provide support for ldisfs
344 %kernel_module_package -n %{name}-osd-zfs -p %SOURCE5 -f %SOURCE6 %{_flavor}
345 %if %{with lustre_utils}
346 %package osd-zfs-mount
347 Summary: Lustre mount's zfs-specific helper library
348 BuildRequires: pkgconfig(mount)
349 Provides: %{name}-osd-mount = %{version}
350 Obsoletes: lustre-osd-mount < %{version}
351 # Tests also require zpool from zfs package:
353 Requires: %{requires_kmod_osd_zfs_name}
355 %description osd-zfs-mount
356 Provide a shared library (dso) that can be loaded into various
357 lustre tools (mount/mkfs) to provide support for ZFS.
363 # with lustre_modules
367 %package resource-agents
368 Summary: HA Resuable Cluster Resource Scripts for Lustre
370 Requires: resource-agents
372 %description resource-agents
373 A set of scripts to operate Lustre resources in a High Availablity
374 environment for both Pacemaker and rgmanager.
378 Summary: Lustre include headers
379 Provides: lustre-devel = %{version}
380 Requires: %{lustre_name} = %{version}
381 %if %{with lustre_modules}
382 Requires: %{requires_kmod_name} = %{requires_kmod_version}
386 This package contains the header files needed for building additional
387 applications against the Lustre / LNet utilities libraries.
389 :> lustre-devel.files
391 %if %{with lustre_tests}
393 Summary: Lustre testing framework
394 Provides: %{name}-tests = %{version}
395 %if %{with lustre_iokit}
396 Requires: %{name} = %{version}, lustre-iokit
398 Requires: %{name} = %{version}
400 Requires: lustre-devel = %{version}
401 %if 0%{?rhel} >= 8 || 0%{?suse_version} >= 1500
402 Requires: python3 >= 3.6.0, python3-PyYAML
404 %if %{with lustre_modules}
405 Requires: %{requires_kmod_name} = %{requires_kmod_version}
406 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
408 %if %{with lustre_tests_lutf}
409 Requires: python3 >= 3.6.0
411 Requires: attr, rsync, lsof, /usr/bin/getconf
412 Requires: /usr/sbin/getenforce, acl, /usr/bin/killall, /usr/bin/ping, bc
413 # Of the supported targets, only rhel7 doesn't support Recommends.
414 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
415 Recommends: perl, dbench, iozone
416 # Either of these is sufficient
417 Suggests: pdsh, clush
420 %if "%{mpi_name}" == "mpich"
421 BuildRequires: mpich-devel
423 %if "%{mpi_name}" == "openmpi"
424 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler" || 0%{?suse_version} < 1500
425 BuildRequires: openmpi-devel
427 BuildRequires: openmpi2-devel
435 This package contains a set of test binaries and scripts that are intended
436 to be used by the Lustre testing framework.
438 %if %{with lustre_modules}
439 %kernel_module_package -n %{name}-tests -p %SOURCE7 -f %SOURCE8 %{_flavor}
443 %if %{with lustre_iokit}
444 %package -n lustre-iokit
445 Summary: Collection of benchmark tools for a cluster with the Lustre file system
447 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
451 %description -n lustre-iokit
452 This package includes five tools:
454 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
457 This survey can be run in 3 modes to test disk I/O including the filesystem,
458 network I/O, and disk I/O via the network. The script does sequential I/O
459 with varying numbers of threads and objects (files) by using lctl::test_brw
460 to drive the echo_client connected to local or remote obdfilter instances,
461 or remote obdecho instances.
464 This survey tests the client-to-disk performance of individual OSTs, and
465 ranks then for comparison.
468 This script will collect IO stats on a defined set of nodes.
471 A script to run the IOR benchmark. The latest version can be downloaded from
472 https://github.com/hpc/ior/
475 This survey tests the local metadata performance using the echo_client to drive
476 the MDD layer to perform operations. It is run with multiple threads (to
477 simulate MDT service threads) locally on the MDS node, and does not need Lustre
478 clients in order to run
481 This survey tests LNet performance between a group of clients and servers.
484 %if 0%{?suse_version}
488 %setup -qn lustre-%{version}
489 ln lustre/ChangeLog ChangeLog-lustre
490 ln lnet/ChangeLog ChangeLog-lnet
493 # Set an explicit path to our Linux tree, if we can.
494 cd $RPM_BUILD_DIR/lustre-%{version}
496 # Store the CFLAGS and LDFLAGS that would normally be used in the UTILS_CFLAGS
497 # and UTILS_LDFLAGS environment variables so that we use can them when compiling
498 # the user-space code in lustre/utils and lnet/utils. As of RHEL 8.0, the
499 # __global_* variants are deprecated in favour of build_cflags, etc. If neither
500 # style is available (e.g. on SLES), then these just end up as empty strings.
501 export UTILS_CFLAGS="%{?build_cflags:%{build_cflags}}%{!?build_cflags:%{?__global_cflags:%{__global_cflags}}}"
502 export UTILS_LDFLAGS="%{?build_ldflags:%{build_ldflags}}%{!?build_ldflags:%{?__global_ldflags:%{__global_ldflags}}}"
504 # RHEL7 on PPC64 needs __SANE_USERSPACE_TYPES__ defined so that __s64 and __u64
505 # are presented to user-land as long long instead of long long. Without this it
506 # will fail the format check whenever such a variable is printed.
509 export UTILS_CFLAGS="${UTILS_CFLAGS} -D__SANE_USERSPACE_TYPES__=1"
513 # Disable any hardening or annotation since this doesn't make sense for
514 # kernel code, and reset "optflags" so that the vendor's overzealous flags don't
515 # create build failures.
516 %define optflags -g -O2 -Werror
517 %undefine _annotated_build
518 %undefine _hardened_build
520 CONFIGURE_ARGS="%{?configure_args}"
521 if [ -n "$CONFIGURE_ARGS" ]; then
522 # make sure %%kdir and %%kobjdir are not in the configure arguments
523 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
524 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
525 # remove --with-kmp-moddir from configure arguments,
526 # it will be set --with-kmp-moddir=%%kmoddir
527 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
528 # remove env variables from config cache built by initial configure,
529 # and create dedicated cache in temporary build directory
530 if [ -f "$CONFIG_CACHE_FILE" ]; then
531 TMP_CONFIG_CACHE="$(mktemp --tmpdir newconfig-XXXXXXXX.cache)"
532 sed -e "/ac_cv_env/d" \
533 -e "/am_cv_CC_dependencies_compiler_type/d" \
534 -e "/lb_cv_mpi_tests/d" \
535 "$CONFIG_CACHE_FILE" > $TMP_CONFIG_CACHE
536 CONFIGURE_ARGS="$CONFIGURE_ARGS --cache-file=$TMP_CONFIG_CACHE"
540 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
541 # string in it which we don't want word splitted by the shell
542 # also remove (build|host|target) options because they will be specified
543 # inside $CONFIGURE_ARGS
544 # kmod tools/scripts require "name" directory with kernel modules
547 %define _configure eval ./configure
548 %define eval_configure %configure
550 %define eval_configure %(echo -n '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
554 %if "%{mpi_name}" == "mpich"
557 %if "%{mpi_name}" == "openmpi"
564 o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname)
565 if [ -z "$o2ib_path" ]; then
566 echo "ERROR: could not find OFED devel headers"
569 if [ $(echo $o2ib_path | wc -w) -ge 2 ]; then
570 echo "ERROR: multiple OFED versions installed"
575 %eval_configure $CONFIGURE_ARGS \
576 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
577 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
578 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
579 %{!?with_shared:--disable-shared} \
580 %{!?with_static:--disable-static} \
581 %{!?with_lustre_iokit:--disable-iokit} \
582 %{!?with_ldiskfs:--disable-ldiskfs} \
583 %{!?with_servers:--disable-server} \
584 %{!?with_zfs:--without-zfs} \
585 %{!?with_gss:--disable-gss} \
586 %{!?with_gss_keyring:--disable-gss-keyring} \
587 %{!?with_manpages:--disable-manpages} \
588 %{!?with_systemd:--with-systemdsystemunitdir=no} \
589 %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
590 %{?with_mofed:--with-o2ib=$o2ib_path} \
591 --with-linux=%{kdir} \
592 --with-linux-obj=%{kobjdir} \
593 --with-kmp-moddir=%{kmoddir}/%{name}
596 if ! grep -q define[[:space:]]*HAVE_SERVER_SUPPORT config.h 2> /dev/null; then
597 echo "Error: Server Support configured but not found"
602 make %{?_smp_mflags} -s %{?make_args}
605 %if "%{mpi_name}" == "mpich"
608 %if "%{mpi_name}" == "openmpi"
617 %if "%{mpi_name}" == "mpich"
620 %if "%{mpi_name}" == "openmpi"
626 make install DESTDIR=$RPM_BUILD_ROOT
628 %if %{with lustre_modules}
629 # RHEL's kernel_module_path macro expects that all the modules
630 # in a kmod package will be in modules_fs_path/<sub packagename>
631 # but Lustre installs all of the modules in a single pass into
632 # a shared location. Since this is a restriction imposed by
633 # RHEL, we handle this here in the spec file rather than in
634 # Lustre's build system. This is not expected to bother SLES's
635 # kernel_module_path macro.
636 basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{name}
637 %{__install} -D -m 0644 ${PWD}/Module.symvers %{buildroot}/Module.symvers
639 mkdir -p $basemodpath-osd-ldiskfs/fs
640 mv $basemodpath/fs/osd_ldiskfs.ko $basemodpath-osd-ldiskfs/fs/osd_ldiskfs.ko
641 mv $basemodpath/fs/ldiskfs.ko $basemodpath-osd-ldiskfs/fs/ldiskfs.ko
644 mkdir -p $basemodpath-osd-zfs/fs
645 mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
647 %if %{with lustre_tests}
648 mkdir -p $basemodpath-tests/fs
649 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
650 mv $basemodpath/fs/obd_test.ko $basemodpath-tests/fs/obd_test.ko
651 mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
652 mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
657 if [ -d $RPM_BUILD_ROOT%{_libdir}/openmpi ] ; then
658 rm -fr $RPM_BUILD_ROOT%{_libdir}/openmpi
660 if [ -d $RPM_BUILD_ROOT%{_libdir}/mpich ] ; then
661 rm -fr $RPM_BUILD_ROOT%{_libdir}/mpich
667 %if %{with servers} && %{with lustre_utils}
668 # The .ha_v2 extension identifies the heartbeat resource agent as using
669 # legacy syntax. Install a compatibility symlink to avoid conflicts when
670 # newer-style agents are added.
671 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
672 echo '%dir %{_sysconfdir}/ha.d' >>lustre.files
673 echo '%dir %{_sysconfdir}/ha.d/resource.d' >>lustre.files
674 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
675 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
678 # systemd is on redhat, fedora, and suse
680 echo '%{_unitdir}/lnet.service' >>lustre.files
683 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler"
684 # The following scripts are Red Hat specific
686 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
687 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
688 %if %{with gss_keyring}
689 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
690 echo '%config(noreplace) %{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
694 %if %{without systemd}
695 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
698 %if %{with gss_keyring}
699 echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
702 # fc18 needs 'x' permission for library files
703 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
705 rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la
707 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
710 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre-devel.files
711 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files
715 echo '%{_libdir}/libiam.a' >>lustre.files
718 %if %{with lustre_utils}
719 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre
720 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre ] ; then
721 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \;
725 echo '%{_prefix}/lib/firewalld/services/*.xml' >>lustre.files
726 %if %{with lustre_modules}
727 # mark modules executable for find-debuginfo.sh
728 find $RPM_BUILD_ROOT/lib/modules -name \*.ko -type f -exec chmod u+x {} \;
731 rm -f $RPM_BUILD_ROOT%{_libdir}/liblustreapi.la
733 %if %{with lustre_tests}
734 :> lustre-tests.files
736 %if "%{mpi_name}" == "mpich"
739 %if "%{mpi_name}" == "openmpi"
744 echo '%dir %{_libdir}/lustre' >>lustre-tests.files
745 echo '%dir %{_libdir}/lustre/tests' >>lustre-tests.files
746 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
747 echo '%{_bindir}/mcreate' >>lustre-tests.files
748 echo '%{_bindir}/statx' >>lustre-tests.files
749 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
750 echo '%{_sbindir}/wiretest' >>lustre-tests.files
751 if [ -n "$MPI_BIN" ]; then
752 echo "$MPI_BIN/*" >>lustre-tests.files
754 %if %{with lustre_tests_lutf}
755 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
759 %if %{with lustre_tests_lutf}
760 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
763 %files devel -f lustre-devel.files
764 %defattr(-,root,root)
765 %{_libdir}/pkgconfig/lustre.pc
767 %{_libdir}/liblustreapi.a
770 %{_libdir}/liblustreapi.so
772 %{_includedir}/lustre
773 %if %{with lustre_modules}
774 %{_includedir}/linux/lnet
775 %{_includedir}/linux/lustre
777 %exclude %{_includedir}/linux/lnet
778 %exclude %{_includedir}/linux/lustre
781 %files -f lustre.files
782 %defattr(-,root,root)
784 %if %{with lustre_tests}
785 %exclude %{_sbindir}/wirecheck
786 %exclude %{_sbindir}/wiretest
789 %exclude %{_sbindir}/zfsobj2fid
791 %if %{with lustre_utils}
793 %dir %{_libexecdir}/lustre
794 %{_libexecdir}/lustre/lc_common
795 %{_libexecdir}/lustre/haconfig
796 %{_bindir}/lustre_req_history
797 %{_bindir}/remove_changelog
798 %{_bindir}/remove_updatelog
804 %{_bindir}/plot-llstat
808 %{_bindir}/lfs_migrate
811 /sbin/mount.lustre_tgt
813 @BASH_COMPLETION_DIR@
821 %{_libdir}/liblustreapi.so.*
823 %{_udevrulesdir}/99-lustre.rules
825 %{_udevrulesdir}/99-lustre-server.rules
828 %config(noreplace) %{_sysconfdir}/ldev.conf
830 %config(noreplace) %{_sysconfdir}/lnet.conf
831 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
832 %if %{with lustre_utils}
833 %config(noreplace) %{_sysconfdir}/lnet_routes.conf
835 %if %{with lustre_modules}
836 %exclude /Module.symvers
839 %if %{with lustre_utils}
840 %files osd-ldiskfs-mount
841 %defattr(-,root,root)
842 %dir %{_libdir}/@PACKAGE@
843 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
850 %if %{with lustre_utils}
852 %defattr(-,root,root)
853 %dir %{_libdir}/@PACKAGE@
854 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
855 %{_sysconfdir}/zfs/zed.d/*
860 # with lustre_modules
864 %files resource-agents
865 %defattr(0755,root,root)
866 %dir %{_prefix}/lib/ocf
867 %dir %{_prefix}/lib/ocf/resource.d
868 %{_prefix}/lib/ocf/resource.d/lustre/
871 %if %{with lustre_tests}
872 %files tests -f lustre-tests.files
873 %defattr(-,root,root)
876 %if %{with lustre_iokit}
877 %files -n lustre-iokit
878 %defattr(-, root, root)
879 %{_bindir}/iokit-config
880 %{_bindir}/iokit-gather-stats
882 %{_bindir}/iokit-libecho
883 %{_bindir}/iokit-lstats
884 %{_bindir}/iokit-parse-ior
885 %{_bindir}/iokit-plot-obdfilter
886 %{_bindir}/iokit-plot-ost
887 %{_bindir}/iokit-plot-sgpdd
888 %{_bindir}/ior-survey
889 %{_bindir}/mds-survey
890 %{_bindir}/obdfilter-survey
891 %{_bindir}/ost-survey
892 %{_bindir}/sgpdd-survey
893 %{_bindir}/lst-survey
895 %doc lustre-iokit/ior-survey/README.ior-survey
896 %doc lustre-iokit/mds-survey/README.mds-survey
897 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
898 %doc lustre-iokit/ost-survey/README.ost-survey
899 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
900 %doc lustre-iokit/stats-collect/README.iokit-lstats
901 %doc lustre-iokit/lst-survey/README.lst-survey
906 %systemd_post lnet.service
911 %systemd_preun lnet.service
916 %systemd_postun_with_restart lnet.service
920 rm -rf $RPM_BUILD_ROOT
921 rm -rf %{_tmppath}/kmp