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
27 %bcond_with multiple_lnds
33 %if %{with multiple_lnds}
34 %global enable_multi_lnds 1
37 # LUTF Turn off brp-python-precompile script as we don't want the python files
38 # to be compiled on installation
39 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
41 # By default both gss and gss keyring are disabled.
42 # gss keyring requires the gss core. If the builder
43 # request gss_keyring we must enable gss core even if
44 # the builder attempts to disable gss.
45 %if %{with gss_keyring}
49 %if %{without servers}
50 # --without servers overrides --with {ldiskfs|zfs}
51 # so undefine the internal variables set by bcond_*
52 %undefine with_ldiskfs
56 %if %{without shared} && %{without static}
57 # need exit to stop build because error only displays a message
58 %{error: you can't disable both library types}
62 # lustre_tests depends on lustre_utils
63 %if %{without lustre_utils}
64 %undefine with_lustre_tests
67 %{!?version: %global version @VERSION@}
68 # if you want a custom kernel version set it variable with $ver.$arch
69 %{!?kver: %global kver %(uname -r)}
70 # cut epoch for kmodtool
71 %define _kver %(echo %{kver} | sed -e 's/^[0-9]*://')
72 # trust version from kdir - but it can lost 'epoch'
76 %if %{defined kobjdir}
79 %{!?kdir: %global kdir /lib/modules/%{_kver}/source}
80 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{_kver}/source" ]; then echo "/lib/modules/%{_kver}/build"; else echo "%{kdir}"; fi)}
82 %if 0%{?suse_version} >= 1310 && %{defined _take_kobj}
83 %global _flavor %(echo %{_kver} | sed -e 's/^.*-//')
85 %global _flavor default
88 %if %{defined _take_kver}
89 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
90 %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)
94 # We set this because kernel_module_package has its own method of identifying
95 # which kernel to build against, and it is unlikely that its decision will
96 # match with Lustre's method of selecting which kernel to build against.
97 # By setting this variable, we override kernel_module_package's kernel
98 # selection with our selection.
99 # kmodtool failed to take a version if epoch set
100 %global kernel_version %_kver
102 # in order to get kernel symset and/or kernel module dependencies into
103 # the RPM, in order to support weak-modules, the internal dependency gen-
104 # erator needs to be disabled
105 # this is done with (reduce the double % down to a single %):
107 # %%global _use_internal_dependency_generator 0
109 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
110 # defining it here (until Suse changes their mind)
112 # on RHEL5, however, we do need to explicitly disable the internal dep-
113 # endency generator and allow the external one be used
114 # but since RedHat's kABI is only a subset of the total kernel ABI, it
115 # doesn't include all of the symbols we (or OFED for that matter) need
116 # until RedHat includes all of the symbols we need in their symsets we
117 # cannot support weak-modules
118 # we did e-mail the maintainer of all of this stuff @redhat but got no
120 #%%global _use_internal_dependency_generator 0
122 %if 0%{?rhel} > 7 || 0%{?fedora} > 33
123 ## SUSE uses another tool for provides:
124 ## https://github.com/openSUSE/kernel-source/blob/master/patches.rpmify/Add-ksym-provides-tool.patch
125 %global __find_provides %{_sourcedir}/find-provides
128 # Set the package name prefix
129 %if %{undefined lustre_name}
131 %global lustre_name lustre
133 %global lustre_name lustre-client
137 %if %{with lustre_modules}
138 %if %{undefined kmoddir}
139 %if %{defined kernel_module_package_moddir}
140 %global kmoddir %{kernel_module_package_moddir}
142 %if %{defined suse_kernel_module_package}
143 %global kmoddir updates
145 %global kmoddir extra
150 %global modules_fs_path /lib/modules/%{_kver}/%{kmoddir}
151 # requires want to set a version including epoch
152 %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}//')
154 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora" || "%{_vendor}" == "openEuler"
155 %global requires_kmod_name kmod-%{lustre_name}
156 %global requires_kmod_osd_zfs_name kmod-%{lustre_name}-osd-zfs
157 %if %{with lustre_tests}
158 %global requires_kmod_tests_name kmod-%{lustre_name}-tests
160 %global requires_kmod_version %{version}
163 %global requires_kmod_name %{lustre_name}-kmp
164 %global requires_kmod_osd_zfs_name %{lustre_name}-osd-zfs-kmp
165 %if %{with lustre_tests}
166 %global requires_kmod_tests_name %{lustre_name}-tests-kmp
168 %if 0%{?suse_version} >= 1200
169 %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
171 %global requires_kmod_version %{version}_%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
176 # RHEL >= 7 comes with systemd
178 %define with_systemd 1
181 # Fedora >= 15 comes with systemd, but only >= 18 has
183 %if 0%{?fedora} >= 18
184 %define with_systemd 1
187 # opensuse >= 12.1 comes with systemd, but only >= 13.1
188 # has the proper macros
189 %if 0%{?suse_version} >= 1310
190 %define with_systemd 1
193 # openEuler comes with systemd
194 %if "%{_vendor}" == "openEuler"
195 %define with_systemd 1
198 %{!?mpi_name: %global mpi_name openmpi}
200 Summary: Lustre File System
204 License: GPL-2.0-only AND LGPL-2.1-or-later
205 %if 0%{?suse_version} >= 1310
206 # SUSE needs Group for the kernel_module_package macro
209 Source: lustre-%{version}.tar.gz
210 Source1: kmp-lustre.preamble
211 Source2: kmp-lustre.files
212 Source3: kmp-lustre-osd-ldiskfs.preamble
213 Source4: kmp-lustre-osd-ldiskfs.files
214 Source5: kmp-lustre-osd-zfs.preamble
215 Source6: kmp-lustre-osd-zfs.files
216 Source7: kmp-lustre-tests.preamble
217 Source8: kmp-lustre-tests.files
218 Source9: find-provides
219 Source10: find-provides.ksyms
220 Source11: kmp-lnet-socklnd.preamble
221 Source12: kmp-lnet-socklnd.files
222 Source13: kmp-lnet-o2iblnd.preamble
223 Source14: kmp-lnet-o2iblnd.files
224 Source15: kmp-lnet-gnilnd.preamble
225 Source16: kmp-lnet-gnilnd.files
226 Source17: kmp-lnet-kfilnd.preamble
227 Source18: kmp-lnet-kfilnd.files
228 Source19: kmp-lnet-in-kernel-o2iblnd.preamble
229 Source20: kmp-lnet-in-kernel-o2iblnd.files
230 URL: https://wiki.whamcloud.com/
231 BuildRoot: %{_tmppath}/lustre-%{version}-root
232 %if %{with lustre_modules}
233 Requires: %{requires_kmod_name} = %{requires_kmod_version}
235 %if %{with lustre_tests_lutf}
236 Requires: python3 >= 3.6.0
237 BuildRequires: python3-devel >= 3.6.0, swig
239 BuildRequires: libtool pkgconfig(yaml-0.1) pkgconfig(zlib) pkgconfig(libnl-3.0) flex bison
240 %if "%{_vendor}" == "redhat"
241 BuildRequires: redhat-rpm-config
242 BuildRequires: pkgconfig
243 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
244 Suggests: bash-completion
247 %if "%{_vendor}" == "openEuler"
248 BuildRequires: openEuler-rpm-config
250 BuildRequires: kernel-debugsource
253 BuildRequires: pkg-config
256 BuildRequires: krb5-devel openssl-devel
258 %if %{with lustre_modules}
259 # abuild (auto-build) used by SUSE Open Build Service
260 # need kernel-source as a build requirement, but the code
261 # which extracts these requirements don't understand %()
262 # and treats all such as failures. So the following dance
263 # Allows the requirements to be seen by abuild, but ignored
265 %if "%(echo $USER)" != "abuild"
267 BuildRequires: kernel-source
271 Requires: %{name}-osd
272 Requires: %{name}-osd-mount
273 Obsoletes: lustre-server < %{version}
274 Provides: lustre-server = %{version}-%{release}
276 Obsoletes: lustre-client < %{version}
277 Provides: lustre-client = %{version}-%{release}
278 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "fedora" || "%{_vendor}" == "openEuler"
279 #suse don't support selinux
280 BuildRequires: pkgconfig(libselinux)
282 %if %{with lustre_modules}
284 BuildRequires: mlnx-ofa_kernel-devel
285 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler"
286 Requires: kmod-mlnx-ofa_kernel
288 Requires: mlnx-ofa_kernel-kmp
291 %if 0%{?rhel} >= 8 || "%{_vendor}" == "openEuler"
292 BuildRequires: kernel-rpm-macros
294 %if 0%{?suse_version} >= 1530
295 BuildRequires: rpm-build >= 4.14.3
297 BuildRequires: %kernel_module_package_buildreqs
298 # need to provide a /usr/lib/${uname -r)/build dir
299 BuildRequires: kernel >= 3.10
300 %if "%{_vendor}" == "redhat"
302 BuildRequires: kernel-abi-whitelists
308 Requires(post): systemd
309 Requires(preun): systemd
310 Requires(postun): systemd
311 BuildRequires: pkgconfig(systemd)
315 Userspace tools and files for the Lustre file system.
317 %if %{with lustre_modules}
319 # until we have achieved full kABI compatibility we need to
320 # restrict the kernel range that can be used to the kernel
321 # version from the RHEL minor release
322 # this is supposed to be done for kmods automatically but
323 # RHBZ#1467319 seems to be getting in the way
324 # this is true for el7.0 through el7.4
325 %define preamble %{expand:%(
327 cat %{SOURCE1} > $TMPFILE
328 kver=%{kernel_version}
329 linuxversion=${kver%%%%-*}
330 linuxrelease=${kver##*-}
331 kabiminor=${linuxrelease%%%%.*}
332 echo "Requires: kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
336 %define preamble %{SOURCE1}
338 %kernel_module_package -n %{name} -p %preamble -f %SOURCE2 %{_flavor}
341 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 %{_flavor}
342 %if %{with lustre_utils}
343 %package osd-ldiskfs-mount
344 Summary: Lustre mount's ldiskfs-specific helper library
345 BuildRequires: e2fsprogs-devel >= 1.44.3 pkgconfig(mount)
346 Requires: ldiskfsprogs > 1.45.6
347 Provides: lustre-osd-mount = %{version}
348 Provides: %{name}-osd-mount = %{version}
349 Obsoletes: %{name}-osd-mount < %{version}
350 Obsoletes: lustre-osd-mount < %{version}
352 %description osd-ldiskfs-mount
353 Provide a shared library (dso) that can be loaded into various
354 lustre tools (mount/mkfs) to provide support for ldisfs
362 %kernel_module_package -n %{name}-osd-zfs -p %SOURCE5 -f %SOURCE6 %{_flavor}
363 %if %{with lustre_utils}
364 %package osd-zfs-mount
365 Summary: Lustre mount's zfs-specific helper library
366 BuildRequires: pkgconfig(mount)
367 Provides: %{name}-osd-mount = %{version}
368 Obsoletes: lustre-osd-mount < %{version}
369 # Tests also require zpool from zfs package:
371 Requires: %{requires_kmod_osd_zfs_name}
373 %description osd-zfs-mount
374 Provide a shared library (dso) that can be loaded into various
375 lustre tools (mount/mkfs) to provide support for ZFS.
381 # with lustre_modules
385 %package resource-agents
386 Summary: HA Resuable Cluster Resource Scripts for Lustre
388 Requires: resource-agents
390 %description resource-agents
391 A set of scripts to operate Lustre resources in a High Availablity
392 environment for both Pacemaker and rgmanager.
396 Summary: Lustre include headers
397 Provides: lustre-devel = %{version}
398 Requires: %{lustre_name} = %{version}
399 %if %{with lustre_modules}
400 Requires: %{requires_kmod_name} = %{requires_kmod_version}
404 This package contains the header files needed for building additional
405 applications against the Lustre / LNet utilities libraries.
407 :> lustre-devel.files
409 %if %{with lustre_tests}
411 Summary: Lustre testing framework
412 Provides: %{name}-tests = %{version}
413 %if %{with lustre_iokit}
414 Requires: %{name} = %{version}, lustre-iokit
416 Requires: %{name} = %{version}
418 Requires: lustre-devel = %{version}
419 %if 0%{?rhel} >= 8 || 0%{?suse_version} >= 1500
420 Requires: python3 >= 3.6.0, python3-PyYAML
422 %if %{with lustre_modules}
423 Requires: %{requires_kmod_name} = %{requires_kmod_version}
424 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
426 %if %{with lustre_tests_lutf}
427 Requires: python3 >= 3.6.0
429 Requires: attr, rsync, lsof, /usr/bin/getconf
430 Requires: /usr/sbin/getenforce, acl, /usr/bin/killall, /usr/bin/ping, bc
431 # Of the supported targets, only rhel7 doesn't support Recommends.
432 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
433 Recommends: perl, dbench, iozone
434 # Either of these is sufficient
435 Suggests: pdsh, clush
438 %if "%{mpi_name}" == "mpich"
439 BuildRequires: mpich-devel
441 %if "%{mpi_name}" == "openmpi"
442 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler" || 0%{?suse_version} < 1500
443 BuildRequires: openmpi-devel
445 BuildRequires: openmpi2-devel
453 This package contains a set of test binaries and scripts that are intended
454 to be used by the Lustre testing framework.
456 %if %{with lustre_modules}
457 %kernel_module_package -n %{name}-tests -p %SOURCE7 -f %SOURCE8 %{_flavor}
461 %if %{with multiple_lnds}
462 # begin multiple_lnds
463 %kernel_module_package -n %{name}-lnet-socklnd -p %SOURCE11 -f %SOURCE12 %{_flavor}
465 ## re-write post/preun generated by kmodtool [ls -s and rm -f]
466 %define inkernmod %{modules_fs_path}/%{lustre_name}/net/in-kernel-ko2iblnd.ko
467 %define inkernsym %{modules_fs_path}/%{lustre_name}/net/ko2iblnd.ko
468 %define ofed_module_package %{expand:%(
471 %kernel_module_package -n %{name}-lnet-in-kernel-o2iblnd -p %SOURCE19 -f %SOURCE20 %{_flavor}
473 sed -i -e '/^%%post.*/a ln -sf %{inkernmod} %{inkernsym}' -e '/^%%preun.*/a rm -f %{inkernsym}' $TMPFILE
476 %{expand:%(cat '%{ofed_module_package}')}
479 %kernel_module_package -n %{name}-lnet-o2iblnd -p %SOURCE13 -f %SOURCE14 %{_flavor}
482 %kernel_module_package -n %{name}-lnet-gnilnd -p %SOURCE15 -f %SOURCE16 %{_flavor}
485 %kernel_module_package -n %{name}-lnet-kfilnd -p %SOURCE17 -f %SOURCE18 %{_flavor}
490 %if %{with lustre_iokit}
491 %package -n lustre-iokit
492 Summary: Collection of benchmark tools for a cluster with the Lustre file system
494 %if 0%{?rhel} > 7 || 0%{?fedora} > 33 || 0%{?rhel} < 1
498 %description -n lustre-iokit
499 This package includes five tools:
501 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
504 This survey can be run in 3 modes to test disk I/O including the filesystem,
505 network I/O, and disk I/O via the network. The script does sequential I/O
506 with varying numbers of threads and objects (files) by using lctl::test_brw
507 to drive the echo_client connected to local or remote obdfilter instances,
508 or remote obdecho instances.
511 This survey tests the client-to-disk performance of individual OSTs, and
512 ranks then for comparison.
515 This script will collect IO stats on a defined set of nodes.
518 A script to run the IOR benchmark. The latest version can be downloaded from
519 https://github.com/hpc/ior/
522 This survey tests the local metadata performance using the echo_client to drive
523 the MDD layer to perform operations. It is run with multiple threads (to
524 simulate MDT service threads) locally on the MDS node, and does not need Lustre
525 clients in order to run
528 This survey tests LNet performance between a group of clients and servers.
531 %if 0%{?suse_version}
535 %setup -qn lustre-%{version}
536 ln lustre/ChangeLog ChangeLog-lustre
537 ln lnet/ChangeLog ChangeLog-lnet
540 # Set an explicit path to our Linux tree, if we can.
541 cd $RPM_BUILD_DIR/lustre-%{version}
543 # Store the CFLAGS and LDFLAGS that would normally be used in the UTILS_CFLAGS
544 # and UTILS_LDFLAGS environment variables so that we use can them when compiling
545 # the user-space code in lustre/utils and lnet/utils. As of RHEL 8.0, the
546 # __global_* variants are deprecated in favour of build_cflags, etc. If neither
547 # style is available (e.g. on SLES), then these just end up as empty strings.
548 export UTILS_CFLAGS="%{?build_cflags:%{build_cflags}}%{!?build_cflags:%{?__global_cflags:%{__global_cflags}}}"
549 export UTILS_LDFLAGS="%{?build_ldflags:%{build_ldflags}}%{!?build_ldflags:%{?__global_ldflags:%{__global_ldflags}}}"
551 # RHEL7 on PPC64 needs __SANE_USERSPACE_TYPES__ defined so that __s64 and __u64
552 # are presented to user-land as long long instead of long long. Without this it
553 # will fail the format check whenever such a variable is printed.
556 export UTILS_CFLAGS="${UTILS_CFLAGS} -D__SANE_USERSPACE_TYPES__=1"
560 # Disable any hardening or annotation since this doesn't make sense for
561 # kernel code, and reset "optflags" so that the vendor's overzealous flags don't
562 # create build failures.
563 %define optflags -g -O2 -Werror
564 %undefine _annotated_build
565 %undefine _hardened_build
567 CONFIGURE_ARGS="%{?configure_args}"
568 if [ -n "$CONFIGURE_ARGS" ]; then
569 # make sure %%kdir and %%kobjdir are not in the configure arguments
570 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
571 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
572 # remove --with-kmp-moddir from configure arguments,
573 # it will be set --with-kmp-moddir=%%kmoddir
574 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
575 # remove env variables from config cache built by initial configure,
576 # and create dedicated cache in temporary build directory
577 if [ -f "$CONFIG_CACHE_FILE" ]; then
578 TMP_CONFIG_CACHE="$(mktemp --tmpdir newconfig-XXXXXXXX.cache)"
579 sed -e "/ac_cv_env/d" \
580 -e "/am_cv_CC_dependencies_compiler_type/d" \
581 -e "/lb_cv_mpi_tests/d" \
582 "$CONFIG_CACHE_FILE" > $TMP_CONFIG_CACHE
583 CONFIGURE_ARGS="$CONFIGURE_ARGS --cache-file=$TMP_CONFIG_CACHE"
587 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
588 # string in it which we don't want word splitted by the shell
589 # also remove (build|host|target) options because they will be specified
590 # inside $CONFIGURE_ARGS
591 # kmod tools/scripts require "name" directory with kernel modules
594 %define _configure eval ./configure
595 %define eval_configure %configure
597 %define eval_configure %(echo -n '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
601 %if "%{mpi_name}" == "mpich"
604 %if "%{mpi_name}" == "openmpi"
612 o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname)
613 if [ -z "$o2ib_path" ]; then
614 echo "ERROR: could not find OFED devel headers"
617 if [ $(echo $o2ib_path | wc -w) -ge 2 ]; then
618 echo "ERROR: multiple OFED versions installed"
621 WITH_O2IB="--with-o2ib=${o2ib_path}"
624 WITH_O2IB="--with-o2ib=no"
628 %eval_configure $CONFIGURE_ARGS \
629 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
630 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
631 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
632 %{!?with_shared:--disable-shared} \
633 %{!?with_static:--disable-static} \
634 %{!?with_lustre_iokit:--disable-iokit} \
635 %{!?with_ldiskfs:--disable-ldiskfs} \
636 %{!?with_servers:--disable-server} \
637 %{!?with_zfs:--without-zfs} \
638 %{!?with_gss:--disable-gss} \
639 %{!?with_gss_keyring:--disable-gss-keyring} \
640 %{!?with_manpages:--disable-manpages} \
641 %{!?with_systemd:--with-systemdsystemunitdir=no} \
642 %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
643 %{?with_multiple_lnds:--enable-multiple-lnds} \
644 %{?with_kfi:--with-kfi=/usr/src/cray-kfabric/default} \
645 %{?with_gni:--enable-gni} \
647 --with-linux=%{kdir} \
648 --with-linux-obj=%{kobjdir} \
649 --with-kmp-moddir=%{kmoddir}/%{name}
652 if ! grep -q define[[:space:]]*HAVE_SERVER_SUPPORT config.h 2> /dev/null; then
653 echo "Error: Server Support configured but not found"
658 make %{?_smp_mflags} -s %{?make_args}
661 %if "%{mpi_name}" == "mpich"
664 %if "%{mpi_name}" == "openmpi"
673 %if "%{mpi_name}" == "mpich"
676 %if "%{mpi_name}" == "openmpi"
682 make install DESTDIR=$RPM_BUILD_ROOT
684 %if %{with lustre_modules}
685 # RHEL's kernel_module_path macro expects that all the modules
686 # in a kmod package will be in modules_fs_path/<sub packagename>
687 # but Lustre installs all of the modules in a single pass into
688 # a shared location. Since this is a restriction imposed by
689 # RHEL, we handle this here in the spec file rather than in
690 # Lustre's build system. This is not expected to bother SLES's
691 # kernel_module_path macro.
692 basemodpath=$RPM_BUILD_ROOT%{modules_fs_path}/%{name}
693 %{__install} -D -m 0644 ${PWD}/Module.symvers %{buildroot}/Module.symvers
695 mkdir -p $basemodpath-osd-ldiskfs/fs
696 mv $basemodpath/fs/osd_ldiskfs.ko $basemodpath-osd-ldiskfs/fs/osd_ldiskfs.ko
697 mv $basemodpath/fs/ldiskfs.ko $basemodpath-osd-ldiskfs/fs/ldiskfs.ko
700 mkdir -p $basemodpath-osd-zfs/fs
701 mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
703 %if %{with lustre_tests}
704 mkdir -p $basemodpath-tests/fs
705 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
706 mv $basemodpath/fs/obd_test.ko $basemodpath-tests/fs/obd_test.ko
707 mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
708 mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
713 if [ -d $RPM_BUILD_ROOT%{_libdir}/openmpi ] ; then
714 rm -fr $RPM_BUILD_ROOT%{_libdir}/openmpi
716 if [ -d $RPM_BUILD_ROOT%{_libdir}/mpich ] ; then
717 rm -fr $RPM_BUILD_ROOT%{_libdir}/mpich
723 %if %{with servers} && %{with lustre_utils}
724 # The .ha_v2 extension identifies the heartbeat resource agent as using
725 # legacy syntax. Install a compatibility symlink to avoid conflicts when
726 # newer-style agents are added.
727 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
728 echo '%dir %{_sysconfdir}/ha.d' >>lustre.files
729 echo '%dir %{_sysconfdir}/ha.d/resource.d' >>lustre.files
730 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
731 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
734 # systemd is on redhat, fedora, and suse
736 echo '%{_unitdir}/lnet.service' >>lustre.files
739 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "openEuler"
740 # The following scripts are Red Hat specific
742 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
743 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
744 %if %{with gss_keyring}
745 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
746 echo '%config(noreplace) %{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
750 %if %{without systemd}
751 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
754 %if %{with gss_keyring}
755 echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
758 # fc18 needs 'x' permission for library files
759 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
761 rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la
763 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
766 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre-devel.files
767 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files
771 echo '%{_libdir}/libiam.a' >>lustre.files
774 %if %{with lustre_utils}
775 mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre
776 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre ] ; then
777 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \;
781 echo '%{_prefix}/lib/firewalld/services/*.xml' >>lustre.files
782 %if %{with lustre_modules}
783 # mark modules executable for find-debuginfo.sh
784 find $RPM_BUILD_ROOT/lib/modules -name \*.ko -type f -exec chmod u+x {} \;
787 rm -f $RPM_BUILD_ROOT%{_libdir}/liblustreapi.la
789 %if %{with lustre_tests}
790 :> lustre-tests.files
792 %if "%{mpi_name}" == "mpich"
795 %if "%{mpi_name}" == "openmpi"
800 echo '%dir %{_libdir}/lustre' >>lustre-tests.files
801 echo '%dir %{_libdir}/lustre/tests' >>lustre-tests.files
802 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
803 echo '%{_bindir}/mcreate' >>lustre-tests.files
804 echo '%{_bindir}/statx' >>lustre-tests.files
805 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
806 echo '%{_sbindir}/wiretest' >>lustre-tests.files
807 if [ -n "$MPI_BIN" ]; then
808 echo "$MPI_BIN/*" >>lustre-tests.files
810 %if %{with lustre_tests_lutf}
811 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
815 %if %{with lustre_tests_lutf}
816 echo '%{_libdir}/lustre/tests/lutf/*' >>lustre-tests.files
819 %files devel -f lustre-devel.files
820 %defattr(-,root,root)
821 %{_libdir}/pkgconfig/lustre.pc
823 %{_libdir}/liblustreapi.a
826 %{_libdir}/liblustreapi.so
828 %{_includedir}/lustre
829 %if %{with lustre_modules}
830 %{_includedir}/linux/lnet
831 %{_includedir}/linux/lustre
833 %exclude %{_includedir}/linux/lnet
834 %exclude %{_includedir}/linux/lustre
837 %files -f lustre.files
838 %defattr(-,root,root)
840 %if %{with lustre_tests}
841 %exclude %{_sbindir}/wirecheck
842 %exclude %{_sbindir}/wiretest
845 %exclude %{_sbindir}/zfsobj2fid
847 %if %{with lustre_utils}
849 %dir %{_libexecdir}/lustre
850 %{_libexecdir}/lustre/lc_common
851 %{_libexecdir}/lustre/haconfig
852 %{_bindir}/lustre_req_history
853 %{_bindir}/remove_changelog
854 %{_bindir}/remove_updatelog
860 %{_bindir}/plot-llstat
864 %{_bindir}/lfs_migrate
867 /sbin/mount.lustre_tgt
869 @BASH_COMPLETION_DIR@
877 %{_libdir}/liblustreapi.so.*
879 %{_udevrulesdir}/99-lustre.rules
881 %{_udevrulesdir}/99-lustre-server.rules
884 %config(noreplace) %{_sysconfdir}/ldev.conf
886 %config(noreplace) %{_sysconfdir}/lnet.conf
887 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
888 %if %{with lustre_utils}
889 %config(noreplace) %{_sysconfdir}/lnet_routes.conf
891 %if %{with lustre_modules}
892 %exclude /Module.symvers
895 %if %{with lustre_utils}
896 %files osd-ldiskfs-mount
897 %defattr(-,root,root)
898 %dir %{_libdir}/@PACKAGE@
899 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
906 %if %{with lustre_utils}
908 %defattr(-,root,root)
909 %dir %{_libdir}/@PACKAGE@
910 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
911 %{_sysconfdir}/zfs/zed.d/*
916 # with lustre_modules
920 %files resource-agents
921 %defattr(0755,root,root)
922 %dir %{_prefix}/lib/ocf
923 %dir %{_prefix}/lib/ocf/resource.d
924 %{_prefix}/lib/ocf/resource.d/lustre/
927 %if %{with lustre_tests}
928 %files tests -f lustre-tests.files
929 %defattr(-,root,root)
932 %if %{with lustre_iokit}
933 %files -n lustre-iokit
934 %defattr(-, root, root)
935 %{_bindir}/iokit-config
936 %{_bindir}/iokit-gather-stats
938 %{_bindir}/iokit-libecho
939 %{_bindir}/iokit-lstats
940 %{_bindir}/iokit-parse-ior
941 %{_bindir}/iokit-plot-obdfilter
942 %{_bindir}/iokit-plot-ost
943 %{_bindir}/iokit-plot-sgpdd
944 %{_bindir}/ior-survey
945 %{_bindir}/mds-survey
946 %{_bindir}/obdfilter-survey
947 %{_bindir}/ost-survey
948 %{_bindir}/sgpdd-survey
949 %{_bindir}/lst-survey
951 %doc lustre-iokit/ior-survey/README.ior-survey
952 %doc lustre-iokit/mds-survey/README.mds-survey
953 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
954 %doc lustre-iokit/ost-survey/README.ost-survey
955 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
956 %doc lustre-iokit/stats-collect/README.iokit-lstats
957 %doc lustre-iokit/lst-survey/README.lst-survey
962 %systemd_post lnet.service
967 %systemd_preun lnet.service
972 %systemd_postun_with_restart lnet.service
976 rm -rf $RPM_BUILD_ROOT
977 rm -rf %{_tmppath}/kmp