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