]> git.proxmox.com Git - ceph.git/blob - ceph/ceph.spec
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / ceph.spec
1 # vim: set noexpandtab ts=8 sw=8 :
2 #
3 # spec file for package ceph
4 #
5 # Copyright (C) 2004-2019 The Ceph Project Developers. See COPYING file
6 # at the top-level directory of this distribution and at
7 # https://github.com/ceph/ceph/blob/master/COPYING
8 #
9 # All modifications and additions to the file contributed by third parties
10 # remain the property of their copyright owners, unless otherwise agreed
11 # upon.
12 #
13 # This file is under the GNU Lesser General Public License, version 2.1
14 #
15 # Please submit bugfixes or comments via http://tracker.ceph.com/
16 #
17
18 #################################################################################
19 # conditional build section
20 #
21 # please read http://rpm.org/user_doc/conditional_builds.html for explanation of
22 # bcond syntax!
23 #################################################################################
24 %bcond_with make_check
25 %bcond_without ceph_test_package
26 %ifarch s390 s390x
27 %bcond_with tcmalloc
28 %else
29 %bcond_without tcmalloc
30 %endif
31 %if 0%{?fedora} || 0%{?rhel}
32 %bcond_without selinux
33 %bcond_without cephfs_java
34 %bcond_without lttng
35 %bcond_without libradosstriper
36 %bcond_without ocf
37 %bcond_without amqp_endpoint
38 %global _remote_tarball_prefix https://download.ceph.com/tarballs/
39 %endif
40 %if 0%{?suse_version}
41 %bcond_with selinux
42 %bcond_with cephfs_java
43 %bcond_with amqp_endpoint
44 #Compat macro for new _fillupdir macro introduced in Nov 2017
45 %if ! %{defined _fillupdir}
46 %global _fillupdir /var/adm/fillup-templates
47 %endif
48 %if 0%{?is_opensuse}
49 %bcond_without libradosstriper
50 %bcond_without ocf
51 %else
52 %bcond_with libradosstriper
53 %bcond_with ocf
54 %endif
55 %ifarch x86_64 aarch64 ppc64le
56 %bcond_without lttng
57 %else
58 %bcond_with lttng
59 %endif
60 %endif
61 %bcond_with seastar
62 %if 0%{?fedora} >= 29 || 0%{?suse_version} >= 1500 || 0%{?rhel} >= 8
63 # distros that need a py3 Ceph build
64 %bcond_with python2
65 %else
66 # distros that need a py2 Ceph build
67 %bcond_without python2
68 %endif
69 %if 0%{?fedora} || 0%{?suse_version} >= 1500
70 # distros that ship cmd2 and/or colorama
71 %bcond_without cephfs_shell
72 %else
73 # distros that do _not_ ship cmd2/colorama
74 %bcond_with cephfs_shell
75 %endif
76 %if 0%{without python2}
77 %global _defined_if_python2_absent 1
78 %endif
79
80 %if %{with selinux}
81 # get selinux policy version
82 %{!?_selinux_policy_version: %global _selinux_policy_version 0.0.0}
83 %endif
84
85 %{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d}
86 %{!?tmpfiles_create: %global tmpfiles_create systemd-tmpfiles --create}
87 %{!?python3_pkgversion: %global python3_pkgversion 3}
88 %{!?python3_version_nodots: %global python3_version_nodots 3}
89 %{!?python3_version: %global python3_version 3}
90 # define _python_buildid macro which will expand to the empty string when
91 # building with python2
92 %global _python_buildid %{?_defined_if_python2_absent:%{python3_pkgversion}}
93
94 # unify libexec for all targets
95 %global _libexecdir %{_exec_prefix}/lib
96
97 # disable dwz which compresses the debuginfo
98 %global _find_debuginfo_dwz_opts %{nil}
99
100 #################################################################################
101 # main package definition
102 #################################################################################
103 Name: ceph
104 Version: 14.2.8
105 Release: 0%{?dist}
106 %if 0%{?fedora} || 0%{?rhel}
107 Epoch: 2
108 %endif
109
110 # define _epoch_prefix macro which will expand to the empty string if epoch is
111 # undefined
112 %global _epoch_prefix %{?epoch:%{epoch}:}
113
114 Summary: User space components of the Ceph file system
115 License: LGPL-2.1 and CC-BY-SA-3.0 and GPL-2.0 and BSL-1.0 and BSD-3-Clause and MIT
116 %if 0%{?suse_version}
117 Group: System/Filesystems
118 %endif
119 URL: http://ceph.com/
120 Source0: %{?_remote_tarball_prefix}ceph-14.2.8.tar.bz2
121 %if 0%{?suse_version}
122 # _insert_obs_source_lines_here
123 ExclusiveArch: x86_64 aarch64 ppc64le s390x
124 %endif
125 #################################################################################
126 # dependencies that apply across all distro families
127 #################################################################################
128 Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release}
129 Requires: ceph-mds = %{_epoch_prefix}%{version}-%{release}
130 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
131 Requires: ceph-mon = %{_epoch_prefix}%{version}-%{release}
132 Requires(post): binutils
133 %if 0%{with cephfs_java}
134 BuildRequires: java-devel
135 BuildRequires: sharutils
136 %endif
137 %if 0%{with selinux}
138 BuildRequires: checkpolicy
139 BuildRequires: selinux-policy-devel
140 %endif
141 BuildRequires: gperf
142 %if 0%{?rhel} == 7
143 BuildRequires: cmake3 > 3.5
144 %else
145 BuildRequires: cmake > 3.5
146 %endif
147 BuildRequires: cryptsetup
148 BuildRequires: fuse-devel
149 %if 0%{?rhel} == 7
150 # devtoolset offers newer make and valgrind-devel, but the old ones are good
151 # enough.
152 BuildRequires: devtoolset-8-gcc-c++ >= 8.2.1
153 %else
154 BuildRequires: gcc-c++
155 %endif
156 BuildRequires: gdbm
157 %if 0%{with tcmalloc}
158 %if 0%{?fedora} || 0%{?rhel}
159 BuildRequires: gperftools-devel >= 2.6.1
160 %endif
161 %if 0%{?suse_version}
162 BuildRequires: gperftools-devel >= 2.4
163 %endif
164 %endif
165 BuildRequires: leveldb-devel > 1.2
166 BuildRequires: libaio-devel
167 BuildRequires: libblkid-devel >= 2.17
168 BuildRequires: libcurl-devel
169 BuildRequires: libcap-ng-devel
170 BuildRequires: libudev-devel
171 BuildRequires: libnl3-devel
172 BuildRequires: liboath-devel
173 BuildRequires: libtool
174 BuildRequires: libxml2-devel
175 BuildRequires: make
176 BuildRequires: ncurses-devel
177 BuildRequires: parted
178 BuildRequires: patch
179 BuildRequires: perl
180 BuildRequires: pkgconfig
181 BuildRequires: procps
182 BuildRequires: python%{_python_buildid}
183 BuildRequires: python%{_python_buildid}-devel
184 BuildRequires: snappy-devel
185 BuildRequires: sudo
186 BuildRequires: udev
187 BuildRequires: util-linux
188 BuildRequires: valgrind-devel
189 BuildRequires: which
190 BuildRequires: xfsprogs
191 BuildRequires: xfsprogs-devel
192 BuildRequires: xmlstarlet
193 BuildRequires: yasm
194 %if 0%{with amqp_endpoint}
195 BuildRequires: librabbitmq-devel
196 %endif
197 %if 0%{with make_check}
198 BuildRequires: jq
199 BuildRequires: libuuid-devel
200 BuildRequires: python%{_python_buildid}-bcrypt
201 BuildRequires: python%{_python_buildid}-coverage
202 BuildRequires: python%{_python_buildid}-nose
203 BuildRequires: python%{_python_buildid}-pecan
204 BuildRequires: python%{_python_buildid}-requests
205 BuildRequires: python%{_python_buildid}-six
206 BuildRequires: python%{_python_buildid}-tox
207 BuildRequires: python%{_python_buildid}-virtualenv
208 %if 0%{?rhel} == 7
209 BuildRequires: pyOpenSSL%{_python_buildid}
210 %else
211 BuildRequires: python%{_python_buildid}-pyOpenSSL
212 %endif
213 BuildRequires: socat
214 %endif
215 %if 0%{with seastar}
216 BuildRequires: c-ares-devel
217 BuildRequires: gnutls-devel
218 BuildRequires: hwloc-devel
219 BuildRequires: libpciaccess-devel
220 BuildRequires: lksctp-tools-devel
221 BuildRequires: protobuf-devel
222 BuildRequires: ragel
223 BuildRequires: systemtap-sdt-devel
224 BuildRequires: yaml-cpp-devel
225 %endif
226 #################################################################################
227 # distro-conditional dependencies
228 #################################################################################
229 %if 0%{?suse_version}
230 BuildRequires: pkgconfig(systemd)
231 BuildRequires: systemd-rpm-macros
232 %{?systemd_requires}
233 PreReq: %fillup_prereq
234 BuildRequires: fdupes
235 BuildRequires: net-tools
236 BuildRequires: libbz2-devel
237 BuildRequires: mozilla-nss-devel
238 BuildRequires: keyutils-devel
239 BuildRequires: libopenssl-devel
240 BuildRequires: lsb-release
241 BuildRequires: openldap2-devel
242 #BuildRequires: krb5
243 #BuildRequires: krb5-devel
244 BuildRequires: cunit-devel
245 BuildRequires: python%{_python_buildid}-setuptools
246 BuildRequires: python%{_python_buildid}-Cython
247 BuildRequires: python%{_python_buildid}-PrettyTable
248 BuildRequires: python%{_python_buildid}-Sphinx
249 BuildRequires: rdma-core-devel
250 BuildRequires: liblz4-devel >= 1.7
251 # for prometheus-alerts
252 BuildRequires: golang-github-prometheus-prometheus
253 %endif
254 %if 0%{?fedora} || 0%{?rhel}
255 Requires: systemd
256 BuildRequires: boost-random
257 BuildRequires: nss-devel
258 BuildRequires: keyutils-libs-devel
259 BuildRequires: libibverbs-devel
260 BuildRequires: librdmacm-devel
261 BuildRequires: openldap-devel
262 #BuildRequires: krb5-devel
263 BuildRequires: openssl-devel
264 BuildRequires: CUnit-devel
265 BuildRequires: redhat-lsb-core
266 %if 0%{with python2}
267 BuildRequires: python2-Cython
268 %endif
269 BuildRequires: python%{python3_pkgversion}-devel
270 BuildRequires: python%{python3_pkgversion}-setuptools
271 %if 0%{?rhel}
272 BuildRequires: python%{python3_version_nodots}-Cython
273 %else
274 BuildRequires: python%{python3_pkgversion}-Cython
275 %endif
276 BuildRequires: python%{_python_buildid}-prettytable
277 BuildRequires: python%{_python_buildid}-sphinx
278 BuildRequires: lz4-devel >= 1.7
279 %endif
280 # distro-conditional make check dependencies
281 %if 0%{with make_check}
282 %if 0%{?fedora} || 0%{?rhel}
283 BuildRequires: python%{_python_buildid}-cherrypy
284 BuildRequires: python%{_python_buildid}-jwt
285 BuildRequires: python%{_python_buildid}-routes
286 BuildRequires: python%{_python_buildid}-werkzeug
287 BuildRequires: xmlsec1
288 %endif
289 %if 0%{?suse_version}
290 BuildRequires: python%{_python_buildid}-CherryPy
291 BuildRequires: python%{_python_buildid}-PyJWT
292 BuildRequires: python%{_python_buildid}-Routes
293 BuildRequires: python%{_python_buildid}-Werkzeug
294 BuildRequires: python%{_python_buildid}-numpy-devel
295 BuildRequires: rpm-build
296 BuildRequires: xmlsec1-devel
297 %endif
298 %endif
299 # lttng and babeltrace for rbd-replay-prep
300 %if %{with lttng}
301 %if 0%{?fedora} || 0%{?rhel}
302 BuildRequires: lttng-ust-devel
303 BuildRequires: libbabeltrace-devel
304 %endif
305 %if 0%{?suse_version}
306 BuildRequires: lttng-ust-devel
307 BuildRequires: babeltrace-devel
308 %endif
309 %endif
310 %if 0%{?suse_version}
311 BuildRequires: libexpat-devel
312 %endif
313 %if 0%{?rhel} || 0%{?fedora}
314 BuildRequires: expat-devel
315 %endif
316 #hardened-cc1
317 %if 0%{?fedora} || 0%{?rhel}
318 BuildRequires: redhat-rpm-config
319 %endif
320 %if 0%{with seastar}
321 %if 0%{?fedora} || 0%{?rhel}
322 BuildRequires: cryptopp-devel
323 BuildRequires: numactl-devel
324 BuildRequires: protobuf-compiler
325 %endif
326 %if 0%{?suse_version}
327 BuildRequires: libcryptopp-devel
328 BuildRequires: libnuma-devel
329 %endif
330 %endif
331
332 %description
333 Ceph is a massively scalable, open-source, distributed storage system that runs
334 on commodity hardware and delivers object, block and file system storage.
335
336
337 #################################################################################
338 # subpackages
339 #################################################################################
340 %package base
341 Summary: Ceph Base Package
342 %if 0%{?suse_version}
343 Group: System/Filesystems
344 %endif
345 Provides: ceph-test:/usr/bin/ceph-kvstore-tool
346 Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
347 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
348 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
349 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
350 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
351 %if 0%{with selinux}
352 Requires: ceph-selinux = %{_epoch_prefix}%{version}-%{release}
353 %endif
354 Requires: cryptsetup
355 Requires: e2fsprogs
356 Requires: findutils
357 Requires: grep
358 Requires: logrotate
359 Requires: parted
360 Requires: psmisc
361 Requires: python%{_python_buildid}-requests
362 Requires: python%{_python_buildid}-setuptools
363 Requires: util-linux
364 Requires: xfsprogs
365 Requires: which
366 %if 0%{?fedora} || 0%{?rhel}
367 # The following is necessary due to tracker 36508 and can be removed once the
368 # associated upstream bugs are resolved.
369 %if 0%{with tcmalloc}
370 Requires: gperftools-libs >= 2.6.1
371 %endif
372 %endif
373 %if 0%{?suse_version}
374 Recommends: chrony
375 %endif
376 %description base
377 Base is the package that includes all the files shared amongst ceph servers
378
379 %package -n ceph-common
380 Summary: Ceph Common
381 %if 0%{?suse_version}
382 Group: System/Filesystems
383 %endif
384 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
385 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
386 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
387 Requires: python%{_python_buildid}-rados = %{_epoch_prefix}%{version}-%{release}
388 Requires: python%{_python_buildid}-rbd = %{_epoch_prefix}%{version}-%{release}
389 Requires: python%{_python_buildid}-cephfs = %{_epoch_prefix}%{version}-%{release}
390 Requires: python%{_python_buildid}-rgw = %{_epoch_prefix}%{version}-%{release}
391 Requires: python%{_python_buildid}-ceph-argparse = %{_epoch_prefix}%{version}-%{release}
392 Requires: python%{_python_buildid}-requests
393 %if 0%{?fedora} || 0%{?rhel}
394 Requires: python%{_python_buildid}-prettytable
395 %endif
396 %if 0%{?suse_version}
397 Requires: python%{_python_buildid}-PrettyTable
398 %endif
399 %if 0%{with libradosstriper}
400 Requires: libradosstriper1 = %{_epoch_prefix}%{version}-%{release}
401 %endif
402 %{?systemd_requires}
403 %if 0%{?suse_version}
404 Requires(pre): pwdutils
405 %endif
406 %description -n ceph-common
407 Common utilities to mount and interact with a ceph storage cluster.
408 Comprised of files that are common to Ceph clients and servers.
409
410 %package mds
411 Summary: Ceph Metadata Server Daemon
412 %if 0%{?suse_version}
413 Group: System/Filesystems
414 %endif
415 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
416 %description mds
417 ceph-mds is the metadata server daemon for the Ceph distributed file system.
418 One or more instances of ceph-mds collectively manage the file system
419 namespace, coordinating access to the shared OSD cluster.
420
421 %package mon
422 Summary: Ceph Monitor Daemon
423 %if 0%{?suse_version}
424 Group: System/Filesystems
425 %endif
426 Provides: ceph-test:/usr/bin/ceph-monstore-tool
427 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
428 %description mon
429 ceph-mon is the cluster monitor daemon for the Ceph distributed file
430 system. One or more instances of ceph-mon form a Paxos part-time
431 parliament cluster that provides extremely reliable and durable storage
432 of cluster membership, configuration, and state.
433
434 %package mgr
435 Summary: Ceph Manager Daemon
436 %if 0%{?suse_version}
437 Group: System/Filesystems
438 %endif
439 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
440 Requires: python%{_python_buildid}-bcrypt
441 Requires: python%{_python_buildid}-pecan
442 Requires: python%{_python_buildid}-six
443 %if 0%{?fedora} || 0%{?rhel}
444 Requires: python%{_python_buildid}-cherrypy
445 Requires: python%{_python_buildid}-werkzeug
446 %endif
447 %if 0%{?suse_version}
448 Requires: python%{_python_buildid}-CherryPy
449 Requires: python%{_python_buildid}-Werkzeug
450 Recommends: python%{_python_buildid}-influxdb
451 Recommends: ceph-mgr-dashboard = %{_epoch_prefix}%{version}-%{release}
452 Recommends: ceph-mgr-diskprediction-local = %{_epoch_prefix}%{version}-%{release}
453 Recommends: ceph-mgr-diskprediction-cloud = %{_epoch_prefix}%{version}-%{release}
454 Recommends: ceph-mgr-rook = %{_epoch_prefix}%{version}-%{release}
455 Recommends: ceph-mgr-k8sevents = %{_epoch_prefix}%{version}-%{release}
456 Recommends: ceph-mgr-ssh = %{_epoch_prefix}%{version}-%{release}
457 %endif
458 %if 0%{?rhel} == 7
459 Requires: pyOpenSSL
460 %else
461 Requires: python%{_python_buildid}-pyOpenSSL
462 %endif
463 %description mgr
464 ceph-mgr enables python modules that provide services (such as the REST
465 module derived from Calamari) and expose CLI hooks. ceph-mgr gathers
466 the cluster maps, the daemon metadata, and performance counters, and
467 exposes all these to the python modules.
468
469 %package mgr-dashboard
470 Summary: Ceph Dashboard
471 BuildArch: noarch
472 %if 0%{?suse_version}
473 Group: System/Filesystems
474 %endif
475 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
476 Requires: ceph-grafana-dashboards = %{_epoch_prefix}%{version}-%{release}
477 %if 0%{?fedora} || 0%{?rhel}
478 Requires: python%{_python_buildid}-cherrypy
479 Requires: python%{_python_buildid}-jwt
480 Requires: python%{_python_buildid}-routes
481 Requires: python%{_python_buildid}-werkzeug
482 %endif
483 %if 0%{?suse_version}
484 Requires: python%{_python_buildid}-CherryPy
485 Requires: python%{_python_buildid}-PyJWT
486 Requires: python%{_python_buildid}-Routes
487 Requires: python%{_python_buildid}-Werkzeug
488 %endif
489 %if 0%{?rhel} == 7
490 Requires: pyOpenSSL
491 %else
492 Requires: python%{_python_buildid}-pyOpenSSL
493 %endif
494 %description mgr-dashboard
495 ceph-mgr-dashboard is a manager plugin, providing a web-based application
496 to monitor and manage many aspects of a Ceph cluster and related components.
497 See the Dashboard documentation at http://docs.ceph.com/ for details and a
498 detailed feature overview.
499
500 %package mgr-diskprediction-local
501 Summary: ceph-mgr diskprediction_local plugin
502 BuildArch: noarch
503 %if 0%{?suse_version}
504 Group: System/Filesystems
505 %endif
506 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
507 %if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?suse_version}
508 Requires: python%{_python_buildid}-numpy
509 %if 0%{without python2}
510 Requires: python3-scipy
511 %else
512 Requires: python2-scipy
513 %endif
514 %endif
515 %if 0%{?rhel} == 7
516 Requires: numpy
517 Requires: scipy
518 %endif
519 %description mgr-diskprediction-local
520 ceph-mgr-diskprediction-local is a ceph-mgr plugin that tries to predict
521 disk failures using local algorithms and machine-learning databases.
522
523 %package mgr-diskprediction-cloud
524 Summary: ceph-mgr diskprediction_cloud plugin
525 BuildArch: noarch
526 %if 0%{?suse_version}
527 Group: System/Filesystems
528 %endif
529 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
530 %description mgr-diskprediction-cloud
531 ceph-mgr-diskprediction-cloud is a ceph-mgr plugin that tries to predict
532 disk failures using services in the Google cloud.
533
534 %package mgr-rook
535 BuildArch: noarch
536 Summary: ceph-mgr rook plugin
537 %if 0%{?suse_version}
538 Group: System/Filesystems
539 %endif
540 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
541 Requires: python%{_python_buildid}-kubernetes
542 %description mgr-rook
543 ceph-mgr-rook is a ceph-mgr plugin for orchestration functions using
544 a Rook backend.
545
546 %package mgr-k8sevents
547 BuildArch: noarch
548 Summary: Ceph Manager plugin to orchestrate ceph-events to kubernetes' events API
549 %if 0%{?suse_version}
550 Group: System/Filesystems
551 %endif
552 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
553 Requires: python%{_python_buildid}-kubernetes
554 %description mgr-k8sevents
555 ceph-mgr-k8sevents is a ceph-mgr plugin that sends every ceph-events
556 to kubernetes' events API
557
558 %package mgr-ssh
559 Summary: ceph-mgr ssh module
560 BuildArch: noarch
561 %if 0%{?suse_version}
562 Group: System/Filesystems
563 %endif
564 Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
565 Requires: python%{_python_buildid}-remoto
566 %description mgr-ssh
567 ceph-mgr-ssh is a ceph-mgr module for orchestration functions using
568 direct SSH connections for management operations.
569
570 %package fuse
571 Summary: Ceph fuse-based client
572 %if 0%{?suse_version}
573 Group: System/Filesystems
574 %endif
575 Requires: fuse
576 Requires: python%{python3_pkgversion}
577 %description fuse
578 FUSE based client for Ceph distributed network file system
579
580 %package -n rbd-fuse
581 Summary: Ceph fuse-based client
582 %if 0%{?suse_version}
583 Group: System/Filesystems
584 %endif
585 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
586 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
587 %description -n rbd-fuse
588 FUSE based client to map Ceph rbd images to files
589
590 %package -n rbd-mirror
591 Summary: Ceph daemon for mirroring RBD images
592 %if 0%{?suse_version}
593 Group: System/Filesystems
594 %endif
595 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
596 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
597 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
598 %description -n rbd-mirror
599 Daemon for mirroring RBD images between Ceph clusters, streaming
600 changes asynchronously.
601
602 %package -n rbd-nbd
603 Summary: Ceph RBD client base on NBD
604 %if 0%{?suse_version}
605 Group: System/Filesystems
606 %endif
607 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
608 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
609 %description -n rbd-nbd
610 NBD based client to map Ceph rbd images to local device
611
612 %package radosgw
613 Summary: Rados REST gateway
614 %if 0%{?suse_version}
615 Group: System/Filesystems
616 %endif
617 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
618 %if 0%{with selinux}
619 Requires: ceph-selinux = %{_epoch_prefix}%{version}-%{release}
620 %endif
621 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
622 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
623 %if 0%{?rhel} || 0%{?fedora}
624 Requires: mailcap
625 %endif
626 %description radosgw
627 RADOS is a distributed object store used by the Ceph distributed
628 storage system. This package provides a REST gateway to the
629 object store that aims to implement a superset of Amazon's S3
630 service as well as the OpenStack Object Storage ("Swift") API.
631
632 %if %{with ocf}
633 %package resource-agents
634 Summary: OCF-compliant resource agents for Ceph daemons
635 %if 0%{?suse_version}
636 Group: System/Filesystems
637 %endif
638 Requires: ceph-base = %{_epoch_prefix}%{version}
639 Requires: resource-agents
640 %description resource-agents
641 Resource agents for monitoring and managing Ceph daemons
642 under Open Cluster Framework (OCF) compliant resource
643 managers such as Pacemaker.
644 %endif
645
646 %package osd
647 Summary: Ceph Object Storage Daemon
648 %if 0%{?suse_version}
649 Group: System/Filesystems
650 %endif
651 Provides: ceph-test:/usr/bin/ceph-osdomap-tool
652 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
653 Requires: lvm2
654 Requires: sudo
655 Requires: libstoragemgmt
656 %description osd
657 ceph-osd is the object storage daemon for the Ceph distributed file
658 system. It is responsible for storing objects on a local file system
659 and providing access to them over the network.
660
661 %package -n librados2
662 Summary: RADOS distributed object store client library
663 %if 0%{?suse_version}
664 Group: System/Libraries
665 %endif
666 %if 0%{?rhel} || 0%{?fedora}
667 Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
668 %endif
669 %description -n librados2
670 RADOS is a reliable, autonomic distributed object storage cluster
671 developed as part of the Ceph distributed storage system. This is a
672 shared library allowing applications to access the distributed object
673 store using a simple file-like interface.
674
675 %package -n librados-devel
676 Summary: RADOS headers
677 %if 0%{?suse_version}
678 Group: Development/Libraries/C and C++
679 %endif
680 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
681 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
682 Provides: librados2-devel = %{_epoch_prefix}%{version}-%{release}
683 Obsoletes: librados2-devel < %{_epoch_prefix}%{version}-%{release}
684 %description -n librados-devel
685 This package contains C libraries and headers needed to develop programs
686 that use RADOS object store.
687
688 %package -n libradospp-devel
689 Summary: RADOS headers
690 %if 0%{?suse_version}
691 Group: Development/Libraries/C and C++
692 %endif
693 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
694 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
695 %description -n libradospp-devel
696 This package contains C++ libraries and headers needed to develop programs
697 that use RADOS object store.
698
699 %package -n librgw2
700 Summary: RADOS gateway client library
701 %if 0%{?suse_version}
702 Group: System/Libraries
703 %endif
704 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
705 %description -n librgw2
706 This package provides a library implementation of the RADOS gateway
707 (distributed object store with S3 and Swift personalities).
708
709 %package -n librgw-devel
710 Summary: RADOS gateway client library
711 %if 0%{?suse_version}
712 Group: Development/Libraries/C and C++
713 %endif
714 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
715 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
716 Provides: librgw2-devel = %{_epoch_prefix}%{version}-%{release}
717 Obsoletes: librgw2-devel < %{_epoch_prefix}%{version}-%{release}
718 %description -n librgw-devel
719 This package contains libraries and headers needed to develop programs
720 that use RADOS gateway client library.
721
722 %if 0%{with python2}
723 %package -n python-rgw
724 Summary: Python 2 libraries for the RADOS gateway
725 %if 0%{?suse_version}
726 Group: Development/Libraries/Python
727 %endif
728 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
729 Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
730 %{?python_provide:%python_provide python-rgw}
731 Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
732 %description -n python-rgw
733 This package contains Python 2 libraries for interacting with Cephs RADOS
734 gateway.
735 %endif
736
737 %package -n python%{python3_pkgversion}-rgw
738 Summary: Python 3 libraries for the RADOS gateway
739 %if 0%{?suse_version}
740 Group: Development/Libraries/Python
741 %endif
742 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
743 Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
744 %{?python_provide:%python_provide python%{python3_pkgversion}-rgw}
745 %if 0%{without python2}
746 Provides: python-rgw = %{_epoch_prefix}%{version}-%{release}
747 Obsoletes: python-rgw < %{_epoch_prefix}%{version}-%{release}
748 %endif
749 %description -n python%{python3_pkgversion}-rgw
750 This package contains Python 3 libraries for interacting with Cephs RADOS
751 gateway.
752
753 %if 0%{with python2}
754 %package -n python-rados
755 Summary: Python 2 libraries for the RADOS object store
756 %if 0%{?suse_version}
757 Group: Development/Libraries/Python
758 %endif
759 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
760 %{?python_provide:%python_provide python-rados}
761 Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
762 %description -n python-rados
763 This package contains Python 2 libraries for interacting with Cephs RADOS
764 object store.
765 %endif
766
767 %package -n python%{python3_pkgversion}-rados
768 Summary: Python 3 libraries for the RADOS object store
769 %if 0%{?suse_version}
770 Group: Development/Libraries/Python
771 %endif
772 Requires: python%{python3_pkgversion}
773 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
774 %{?python_provide:%python_provide python%{python3_pkgversion}-rados}
775 %if 0%{without python2}
776 Provides: python-rados = %{_epoch_prefix}%{version}-%{release}
777 Obsoletes: python-rados < %{_epoch_prefix}%{version}-%{release}
778 %endif
779 %description -n python%{python3_pkgversion}-rados
780 This package contains Python 3 libraries for interacting with Cephs RADOS
781 object store.
782
783 %if 0%{with libradosstriper}
784 %package -n libradosstriper1
785 Summary: RADOS striping interface
786 %if 0%{?suse_version}
787 Group: System/Libraries
788 %endif
789 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
790 %description -n libradosstriper1
791 Striping interface built on top of the rados library, allowing
792 to stripe bigger objects onto several standard rados objects using
793 an interface very similar to the rados one.
794
795 %package -n libradosstriper-devel
796 Summary: RADOS striping interface headers
797 %if 0%{?suse_version}
798 Group: Development/Libraries/C and C++
799 %endif
800 Requires: libradosstriper1 = %{_epoch_prefix}%{version}-%{release}
801 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
802 Requires: libradospp-devel = %{_epoch_prefix}%{version}-%{release}
803 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
804 Provides: libradosstriper1-devel = %{_epoch_prefix}%{version}-%{release}
805 Obsoletes: libradosstriper1-devel < %{_epoch_prefix}%{version}-%{release}
806 %description -n libradosstriper-devel
807 This package contains libraries and headers needed to develop programs
808 that use RADOS striping interface.
809 %endif
810
811 %package -n librbd1
812 Summary: RADOS block device client library
813 %if 0%{?suse_version}
814 Group: System/Libraries
815 %endif
816 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
817 %if 0%{?suse_version}
818 Requires(post): coreutils
819 %endif
820 %if 0%{?rhel} || 0%{?fedora}
821 Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
822 %endif
823 %description -n librbd1
824 RBD is a block device striped across multiple distributed objects in
825 RADOS, a reliable, autonomic distributed object storage cluster
826 developed as part of the Ceph distributed storage system. This is a
827 shared library allowing applications to manage these block devices.
828
829 %package -n librbd-devel
830 Summary: RADOS block device headers
831 %if 0%{?suse_version}
832 Group: Development/Libraries/C and C++
833 %endif
834 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
835 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
836 Requires: libradospp-devel = %{_epoch_prefix}%{version}-%{release}
837 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
838 Provides: librbd1-devel = %{_epoch_prefix}%{version}-%{release}
839 Obsoletes: librbd1-devel < %{_epoch_prefix}%{version}-%{release}
840 %description -n librbd-devel
841 This package contains libraries and headers needed to develop programs
842 that use RADOS block device.
843
844 %if 0%{with python2}
845 %package -n python-rbd
846 Summary: Python 2 libraries for the RADOS block device
847 %if 0%{?suse_version}
848 Group: Development/Libraries/Python
849 %endif
850 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
851 Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
852 %{?python_provide:%python_provide python-rbd}
853 Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
854 %description -n python-rbd
855 This package contains Python 2 libraries for interacting with Cephs RADOS
856 block device.
857 %endif
858
859 %package -n python%{python3_pkgversion}-rbd
860 Summary: Python 3 libraries for the RADOS block device
861 %if 0%{?suse_version}
862 Group: Development/Libraries/Python
863 %endif
864 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
865 Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
866 %{?python_provide:%python_provide python%{python3_pkgversion}-rbd}
867 Provides: python3-rbd = %{_epoch_prefix}%{version}-%{release}
868 %if 0%{without python2}
869 Provides: python-rbd = %{_epoch_prefix}%{version}-%{release}
870 Obsoletes: python-rbd < %{_epoch_prefix}%{version}-%{release}
871 %endif
872 %description -n python%{python3_pkgversion}-rbd
873 This package contains Python 3 libraries for interacting with Cephs RADOS
874 block device.
875
876 %package -n libcephfs2
877 Summary: Ceph distributed file system client library
878 %if 0%{?suse_version}
879 Group: System/Libraries
880 %endif
881 Obsoletes: libcephfs1
882 %if 0%{?rhel} || 0%{?fedora}
883 Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
884 Obsoletes: ceph-libcephfs
885 %endif
886 %description -n libcephfs2
887 Ceph is a distributed network file system designed to provide excellent
888 performance, reliability, and scalability. This is a shared library
889 allowing applications to access a Ceph distributed file system via a
890 POSIX-like interface.
891
892 %package -n libcephfs-devel
893 Summary: Ceph distributed file system headers
894 %if 0%{?suse_version}
895 Group: Development/Libraries/C and C++
896 %endif
897 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
898 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
899 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
900 Provides: libcephfs2-devel = %{_epoch_prefix}%{version}-%{release}
901 Obsoletes: libcephfs2-devel < %{_epoch_prefix}%{version}-%{release}
902 %description -n libcephfs-devel
903 This package contains libraries and headers needed to develop programs
904 that use Cephs distributed file system.
905
906 %if 0%{with python2}
907 %package -n python-cephfs
908 Summary: Python 2 libraries for Ceph distributed file system
909 %if 0%{?suse_version}
910 Group: Development/Libraries/Python
911 %endif
912 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
913 Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
914 Requires: python-ceph-argparse = %{_epoch_prefix}%{version}-%{release}
915 %{?python_provide:%python_provide python-cephfs}
916 Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
917 %description -n python-cephfs
918 This package contains Python 2 libraries for interacting with Cephs distributed
919 file system.
920 %endif
921
922 %package -n python%{python3_pkgversion}-cephfs
923 Summary: Python 3 libraries for Ceph distributed file system
924 %if 0%{?suse_version}
925 Group: Development/Libraries/Python
926 %endif
927 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
928 Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
929 Requires: python%{python3_pkgversion}-ceph-argparse = %{_epoch_prefix}%{version}-%{release}
930 %{?python_provide:%python_provide python%{python3_pkgversion}-cephfs}
931 %if 0%{without python2}
932 Provides: python-cephfs = %{_epoch_prefix}%{version}-%{release}
933 Obsoletes: python-cephfs < %{_epoch_prefix}%{version}-%{release}
934 %endif
935 %description -n python%{python3_pkgversion}-cephfs
936 This package contains Python 3 libraries for interacting with Cephs distributed
937 file system.
938
939 %if 0%{with python2}
940 %package -n python-ceph-argparse
941 Summary: Python 2 utility libraries for Ceph CLI
942 %if 0%{?suse_version}
943 Group: Development/Libraries/Python
944 %endif
945 %description -n python-ceph-argparse
946 This package contains types and routines for Python 2 used by the Ceph CLI as
947 well as the RESTful interface. These have to do with querying the daemons for
948 command-description information, validating user command input against those
949 descriptions, and submitting the command to the appropriate daemon.
950 %endif
951
952 %package -n python%{python3_pkgversion}-ceph-argparse
953 Summary: Python 3 utility libraries for Ceph CLI
954 %if 0%{?suse_version}
955 Group: Development/Libraries/Python
956 %endif
957 %{?python_provide:%python_provide python%{python3_pkgversion}-ceph-argparse}
958 %description -n python%{python3_pkgversion}-ceph-argparse
959 This package contains types and routines for Python 3 used by the Ceph CLI as
960 well as the RESTful interface. These have to do with querying the daemons for
961 command-description information, validating user command input against those
962 descriptions, and submitting the command to the appropriate daemon.
963
964 %if 0%{with cephfs_shell}
965 %package -n cephfs-shell
966 Summary: Interactive shell for Ceph file system
967 Requires: python%{python3_pkgversion}-cmd2
968 Requires: python%{python3_pkgversion}-colorama
969 Requires: python%{python3_pkgversion}-cephfs
970 %description -n cephfs-shell
971 This package contains an interactive tool that allows accessing a Ceph
972 file system without mounting it by providing a nice pseudo-shell which
973 works like an FTP client.
974 %endif
975
976 %if 0%{with ceph_test_package}
977 %package -n ceph-test
978 Summary: Ceph benchmarks and test tools
979 %if 0%{?suse_version}
980 Group: System/Benchmark
981 %endif
982 Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
983 Requires: xmlstarlet
984 Requires: jq
985 Requires: socat
986 %description -n ceph-test
987 This package contains Ceph benchmarks and test tools.
988 %endif
989
990 %if 0%{with cephfs_java}
991
992 %package -n libcephfs_jni1
993 Summary: Java Native Interface library for CephFS Java bindings
994 %if 0%{?suse_version}
995 Group: System/Libraries
996 %endif
997 Requires: java
998 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
999 %description -n libcephfs_jni1
1000 This package contains the Java Native Interface library for CephFS Java
1001 bindings.
1002
1003 %package -n libcephfs_jni-devel
1004 Summary: Development files for CephFS Java Native Interface library
1005 %if 0%{?suse_version}
1006 Group: Development/Libraries/Java
1007 %endif
1008 Requires: java
1009 Requires: libcephfs_jni1 = %{_epoch_prefix}%{version}-%{release}
1010 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
1011 Provides: libcephfs_jni1-devel = %{_epoch_prefix}%{version}-%{release}
1012 Obsoletes: libcephfs_jni1-devel < %{_epoch_prefix}%{version}-%{release}
1013 %description -n libcephfs_jni-devel
1014 This package contains the development files for CephFS Java Native Interface
1015 library.
1016
1017 %package -n cephfs-java
1018 Summary: Java libraries for the Ceph File System
1019 %if 0%{?suse_version}
1020 Group: System/Libraries
1021 %endif
1022 Requires: java
1023 Requires: libcephfs_jni1 = %{_epoch_prefix}%{version}-%{release}
1024 Requires: junit
1025 BuildRequires: junit
1026 %description -n cephfs-java
1027 This package contains the Java libraries for the Ceph File System.
1028
1029 %endif
1030
1031 %package -n rados-objclass-devel
1032 Summary: RADOS object class development kit
1033 %if 0%{?suse_version}
1034 Group: Development/Libraries/C and C++
1035 %endif
1036 Requires: libradospp-devel = %{_epoch_prefix}%{version}-%{release}
1037 %description -n rados-objclass-devel
1038 This package contains libraries and headers needed to develop RADOS object
1039 class plugins.
1040
1041 %if 0%{with selinux}
1042
1043 %package selinux
1044 Summary: SELinux support for Ceph MON, OSD and MDS
1045 %if 0%{?suse_version}
1046 Group: System/Filesystems
1047 %endif
1048 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
1049 Requires: policycoreutils, libselinux-utils
1050 Requires(post): ceph-base = %{_epoch_prefix}%{version}-%{release}
1051 Requires(post): selinux-policy-base >= %{_selinux_policy_version}, policycoreutils, gawk
1052 Requires(postun): policycoreutils
1053 %description selinux
1054 This package contains SELinux support for Ceph MON, OSD and MDS. The package
1055 also performs file-system relabelling which can take a long time on heavily
1056 populated file-systems.
1057
1058 %endif
1059
1060 %if 0%{with python2}
1061 %package -n python-ceph-compat
1062 Summary: Compatibility package for Cephs python libraries
1063 %if 0%{?suse_version}
1064 Group: Development/Libraries/Python
1065 %endif
1066 Obsoletes: python-ceph
1067 Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
1068 Requires: python-rbd = %{_epoch_prefix}%{version}-%{release}
1069 Requires: python-cephfs = %{_epoch_prefix}%{version}-%{release}
1070 Requires: python-rgw = %{_epoch_prefix}%{version}-%{release}
1071 Provides: python-ceph
1072 %description -n python-ceph-compat
1073 This is a compatibility package to accommodate python-ceph split into
1074 python-rados, python-rbd, python-rgw and python-cephfs. Packages still
1075 depending on python-ceph should be fixed to depend on python-rados,
1076 python-rbd, python-rgw or python-cephfs instead.
1077 %endif
1078
1079 %package grafana-dashboards
1080 Summary: The set of Grafana dashboards for monitoring purposes
1081 BuildArch: noarch
1082 %if 0%{?suse_version}
1083 Group: System/Filesystems
1084 %endif
1085 %description grafana-dashboards
1086 This package provides a set of Grafana dashboards for monitoring of
1087 Ceph clusters. The dashboards require a Prometheus server setup
1088 collecting data from Ceph Manager "prometheus" module and Prometheus
1089 project "node_exporter" module. The dashboards are designed to be
1090 integrated with the Ceph Manager Dashboard web UI.
1091
1092 %if 0%{?suse_version}
1093 %package prometheus-alerts
1094 Summary: Prometheus alerts for a Ceph deplyoment
1095 BuildArch: noarch
1096 Group: System/Monitoring
1097 %description prometheus-alerts
1098 This package provides Ceph’s default alerts for Prometheus.
1099 %endif
1100
1101 #################################################################################
1102 # common
1103 #################################################################################
1104 %prep
1105 %autosetup -p1 -n ceph-14.2.8
1106
1107 %build
1108 # LTO can be enabled as soon as the following GCC bug is fixed:
1109 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200
1110 %define _lto_cflags %{nil}
1111
1112 %if 0%{?rhel} == 7
1113 . /opt/rh/devtoolset-8/enable
1114 %endif
1115
1116 %if 0%{with cephfs_java}
1117 # Find jni.h
1118 for i in /usr/{lib64,lib}/jvm/java/include{,/linux}; do
1119 [ -d $i ] && java_inc="$java_inc -I$i"
1120 done
1121 %endif
1122
1123 %if 0%{?suse_version}
1124 # the following setting fixed an OOM condition we once encountered in the OBS
1125 RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
1126 %endif
1127
1128 export CPPFLAGS="$java_inc"
1129 export CFLAGS="$RPM_OPT_FLAGS"
1130 export CXXFLAGS="$RPM_OPT_FLAGS"
1131 export LDFLAGS="$RPM_LD_FLAGS"
1132
1133 # Parallel build settings ...
1134 CEPH_MFLAGS_JOBS="%{?_smp_mflags}"
1135 CEPH_SMP_NCPUS=$(echo "$CEPH_MFLAGS_JOBS" | sed 's/-j//')
1136 %if 0%{?__isa_bits} == 32
1137 # 32-bit builds can use 3G memory max, which is not enough even for -j2
1138 CEPH_SMP_NCPUS="1"
1139 %endif
1140 # do not eat all memory
1141 echo "Available memory:"
1142 free -h
1143 echo "System limits:"
1144 ulimit -a
1145 if test -n "$CEPH_SMP_NCPUS" -a "$CEPH_SMP_NCPUS" -gt 1 ; then
1146 mem_per_process=2500
1147 max_mem=$(LANG=C free -m | sed -n "s|^Mem: *\([0-9]*\).*$|\1|p")
1148 max_jobs="$(($max_mem / $mem_per_process))"
1149 test "$CEPH_SMP_NCPUS" -gt "$max_jobs" && CEPH_SMP_NCPUS="$max_jobs" && echo "Warning: Reducing build parallelism to -j$max_jobs because of memory limits"
1150 test "$CEPH_SMP_NCPUS" -le 0 && CEPH_SMP_NCPUS="1" && echo "Warning: Not using parallel build at all because of memory limits"
1151 fi
1152 export CEPH_SMP_NCPUS
1153 export CEPH_MFLAGS_JOBS="-j$CEPH_SMP_NCPUS"
1154
1155 env | sort
1156
1157 mkdir build
1158 cd build
1159 %if 0%{?rhel} == 7
1160 CMAKE=cmake3
1161 %else
1162 CMAKE=cmake
1163 %endif
1164 ${CMAKE} .. \
1165 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
1166 -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
1167 -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
1168 -DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \
1169 -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
1170 -DCMAKE_INSTALL_MANDIR=%{_mandir} \
1171 -DCMAKE_INSTALL_DOCDIR=%{_docdir}/ceph \
1172 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
1173 -DWITH_MANPAGE=ON \
1174 -DWITH_PYTHON3=%{python3_version} \
1175 -DWITH_MGR_DASHBOARD_FRONTEND=OFF \
1176 %if %{with python2}
1177 -DWITH_PYTHON2=ON \
1178 %else
1179 -DWITH_PYTHON2=OFF \
1180 -DMGR_PYTHON_VERSION=3 \
1181 %endif
1182 %if 0%{without ceph_test_package}
1183 -DWITH_TESTS=OFF \
1184 %endif
1185 %if 0%{with cephfs_java}
1186 -DWITH_CEPHFS_JAVA=ON \
1187 %endif
1188 %if 0%{with selinux}
1189 -DWITH_SELINUX=ON \
1190 %endif
1191 %if %{with lttng}
1192 -DWITH_LTTNG=ON \
1193 -DWITH_BABELTRACE=ON \
1194 %else
1195 -DWITH_LTTNG=OFF \
1196 -DWITH_BABELTRACE=OFF \
1197 %endif
1198 $CEPH_EXTRA_CMAKE_ARGS \
1199 %if 0%{with ocf}
1200 -DWITH_OCF=ON \
1201 %endif
1202 %ifarch aarch64 armv7hl mips mipsel ppc ppc64 ppc64le %{ix86} x86_64
1203 -DWITH_BOOST_CONTEXT=ON \
1204 %else
1205 -DWITH_BOOST_CONTEXT=OFF \
1206 %endif
1207 %if 0%{with cephfs_shell}
1208 -DWITH_CEPHFS_SHELL=ON \
1209 %endif
1210 %if 0%{with libradosstriper}
1211 -DWITH_LIBRADOSSTRIPER=ON \
1212 %else
1213 -DWITH_LIBRADOSSTRIPER=OFF \
1214 %endif
1215 %if 0%{with amqp_endpoint}
1216 -DWITH_RADOSGW_AMQP_ENDPOINT=ON \
1217 %else
1218 -DWITH_RADOSGW_AMQP_ENDPOINT=OFF \
1219 %endif
1220 -DBOOST_J=$CEPH_SMP_NCPUS \
1221 -DWITH_GRAFANA=ON
1222
1223 make "$CEPH_MFLAGS_JOBS"
1224
1225
1226 %if 0%{with make_check}
1227 %check
1228 # run in-tree unittests
1229 cd build
1230 ctest "$CEPH_MFLAGS_JOBS"
1231 %endif
1232
1233
1234 %install
1235 pushd build
1236 make DESTDIR=%{buildroot} install
1237 # we have dropped sysvinit bits
1238 rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
1239 popd
1240 install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
1241 %if 0%{?fedora} || 0%{?rhel}
1242 install -m 0644 -D etc/sysconfig/ceph %{buildroot}%{_sysconfdir}/sysconfig/ceph
1243 %endif
1244 %if 0%{?suse_version}
1245 install -m 0644 -D etc/sysconfig/ceph %{buildroot}%{_fillupdir}/sysconfig.%{name}
1246 %endif
1247 install -m 0644 -D systemd/ceph.tmpfiles.d %{buildroot}%{_tmpfilesdir}/ceph-common.conf
1248 install -m 0644 -D systemd/50-ceph.preset %{buildroot}%{_libexecdir}/systemd/system-preset/50-ceph.preset
1249 mkdir -p %{buildroot}%{_sbindir}
1250 install -m 0644 -D src/logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/ceph
1251 chmod 0644 %{buildroot}%{_docdir}/ceph/sample.ceph.conf
1252 install -m 0644 -D COPYING %{buildroot}%{_docdir}/ceph/COPYING
1253 install -m 0644 -D etc/sysctl/90-ceph-osd.conf %{buildroot}%{_sysctldir}/90-ceph-osd.conf
1254
1255 # firewall templates and /sbin/mount.ceph symlink
1256 %if 0%{?suse_version}
1257 mkdir -p %{buildroot}/sbin
1258 ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
1259 %endif
1260
1261 # udev rules
1262 install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
1263
1264 # sudoers.d
1265 install -m 0600 -D sudoers.d/ceph-osd-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
1266
1267 #set up placeholder directories
1268 mkdir -p %{buildroot}%{_sysconfdir}/ceph
1269 mkdir -p %{buildroot}%{_localstatedir}/run/ceph
1270 mkdir -p %{buildroot}%{_localstatedir}/log/ceph
1271 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/tmp
1272 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mon
1273 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/osd
1274 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mds
1275 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mgr
1276 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/crash
1277 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/crash/posted
1278 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/radosgw
1279 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-osd
1280 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mds
1281 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rgw
1282 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mgr
1283 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd
1284 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd-mirror
1285
1286 %if 0%{?suse_version}
1287 # create __pycache__ directories and their contents
1288 %py3_compile %{buildroot}%{python3_sitelib}
1289 # prometheus alerts
1290 install -m 644 -D monitoring/prometheus/alerts/ceph_default_alerts.yml %{buildroot}/etc/prometheus/SUSE/default_rules/ceph_default_alerts.yml
1291 # hardlink duplicate files under /usr to save space
1292 %fdupes %{buildroot}%{_prefix}
1293 %endif
1294
1295 %if 0%{?rhel} == 8
1296 %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}
1297 %endif
1298
1299 %clean
1300 rm -rf %{buildroot}
1301
1302 #################################################################################
1303 # files and systemd scriptlets
1304 #################################################################################
1305 %files
1306
1307 %files base
1308 %{_bindir}/ceph-crash
1309 %{_bindir}/crushtool
1310 %{_bindir}/monmaptool
1311 %{_bindir}/osdmaptool
1312 %{_bindir}/ceph-kvstore-tool
1313 %{_bindir}/ceph-run
1314 %{_libexecdir}/systemd/system-preset/50-ceph.preset
1315 %{_sbindir}/ceph-create-keys
1316 %dir %{_libexecdir}/ceph
1317 %{_libexecdir}/ceph/ceph_common.sh
1318 %dir %{_libdir}/rados-classes
1319 %{_libdir}/rados-classes/*
1320 %dir %{_libdir}/ceph
1321 %dir %{_libdir}/ceph/erasure-code
1322 %{_libdir}/ceph/erasure-code/libec_*.so*
1323 %dir %{_libdir}/ceph/compressor
1324 %{_libdir}/ceph/compressor/libceph_*.so*
1325 %{_unitdir}/ceph-crash.service
1326 %dir %{_libdir}/ceph/crypto
1327 %{_libdir}/ceph/crypto/libceph_*.so*
1328 %if %{with lttng}
1329 %{_libdir}/libos_tp.so*
1330 %{_libdir}/libosd_tp.so*
1331 %endif
1332 %config(noreplace) %{_sysconfdir}/logrotate.d/ceph
1333 %if 0%{?fedora} || 0%{?rhel}
1334 %config(noreplace) %{_sysconfdir}/sysconfig/ceph
1335 %endif
1336 %if 0%{?suse_version}
1337 %{_fillupdir}/sysconfig.*
1338 %endif
1339 %{_unitdir}/ceph.target
1340 %if 0%{with python2}
1341 %dir %{python_sitelib}/ceph_volume
1342 %{python_sitelib}/ceph_volume/*
1343 %{python_sitelib}/ceph_volume-*
1344 %else
1345 %dir %{python3_sitelib}/ceph_volume
1346 %{python3_sitelib}/ceph_volume/*
1347 %{python3_sitelib}/ceph_volume-*
1348 %endif
1349 %{_mandir}/man8/ceph-deploy.8*
1350 %{_mandir}/man8/ceph-create-keys.8*
1351 %{_mandir}/man8/ceph-run.8*
1352 %{_mandir}/man8/crushtool.8*
1353 %{_mandir}/man8/osdmaptool.8*
1354 %{_mandir}/man8/monmaptool.8*
1355 %{_mandir}/man8/ceph-kvstore-tool.8*
1356 #set up placeholder directories
1357 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/crash
1358 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/crash/posted
1359 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/tmp
1360 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-osd
1361 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mds
1362 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rgw
1363 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
1364 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
1365 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd-mirror
1366
1367 %post base
1368 /sbin/ldconfig
1369 %if 0%{?suse_version}
1370 %fillup_only
1371 if [ $1 -eq 1 ] ; then
1372 /usr/bin/systemctl preset ceph.target ceph-crash.service >/dev/null 2>&1 || :
1373 fi
1374 %endif
1375 %if 0%{?fedora} || 0%{?rhel}
1376 %systemd_post ceph.target ceph-crash.service
1377 %endif
1378 if [ $1 -eq 1 ] ; then
1379 /usr/bin/systemctl start ceph.target ceph-crash.service >/dev/null 2>&1 || :
1380 fi
1381
1382 %preun base
1383 %if 0%{?suse_version}
1384 %service_del_preun ceph.target ceph-crash.service
1385 %endif
1386 %if 0%{?fedora} || 0%{?rhel}
1387 %systemd_preun ceph.target ceph-crash.service
1388 %endif
1389
1390 %postun base
1391 /sbin/ldconfig
1392 %if 0%{?suse_version}
1393 DISABLE_RESTART_ON_UPDATE="yes"
1394 %service_del_postun ceph.target
1395 %endif
1396 %if 0%{?fedora} || 0%{?rhel}
1397 %systemd_postun ceph.target
1398 %endif
1399 if [ $1 -ge 1 ] ; then
1400 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1401 # "yes". In any case: if units are not running, do not touch them.
1402 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1403 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1404 source $SYSCONF_CEPH
1405 fi
1406 fi
1407
1408 %files common
1409 %dir %{_docdir}/ceph
1410 %doc %{_docdir}/ceph/sample.ceph.conf
1411 %license %{_docdir}/ceph/COPYING
1412 %{_bindir}/ceph
1413 %{_bindir}/ceph-authtool
1414 %{_bindir}/ceph-conf
1415 %{_bindir}/ceph-dencoder
1416 %{_bindir}/ceph-rbdnamer
1417 %{_bindir}/ceph-syn
1418 %{_bindir}/cephfs-data-scan
1419 %{_bindir}/cephfs-journal-tool
1420 %{_bindir}/cephfs-table-tool
1421 %{_bindir}/rados
1422 %{_bindir}/radosgw-admin
1423 %{_bindir}/rbd
1424 %{_bindir}/rbd-replay
1425 %{_bindir}/rbd-replay-many
1426 %{_bindir}/rbdmap
1427 %{_sbindir}/mount.ceph
1428 %if 0%{?suse_version}
1429 /sbin/mount.ceph
1430 %endif
1431 %if %{with lttng}
1432 %{_bindir}/rbd-replay-prep
1433 %endif
1434 %{_bindir}/ceph-post-file
1435 %{_tmpfilesdir}/ceph-common.conf
1436 %{_mandir}/man8/ceph-authtool.8*
1437 %{_mandir}/man8/ceph-conf.8*
1438 %{_mandir}/man8/ceph-dencoder.8*
1439 %{_mandir}/man8/ceph-rbdnamer.8*
1440 %{_mandir}/man8/ceph-syn.8*
1441 %{_mandir}/man8/ceph-post-file.8*
1442 %{_mandir}/man8/ceph.8*
1443 %{_mandir}/man8/mount.ceph.8*
1444 %{_mandir}/man8/rados.8*
1445 %{_mandir}/man8/radosgw-admin.8*
1446 %{_mandir}/man8/rbd.8*
1447 %{_mandir}/man8/rbdmap.8*
1448 %{_mandir}/man8/rbd-replay.8*
1449 %{_mandir}/man8/rbd-replay-many.8*
1450 %{_mandir}/man8/rbd-replay-prep.8*
1451 %dir %{_datadir}/ceph/
1452 %{_datadir}/ceph/known_hosts_drop.ceph.com
1453 %{_datadir}/ceph/id_rsa_drop.ceph.com
1454 %{_datadir}/ceph/id_rsa_drop.ceph.com.pub
1455 %dir %{_sysconfdir}/ceph/
1456 %config %{_sysconfdir}/bash_completion.d/ceph
1457 %config %{_sysconfdir}/bash_completion.d/rados
1458 %config %{_sysconfdir}/bash_completion.d/rbd
1459 %config %{_sysconfdir}/bash_completion.d/radosgw-admin
1460 %config(noreplace) %{_sysconfdir}/ceph/rbdmap
1461 %{_unitdir}/rbdmap.service
1462 %dir %{_udevrulesdir}
1463 %{_udevrulesdir}/50-rbd.rules
1464 %attr(3770,ceph,ceph) %dir %{_localstatedir}/log/ceph/
1465 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/
1466
1467 %pre common
1468 CEPH_GROUP_ID=167
1469 CEPH_USER_ID=167
1470 %if 0%{?rhel} || 0%{?fedora}
1471 /usr/sbin/groupadd ceph -g $CEPH_GROUP_ID -o -r 2>/dev/null || :
1472 /usr/sbin/useradd ceph -u $CEPH_USER_ID -o -r -g ceph -s /sbin/nologin -c "Ceph daemons" -d %{_localstatedir}/lib/ceph 2>/dev/null || :
1473 %endif
1474 %if 0%{?suse_version}
1475 if ! getent group ceph >/dev/null ; then
1476 CEPH_GROUP_ID_OPTION=""
1477 getent group $CEPH_GROUP_ID >/dev/null || CEPH_GROUP_ID_OPTION="-g $CEPH_GROUP_ID"
1478 groupadd ceph $CEPH_GROUP_ID_OPTION -r 2>/dev/null || :
1479 fi
1480 if ! getent passwd ceph >/dev/null ; then
1481 CEPH_USER_ID_OPTION=""
1482 getent passwd $CEPH_USER_ID >/dev/null || CEPH_USER_ID_OPTION="-u $CEPH_USER_ID"
1483 useradd ceph $CEPH_USER_ID_OPTION -r -g ceph -s /sbin/nologin 2>/dev/null || :
1484 fi
1485 usermod -c "Ceph storage service" \
1486 -d %{_localstatedir}/lib/ceph \
1487 -g ceph \
1488 -s /sbin/nologin \
1489 ceph
1490 %endif
1491 exit 0
1492
1493 %post common
1494 %tmpfiles_create %{_tmpfilesdir}/ceph-common.conf
1495
1496 %postun common
1497 # Package removal cleanup
1498 if [ "$1" -eq "0" ] ; then
1499 rm -rf %{_localstatedir}/log/ceph
1500 rm -rf %{_sysconfdir}/ceph
1501 fi
1502
1503 %files mds
1504 %{_bindir}/ceph-mds
1505 %{_mandir}/man8/ceph-mds.8*
1506 %{_unitdir}/ceph-mds@.service
1507 %{_unitdir}/ceph-mds.target
1508 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mds
1509
1510 %post mds
1511 %if 0%{?suse_version}
1512 if [ $1 -eq 1 ] ; then
1513 /usr/bin/systemctl preset ceph-mds@\*.service ceph-mds.target >/dev/null 2>&1 || :
1514 fi
1515 %endif
1516 %if 0%{?fedora} || 0%{?rhel}
1517 %systemd_post ceph-mds@\*.service ceph-mds.target
1518 %endif
1519 if [ $1 -eq 1 ] ; then
1520 /usr/bin/systemctl start ceph-mds.target >/dev/null 2>&1 || :
1521 fi
1522
1523 %preun mds
1524 %if 0%{?suse_version}
1525 %service_del_preun ceph-mds@\*.service ceph-mds.target
1526 %endif
1527 %if 0%{?fedora} || 0%{?rhel}
1528 %systemd_preun ceph-mds@\*.service ceph-mds.target
1529 %endif
1530
1531 %postun mds
1532 %if 0%{?suse_version}
1533 DISABLE_RESTART_ON_UPDATE="yes"
1534 %service_del_postun ceph-mds@\*.service ceph-mds.target
1535 %endif
1536 %if 0%{?fedora} || 0%{?rhel}
1537 %systemd_postun ceph-mds@\*.service ceph-mds.target
1538 %endif
1539 if [ $1 -ge 1 ] ; then
1540 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1541 # "yes". In any case: if units are not running, do not touch them.
1542 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1543 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1544 source $SYSCONF_CEPH
1545 fi
1546 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1547 /usr/bin/systemctl try-restart ceph-mds@\*.service > /dev/null 2>&1 || :
1548 fi
1549 fi
1550
1551 %files mgr
1552 %{_bindir}/ceph-mgr
1553 %dir %{_datadir}/ceph/mgr
1554 %{_datadir}/ceph/mgr/alerts
1555 %{_datadir}/ceph/mgr/ansible
1556 %{_datadir}/ceph/mgr/balancer
1557 %{_datadir}/ceph/mgr/crash
1558 %{_datadir}/ceph/mgr/deepsea
1559 %{_datadir}/ceph/mgr/devicehealth
1560 %{_datadir}/ceph/mgr/influx
1561 %{_datadir}/ceph/mgr/insights
1562 %{_datadir}/ceph/mgr/iostat
1563 %{_datadir}/ceph/mgr/localpool
1564 %{_datadir}/ceph/mgr/mgr_module.*
1565 %{_datadir}/ceph/mgr/mgr_util.*
1566 %{_datadir}/ceph/mgr/orchestrator_cli
1567 %{_datadir}/ceph/mgr/orchestrator.*
1568 %{_datadir}/ceph/mgr/osd_perf_query
1569 %{_datadir}/ceph/mgr/pg_autoscaler
1570 %{_datadir}/ceph/mgr/progress
1571 %{_datadir}/ceph/mgr/prometheus
1572 %{_datadir}/ceph/mgr/rbd_support
1573 %{_datadir}/ceph/mgr/restful
1574 %{_datadir}/ceph/mgr/selftest
1575 %{_datadir}/ceph/mgr/status
1576 %{_datadir}/ceph/mgr/telegraf
1577 %{_datadir}/ceph/mgr/telemetry
1578 %{_datadir}/ceph/mgr/test_orchestrator
1579 %{_datadir}/ceph/mgr/volumes
1580 %{_datadir}/ceph/mgr/zabbix
1581 %{_unitdir}/ceph-mgr@.service
1582 %{_unitdir}/ceph-mgr.target
1583 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mgr
1584
1585 %post mgr
1586 %if 0%{?suse_version}
1587 if [ $1 -eq 1 ] ; then
1588 /usr/bin/systemctl preset ceph-mgr@\*.service ceph-mgr.target >/dev/null 2>&1 || :
1589 fi
1590 %endif
1591 %if 0%{?fedora} || 0%{?rhel}
1592 %systemd_post ceph-mgr@\*.service ceph-mgr.target
1593 %endif
1594 if [ $1 -eq 1 ] ; then
1595 /usr/bin/systemctl start ceph-mgr.target >/dev/null 2>&1 || :
1596 fi
1597
1598 %preun mgr
1599 %if 0%{?suse_version}
1600 %service_del_preun ceph-mgr@\*.service ceph-mgr.target
1601 %endif
1602 %if 0%{?fedora} || 0%{?rhel}
1603 %systemd_preun ceph-mgr@\*.service ceph-mgr.target
1604 %endif
1605
1606 %postun mgr
1607 %if 0%{?suse_version}
1608 DISABLE_RESTART_ON_UPDATE="yes"
1609 %service_del_postun ceph-mgr@\*.service ceph-mgr.target
1610 %endif
1611 %if 0%{?fedora} || 0%{?rhel}
1612 %systemd_postun ceph-mgr@\*.service ceph-mgr.target
1613 %endif
1614 if [ $1 -ge 1 ] ; then
1615 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1616 # "yes". In any case: if units are not running, do not touch them.
1617 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1618 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1619 source $SYSCONF_CEPH
1620 fi
1621 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1622 /usr/bin/systemctl try-restart ceph-mgr@\*.service > /dev/null 2>&1 || :
1623 fi
1624 fi
1625
1626 %files mgr-dashboard
1627 %{_datadir}/ceph/mgr/dashboard
1628
1629 %post mgr-dashboard
1630 if [ $1 -eq 1 ] ; then
1631 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1632 fi
1633
1634 %postun mgr-dashboard
1635 if [ $1 -eq 1 ] ; then
1636 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1637 fi
1638
1639 %files mgr-diskprediction-local
1640 %{_datadir}/ceph/mgr/diskprediction_local
1641
1642 %post mgr-diskprediction-local
1643 if [ $1 -eq 1 ] ; then
1644 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1645 fi
1646
1647 %postun mgr-diskprediction-local
1648 if [ $1 -eq 1 ] ; then
1649 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1650 fi
1651
1652 %files mgr-diskprediction-cloud
1653 %{_datadir}/ceph/mgr/diskprediction_cloud
1654
1655 %post mgr-diskprediction-cloud
1656 if [ $1 -eq 1 ] ; then
1657 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1658 fi
1659
1660 %postun mgr-diskprediction-cloud
1661 if [ $1 -eq 1 ] ; then
1662 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1663 fi
1664
1665 %files mgr-rook
1666 %{_datadir}/ceph/mgr/rook
1667
1668 %post mgr-rook
1669 if [ $1 -eq 1 ] ; then
1670 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1671 fi
1672
1673 %postun mgr-rook
1674 if [ $1 -eq 1 ] ; then
1675 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1676 fi
1677
1678 %files mgr-k8sevents
1679 %{_datadir}/ceph/mgr/k8sevents
1680
1681 %post mgr-k8sevents
1682 if [ $1 -eq 1 ] ; then
1683 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1684 fi
1685
1686 %postun mgr-k8sevents
1687 if [ $1 -eq 1 ] ; then
1688 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1689 fi
1690
1691 %files mgr-ssh
1692 %{_datadir}/ceph/mgr/ssh
1693
1694 %post mgr-ssh
1695 if [ $1 -eq 1 ] ; then
1696 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1697 fi
1698
1699 %postun mgr-ssh
1700 if [ $1 -eq 1 ] ; then
1701 /usr/bin/systemctl try-restart ceph-mgr.target >/dev/null 2>&1 || :
1702 fi
1703
1704 %files mon
1705 %{_bindir}/ceph-mon
1706 %{_bindir}/ceph-monstore-tool
1707 %{_mandir}/man8/ceph-mon.8*
1708 %{_unitdir}/ceph-mon@.service
1709 %{_unitdir}/ceph-mon.target
1710 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mon
1711
1712 %post mon
1713 %if 0%{?suse_version}
1714 if [ $1 -eq 1 ] ; then
1715 /usr/bin/systemctl preset ceph-mon@\*.service ceph-mon.target >/dev/null 2>&1 || :
1716 fi
1717 %endif
1718 %if 0%{?fedora} || 0%{?rhel}
1719 %systemd_post ceph-mon@\*.service ceph-mon.target
1720 %endif
1721 if [ $1 -eq 1 ] ; then
1722 /usr/bin/systemctl start ceph-mon.target >/dev/null 2>&1 || :
1723 fi
1724
1725 %preun mon
1726 %if 0%{?suse_version}
1727 %service_del_preun ceph-mon@\*.service ceph-mon.target
1728 %endif
1729 %if 0%{?fedora} || 0%{?rhel}
1730 %systemd_preun ceph-mon@\*.service ceph-mon.target
1731 %endif
1732
1733 %postun mon
1734 %if 0%{?suse_version}
1735 DISABLE_RESTART_ON_UPDATE="yes"
1736 %service_del_postun ceph-mon@\*.service ceph-mon.target
1737 %endif
1738 %if 0%{?fedora} || 0%{?rhel}
1739 %systemd_postun ceph-mon@\*.service ceph-mon.target
1740 %endif
1741 if [ $1 -ge 1 ] ; then
1742 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1743 # "yes". In any case: if units are not running, do not touch them.
1744 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1745 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1746 source $SYSCONF_CEPH
1747 fi
1748 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1749 /usr/bin/systemctl try-restart ceph-mon@\*.service > /dev/null 2>&1 || :
1750 fi
1751 fi
1752
1753 %files fuse
1754 %{_bindir}/ceph-fuse
1755 %{_mandir}/man8/ceph-fuse.8*
1756 %{_sbindir}/mount.fuse.ceph
1757 %{_unitdir}/ceph-fuse@.service
1758 %{_unitdir}/ceph-fuse.target
1759
1760 %files -n rbd-fuse
1761 %{_bindir}/rbd-fuse
1762 %{_mandir}/man8/rbd-fuse.8*
1763
1764 %files -n rbd-mirror
1765 %{_bindir}/rbd-mirror
1766 %{_mandir}/man8/rbd-mirror.8*
1767 %{_unitdir}/ceph-rbd-mirror@.service
1768 %{_unitdir}/ceph-rbd-mirror.target
1769
1770 %post -n rbd-mirror
1771 %if 0%{?suse_version}
1772 if [ $1 -eq 1 ] ; then
1773 /usr/bin/systemctl preset ceph-rbd-mirror@\*.service ceph-rbd-mirror.target >/dev/null 2>&1 || :
1774 fi
1775 %endif
1776 %if 0%{?fedora} || 0%{?rhel}
1777 %systemd_post ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1778 %endif
1779 if [ $1 -eq 1 ] ; then
1780 /usr/bin/systemctl start ceph-rbd-mirror.target >/dev/null 2>&1 || :
1781 fi
1782
1783 %preun -n rbd-mirror
1784 %if 0%{?suse_version}
1785 %service_del_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1786 %endif
1787 %if 0%{?fedora} || 0%{?rhel}
1788 %systemd_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1789 %endif
1790
1791 %postun -n rbd-mirror
1792 %if 0%{?suse_version}
1793 DISABLE_RESTART_ON_UPDATE="yes"
1794 %service_del_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1795 %endif
1796 %if 0%{?fedora} || 0%{?rhel}
1797 %systemd_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1798 %endif
1799 if [ $1 -ge 1 ] ; then
1800 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1801 # "yes". In any case: if units are not running, do not touch them.
1802 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1803 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1804 source $SYSCONF_CEPH
1805 fi
1806 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1807 /usr/bin/systemctl try-restart ceph-rbd-mirror@\*.service > /dev/null 2>&1 || :
1808 fi
1809 fi
1810
1811 %files -n rbd-nbd
1812 %{_bindir}/rbd-nbd
1813 %{_mandir}/man8/rbd-nbd.8*
1814
1815 %files radosgw
1816 %{_bindir}/radosgw
1817 %{_bindir}/radosgw-token
1818 %{_bindir}/radosgw-es
1819 %{_bindir}/radosgw-object-expirer
1820 %{_mandir}/man8/radosgw.8*
1821 %dir %{_localstatedir}/lib/ceph/radosgw
1822 %{_unitdir}/ceph-radosgw@.service
1823 %{_unitdir}/ceph-radosgw.target
1824
1825 %post radosgw
1826 %if 0%{?suse_version}
1827 if [ $1 -eq 1 ] ; then
1828 /usr/bin/systemctl preset ceph-radosgw@\*.service ceph-radosgw.target >/dev/null 2>&1 || :
1829 fi
1830 %endif
1831 %if 0%{?fedora} || 0%{?rhel}
1832 %systemd_post ceph-radosgw@\*.service ceph-radosgw.target
1833 %endif
1834 if [ $1 -eq 1 ] ; then
1835 /usr/bin/systemctl start ceph-radosgw.target >/dev/null 2>&1 || :
1836 fi
1837
1838 %preun radosgw
1839 %if 0%{?suse_version}
1840 %service_del_preun ceph-radosgw@\*.service ceph-radosgw.target
1841 %endif
1842 %if 0%{?fedora} || 0%{?rhel}
1843 %systemd_preun ceph-radosgw@\*.service ceph-radosgw.target
1844 %endif
1845
1846 %postun radosgw
1847 %if 0%{?suse_version}
1848 DISABLE_RESTART_ON_UPDATE="yes"
1849 %service_del_postun ceph-radosgw@\*.service ceph-radosgw.target
1850 %endif
1851 %if 0%{?fedora} || 0%{?rhel}
1852 %systemd_postun ceph-radosgw@\*.service ceph-radosgw.target
1853 %endif
1854 if [ $1 -ge 1 ] ; then
1855 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1856 # "yes". In any case: if units are not running, do not touch them.
1857 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1858 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1859 source $SYSCONF_CEPH
1860 fi
1861 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1862 /usr/bin/systemctl try-restart ceph-radosgw@\*.service > /dev/null 2>&1 || :
1863 fi
1864 fi
1865
1866 %files osd
1867 %{_bindir}/ceph-clsinfo
1868 %{_bindir}/ceph-bluestore-tool
1869 %{_bindir}/ceph-objectstore-tool
1870 %{_bindir}/ceph-osdomap-tool
1871 %{_bindir}/ceph-osd
1872 %{_libexecdir}/ceph/ceph-osd-prestart.sh
1873 %{_sbindir}/ceph-volume
1874 %{_sbindir}/ceph-volume-systemd
1875 %{_mandir}/man8/ceph-clsinfo.8*
1876 %{_mandir}/man8/ceph-osd.8*
1877 %{_mandir}/man8/ceph-bluestore-tool.8*
1878 %{_mandir}/man8/ceph-volume.8*
1879 %{_mandir}/man8/ceph-volume-systemd.8*
1880 %{_unitdir}/ceph-osd@.service
1881 %{_unitdir}/ceph-osd.target
1882 %{_unitdir}/ceph-volume@.service
1883 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
1884 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
1885 %{_sysconfdir}/sudoers.d/ceph-osd-smartctl
1886
1887 %post osd
1888 %if 0%{?suse_version}
1889 if [ $1 -eq 1 ] ; then
1890 /usr/bin/systemctl preset ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target >/dev/null 2>&1 || :
1891 fi
1892 %endif
1893 %if 0%{?fedora} || 0%{?rhel}
1894 %systemd_post ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target
1895 %endif
1896 if [ $1 -eq 1 ] ; then
1897 /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || :
1898 fi
1899 %if 0%{?sysctl_apply}
1900 %sysctl_apply 90-ceph-osd.conf
1901 %else
1902 /usr/lib/systemd/systemd-sysctl %{_sysctldir}/90-ceph-osd.conf > /dev/null 2>&1 || :
1903 %endif
1904
1905 %preun osd
1906 %if 0%{?suse_version}
1907 %service_del_preun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target
1908 %endif
1909 %if 0%{?fedora} || 0%{?rhel}
1910 %systemd_preun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target
1911 %endif
1912
1913 %postun osd
1914 %if 0%{?suse_version}
1915 DISABLE_RESTART_ON_UPDATE="yes"
1916 %service_del_postun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target
1917 %endif
1918 %if 0%{?fedora} || 0%{?rhel}
1919 %systemd_postun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target
1920 %endif
1921 if [ $1 -ge 1 ] ; then
1922 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1923 # "yes". In any case: if units are not running, do not touch them.
1924 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1925 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1926 source $SYSCONF_CEPH
1927 fi
1928 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1929 /usr/bin/systemctl try-restart ceph-osd@\*.service ceph-volume@\*.service > /dev/null 2>&1 || :
1930 fi
1931 fi
1932
1933 %if %{with ocf}
1934
1935 %files resource-agents
1936 %dir %{_prefix}/lib/ocf
1937 %dir %{_prefix}/lib/ocf/resource.d
1938 %dir %{_prefix}/lib/ocf/resource.d/ceph
1939 %attr(0755,-,-) %{_prefix}/lib/ocf/resource.d/ceph/rbd
1940
1941 %endif
1942
1943 %files -n librados2
1944 %{_libdir}/librados.so.*
1945 %dir %{_libdir}/ceph
1946 %{_libdir}/ceph/libceph-common.so.*
1947 %if %{with lttng}
1948 %{_libdir}/librados_tp.so.*
1949 %endif
1950 %dir %{_sysconfdir}/ceph
1951
1952 %post -n librados2 -p /sbin/ldconfig
1953
1954 %postun -n librados2 -p /sbin/ldconfig
1955
1956 %files -n librados-devel
1957 %dir %{_includedir}/rados
1958 %{_includedir}/rados/librados.h
1959 %{_includedir}/rados/rados_types.h
1960 %{_libdir}/librados.so
1961 %if %{with lttng}
1962 %{_libdir}/librados_tp.so
1963 %endif
1964 %{_bindir}/librados-config
1965 %{_mandir}/man8/librados-config.8*
1966
1967 %files -n libradospp-devel
1968 %dir %{_includedir}/rados
1969 %{_includedir}/rados/buffer.h
1970 %{_includedir}/rados/buffer_fwd.h
1971 %{_includedir}/rados/crc32c.h
1972 %{_includedir}/rados/inline_memory.h
1973 %{_includedir}/rados/librados.hpp
1974 %{_includedir}/rados/librados_fwd.hpp
1975 %{_includedir}/rados/page.h
1976 %{_includedir}/rados/rados_types.hpp
1977
1978 %if 0%{with python2}
1979 %files -n python-rados
1980 %{python_sitearch}/rados.so
1981 %{python_sitearch}/rados-*.egg-info
1982 %endif
1983
1984 %files -n python%{python3_pkgversion}-rados
1985 %{python3_sitearch}/rados.cpython*.so
1986 %{python3_sitearch}/rados-*.egg-info
1987
1988 %if 0%{with libradosstriper}
1989 %files -n libradosstriper1
1990 %{_libdir}/libradosstriper.so.*
1991
1992 %post -n libradosstriper1 -p /sbin/ldconfig
1993
1994 %postun -n libradosstriper1 -p /sbin/ldconfig
1995
1996 %files -n libradosstriper-devel
1997 %dir %{_includedir}/radosstriper
1998 %{_includedir}/radosstriper/libradosstriper.h
1999 %{_includedir}/radosstriper/libradosstriper.hpp
2000 %{_libdir}/libradosstriper.so
2001 %endif
2002
2003 %files -n librbd1
2004 %{_libdir}/librbd.so.*
2005 %if %{with lttng}
2006 %{_libdir}/librbd_tp.so.*
2007 %endif
2008
2009 %post -n librbd1 -p /sbin/ldconfig
2010
2011 %postun -n librbd1 -p /sbin/ldconfig
2012
2013 %files -n librbd-devel
2014 %dir %{_includedir}/rbd
2015 %{_includedir}/rbd/librbd.h
2016 %{_includedir}/rbd/librbd.hpp
2017 %{_includedir}/rbd/features.h
2018 %{_libdir}/librbd.so
2019 %if %{with lttng}
2020 %{_libdir}/librbd_tp.so
2021 %endif
2022
2023 %files -n librgw2
2024 %{_libdir}/librgw.so.*
2025 %{_libdir}/librgw_admin_user.so.*
2026 %if %{with lttng}
2027 %{_libdir}/librgw_op_tp.so.*
2028 %{_libdir}/librgw_rados_tp.so.*
2029 %endif
2030
2031 %post -n librgw2 -p /sbin/ldconfig
2032
2033 %postun -n librgw2 -p /sbin/ldconfig
2034
2035 %files -n librgw-devel
2036 %dir %{_includedir}/rados
2037 %{_includedir}/rados/librgw.h
2038 %{_includedir}/rados/librgw_admin_user.h
2039 %{_includedir}/rados/rgw_file.h
2040 %{_libdir}/librgw.so
2041 %{_libdir}/librgw_admin_user.so
2042 %if %{with lttng}
2043 %{_libdir}/librgw_op_tp.so
2044 %{_libdir}/librgw_rados_tp.so
2045 %endif
2046
2047 %if 0%{with python2}
2048 %files -n python-rgw
2049 %{python_sitearch}/rgw.so
2050 %{python_sitearch}/rgw-*.egg-info
2051 %endif
2052
2053 %files -n python%{python3_pkgversion}-rgw
2054 %{python3_sitearch}/rgw.cpython*.so
2055 %{python3_sitearch}/rgw-*.egg-info
2056
2057 %if 0%{with python2}
2058 %files -n python-rbd
2059 %{python_sitearch}/rbd.so
2060 %{python_sitearch}/rbd-*.egg-info
2061 %endif
2062
2063 %files -n python%{python3_pkgversion}-rbd
2064 %{python3_sitearch}/rbd.cpython*.so
2065 %{python3_sitearch}/rbd-*.egg-info
2066
2067 %files -n libcephfs2
2068 %{_libdir}/libcephfs.so.*
2069 %dir %{_sysconfdir}/ceph
2070
2071 %post -n libcephfs2 -p /sbin/ldconfig
2072
2073 %postun -n libcephfs2 -p /sbin/ldconfig
2074
2075 %files -n libcephfs-devel
2076 %dir %{_includedir}/cephfs
2077 %{_includedir}/cephfs/libcephfs.h
2078 %{_includedir}/cephfs/ceph_statx.h
2079 %{_libdir}/libcephfs.so
2080
2081 %if 0%{with python2}
2082 %files -n python-cephfs
2083 %{python_sitearch}/cephfs.so
2084 %{python_sitearch}/cephfs-*.egg-info
2085 %{python_sitelib}/ceph_volume_client.py*
2086 %endif
2087
2088 %files -n python%{python3_pkgversion}-cephfs
2089 %{python3_sitearch}/cephfs.cpython*.so
2090 %{python3_sitearch}/cephfs-*.egg-info
2091 %{python3_sitelib}/ceph_volume_client.py
2092 %{python3_sitelib}/__pycache__/ceph_volume_client.cpython*.py*
2093
2094 %if 0%{with python2}
2095 %files -n python-ceph-argparse
2096 %{python_sitelib}/ceph_argparse.py*
2097 %{python_sitelib}/ceph_daemon.py*
2098 %endif
2099
2100 %files -n python%{python3_pkgversion}-ceph-argparse
2101 %{python3_sitelib}/ceph_argparse.py
2102 %{python3_sitelib}/__pycache__/ceph_argparse.cpython*.py*
2103 %{python3_sitelib}/ceph_daemon.py
2104 %{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py*
2105
2106 %if 0%{with cephfs_shell}
2107 %files -n cephfs-shell
2108 %{python3_sitelib}/cephfs_shell-*.egg-info
2109 %{_bindir}/cephfs-shell
2110 %endif
2111
2112 %if 0%{with ceph_test_package}
2113 %files -n ceph-test
2114 %{_bindir}/ceph-client-debug
2115 %{_bindir}/ceph_bench_log
2116 %{_bindir}/ceph_kvstorebench
2117 %{_bindir}/ceph_multi_stress_watch
2118 %{_bindir}/ceph_erasure_code
2119 %{_bindir}/ceph_erasure_code_benchmark
2120 %{_bindir}/ceph_omapbench
2121 %{_bindir}/ceph_objectstore_bench
2122 %{_bindir}/ceph_perf_objectstore
2123 %{_bindir}/ceph_perf_local
2124 %{_bindir}/ceph_perf_msgr_client
2125 %{_bindir}/ceph_perf_msgr_server
2126 %{_bindir}/ceph_psim
2127 %{_bindir}/ceph_radosacl
2128 %{_bindir}/ceph_rgw_jsonparser
2129 %{_bindir}/ceph_rgw_multiparser
2130 %{_bindir}/ceph_scratchtool
2131 %{_bindir}/ceph_scratchtoolpp
2132 %{_bindir}/ceph_test_*
2133 %{_bindir}/ceph-coverage
2134 %{_bindir}/ceph-debugpack
2135 %{_bindir}/cephdeduptool
2136 %{_mandir}/man8/ceph-debugpack.8*
2137 %dir %{_libdir}/ceph
2138 %{_libdir}/ceph/ceph-monstore-update-crush.sh
2139 %endif
2140
2141 %if 0%{with cephfs_java}
2142 %files -n libcephfs_jni1
2143 %{_libdir}/libcephfs_jni.so.*
2144
2145 %post -n libcephfs_jni1 -p /sbin/ldconfig
2146
2147 %postun -n libcephfs_jni1 -p /sbin/ldconfig
2148
2149 %files -n libcephfs_jni-devel
2150 %{_libdir}/libcephfs_jni.so
2151
2152 %files -n cephfs-java
2153 %{_javadir}/libcephfs.jar
2154 %{_javadir}/libcephfs-test.jar
2155 %endif
2156
2157 %files -n rados-objclass-devel
2158 %dir %{_includedir}/rados
2159 %{_includedir}/rados/objclass.h
2160
2161 %if 0%{with selinux}
2162 %files selinux
2163 %attr(0600,root,root) %{_datadir}/selinux/packages/ceph.pp
2164 %{_datadir}/selinux/devel/include/contrib/ceph.if
2165 %{_mandir}/man8/ceph_selinux.8*
2166
2167 %post selinux
2168 # backup file_contexts before update
2169 . /etc/selinux/config
2170 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
2171 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
2172
2173 # Install the policy
2174 /usr/sbin/semodule -i %{_datadir}/selinux/packages/ceph.pp
2175
2176 # Load the policy if SELinux is enabled
2177 if ! /usr/sbin/selinuxenabled; then
2178 # Do not relabel if selinux is not enabled
2179 exit 0
2180 fi
2181
2182 if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
2183 # Do not relabel if file contexts did not change
2184 exit 0
2185 fi
2186
2187 # Check whether the daemons are running
2188 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
2189 STATUS=$?
2190
2191 # Stop the daemons if they were running
2192 if test $STATUS -eq 0; then
2193 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
2194 fi
2195
2196 # Relabel the files fix for first package install
2197 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
2198
2199 rm -f ${FILE_CONTEXT}.pre
2200 # The fixfiles command won't fix label for /var/run/ceph
2201 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
2202
2203 # Start the daemons iff they were running before
2204 if test $STATUS -eq 0; then
2205 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
2206 fi
2207 exit 0
2208
2209 %postun selinux
2210 if [ $1 -eq 0 ]; then
2211 # backup file_contexts before update
2212 . /etc/selinux/config
2213 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
2214 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
2215
2216 # Remove the module
2217 /usr/sbin/semodule -n -r ceph > /dev/null 2>&1
2218
2219 # Reload the policy if SELinux is enabled
2220 if ! /usr/sbin/selinuxenabled ; then
2221 # Do not relabel if SELinux is not enabled
2222 exit 0
2223 fi
2224
2225 # Check whether the daemons are running
2226 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
2227 STATUS=$?
2228
2229 # Stop the daemons if they were running
2230 if test $STATUS -eq 0; then
2231 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
2232 fi
2233
2234 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
2235 rm -f ${FILE_CONTEXT}.pre
2236 # The fixfiles command won't fix label for /var/run/ceph
2237 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
2238
2239 # Start the daemons if they were running before
2240 if test $STATUS -eq 0; then
2241 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
2242 fi
2243 fi
2244 exit 0
2245
2246 %endif # with selinux
2247
2248 %if 0%{with python2}
2249 %files -n python-ceph-compat
2250 # We need an empty %%files list for python-ceph-compat, to tell rpmbuild to
2251 # actually build this meta package.
2252 %endif
2253
2254 %files grafana-dashboards
2255 %if 0%{?suse_version}
2256 %attr(0755,root,root) %dir %{_sysconfdir}/grafana
2257 %attr(0755,root,root) %dir %{_sysconfdir}/grafana/dashboards
2258 %attr(0755,root,root) %dir %{_sysconfdir}/grafana/dashboards/ceph-dashboard
2259 %else
2260 %attr(0755,root,root) %dir %{_sysconfdir}/grafana/dashboards/ceph-dashboard
2261 %endif
2262 %config %{_sysconfdir}/grafana/dashboards/ceph-dashboard/*
2263 %doc monitoring/grafana/dashboards/README
2264 %doc monitoring/grafana/README.md
2265
2266 %if 0%{?suse_version}
2267 %files prometheus-alerts
2268 %dir /etc/prometheus/SUSE/
2269 %dir /etc/prometheus/SUSE/default_rules/
2270 %config /etc/prometheus/SUSE/default_rules/ceph_default_alerts.yml
2271 %endif
2272
2273
2274 %changelog