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