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