]> git.proxmox.com Git - ceph.git/blame - ceph/ceph.spec
update sources to v12.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#
5# Copyright (C) 2004-2017 The Ceph Project Developers. See COPYING file
6# at the top-level directory of this distribution and at
7# https://github.com/ceph/ceph/blob/master/COPYING
8#
9# All modifications and additions to the file contributed by third parties
10# remain the property of their copyright owners, unless otherwise agreed
11# upon.
12#
13# This file is under the GNU Lesser General Public License, version 2.1
14#
15# Please submit bugfixes or comments via http://tracker.ceph.com/
d2e6a577 16#
7c673cae
FG
17%bcond_without ocf
18%bcond_without cephfs_java
19%if 0%{?suse_version}
20%bcond_with ceph_test_package
21%else
22%bcond_without ceph_test_package
23%endif
24%bcond_with make_check
31f18b77 25%ifarch s390 s390x
7c673cae 26%bcond_with tcmalloc
31f18b77
FG
27%else
28%bcond_without tcmalloc
7c673cae
FG
29%endif
30%bcond_with lowmem_builder
31%if 0%{?fedora} || 0%{?rhel}
32%bcond_without selinux
33%endif
34%if 0%{?suse_version}
35%bcond_with selinux
36%endif
37
38# LTTng-UST enabled on Fedora, RHEL 6+, and SLE (not openSUSE)
39%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
40%if ! 0%{?is_opensuse}
41%bcond_without lttng
42%endif
43%endif
44
45%if %{with selinux}
46# get selinux policy version
47%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null || echo 0.0.0)}
48%endif
49
50%{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d}
51%{!?tmpfiles_create: %global tmpfiles_create systemd-tmpfiles --create}
52%{!?python3_pkgversion: %global python3_pkgversion 3}
53
54# unify libexec for all targets
55%global _libexecdir %{_exec_prefix}/lib
56
57# disable dwz which compresses the debuginfo
58%global _find_debuginfo_dwz_opts %{nil}
31f18b77 59
7c673cae
FG
60#################################################################################
61# main package definition
62#################################################################################
63Name: ceph
181888fb 64Version: 12.2.1
7c673cae 65Release: 0%{?dist}
31f18b77 66%if 0%{?fedora} || 0%{?rhel}
224ce89b 67Epoch: 2
31f18b77
FG
68%endif
69
70# define %_epoch_prefix macro which will expand to the empty string if %epoch is undefined
71%global _epoch_prefix %{?epoch:%{epoch}:}
72
7c673cae 73Summary: User space components of the Ceph file system
31f18b77 74License: LGPL-2.1 and CC-BY-SA-1.0 and GPL-2.0 and BSL-1.0 and BSD-3-Clause and MIT
7c673cae
FG
75%if 0%{?suse_version}
76Group: System/Filesystems
77%endif
78URL: http://ceph.com/
181888fb 79Source0: http://ceph.com/download/ceph-12.2.1.tar.bz2
7c673cae
FG
80%if 0%{?suse_version}
81%if 0%{?is_opensuse}
82ExclusiveArch: x86_64 aarch64 ppc64 ppc64le
83%else
31f18b77 84ExclusiveArch: x86_64 aarch64 ppc64le s390x
7c673cae
FG
85%endif
86%endif
87#################################################################################
88# dependencies that apply across all distro families
89#################################################################################
31f18b77
FG
90Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release}
91Requires: ceph-mds = %{_epoch_prefix}%{version}-%{release}
92Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
93Requires: ceph-mon = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
94Requires(post): binutils
95%if 0%{with cephfs_java}
96BuildRequires: java-devel
97BuildRequires: sharutils
98%endif
99%if 0%{with selinux}
100BuildRequires: checkpolicy
101BuildRequires: selinux-policy-devel
102BuildRequires: /usr/share/selinux/devel/policyhelp
103%endif
c07f9fc5
FG
104%if 0%{with make_check}
105%if 0%{?fedora} || 0%{?rhel}
106BuildRequires: python-cherrypy
107BuildRequires: python-werkzeug
108%endif
109%if 0%{?suse_version}
110BuildRequires: python-CherryPy
111BuildRequires: python-Werkzeug
112%endif
113BuildRequires: python-pecan
114BuildRequires: socat
115%endif
7c673cae 116BuildRequires: bc
31f18b77 117BuildRequires: gperf
7c673cae
FG
118BuildRequires: cmake
119BuildRequires: cryptsetup
120BuildRequires: fuse-devel
121BuildRequires: gcc-c++
122BuildRequires: gdbm
123%if 0%{with tcmalloc}
124BuildRequires: gperftools-devel >= 2.4
125%endif
126BuildRequires: jq
127BuildRequires: leveldb-devel > 1.2
128BuildRequires: libaio-devel
7c673cae
FG
129BuildRequires: libblkid-devel >= 2.17
130BuildRequires: libcurl-devel
131BuildRequires: libudev-devel
132BuildRequires: libtool
133BuildRequires: libxml2-devel
134BuildRequires: make
135BuildRequires: parted
136BuildRequires: perl
137BuildRequires: pkgconfig
138BuildRequires: python
139BuildRequires: python-devel
140BuildRequires: python-nose
7c673cae
FG
141BuildRequires: python-requests
142BuildRequires: python-virtualenv
143BuildRequires: snappy-devel
144BuildRequires: udev
145BuildRequires: util-linux
146BuildRequires: valgrind-devel
31f18b77 147BuildRequires: which
7c673cae
FG
148BuildRequires: xfsprogs
149BuildRequires: xfsprogs-devel
150BuildRequires: xmlstarlet
151BuildRequires: yasm
7c673cae
FG
152
153#################################################################################
154# distro-conditional dependencies
155#################################################################################
156%if 0%{?suse_version}
157BuildRequires: pkgconfig(systemd)
158BuildRequires: systemd-rpm-macros
159BuildRequires: systemd
160%{?systemd_requires}
161PreReq: %fillup_prereq
162BuildRequires: net-tools
163BuildRequires: libbz2-devel
164BuildRequires: btrfsprogs
165BuildRequires: mozilla-nss-devel
166BuildRequires: keyutils-devel
167BuildRequires: libopenssl-devel
168BuildRequires: lsb-release
169BuildRequires: openldap2-devel
170BuildRequires: python-Cython
31f18b77 171BuildRequires: python-PrettyTable
7c673cae 172BuildRequires: python-Sphinx
31f18b77 173BuildRequires: rdma-core-devel
7c673cae 174%endif
d2e6a577 175%if 0%{?fedora} || 0%{?rhel}
7c673cae
FG
176Requires: systemd
177BuildRequires: boost-random
178BuildRequires: btrfs-progs
179BuildRequires: nss-devel
180BuildRequires: keyutils-libs-devel
31f18b77 181BuildRequires: libibverbs-devel
7c673cae
FG
182BuildRequires: openldap-devel
183BuildRequires: openssl-devel
184BuildRequires: redhat-lsb-core
185BuildRequires: Cython
31f18b77 186BuildRequires: python-prettytable
7c673cae
FG
187BuildRequires: python-sphinx
188%endif
189# python34-... for RHEL, python3-... for all other supported distros
190%if 0%{?rhel}
191BuildRequires: python34-devel
192BuildRequires: python34-setuptools
193BuildRequires: python34-Cython
194%else
195BuildRequires: python3-devel
196BuildRequires: python3-setuptools
197BuildRequires: python3-Cython
198%endif
199# lttng and babeltrace for rbd-replay-prep
200%if %{with lttng}
201%if 0%{?fedora} || 0%{?rhel}
202BuildRequires: lttng-ust-devel
203BuildRequires: libbabeltrace-devel
204%endif
205%if 0%{?suse_version}
206BuildRequires: lttng-ust-devel
207BuildRequires: babeltrace-devel
208%endif
209%endif
7c673cae
FG
210%if 0%{?suse_version}
211BuildRequires: libexpat-devel
7c673cae
FG
212%endif
213%if 0%{?rhel} || 0%{?fedora}
214BuildRequires: expat-devel
7c673cae
FG
215%endif
216#hardened-cc1
217%if 0%{?fedora} || 0%{?rhel}
218BuildRequires: redhat-rpm-config
219%endif
7c673cae
FG
220
221%description
222Ceph is a massively scalable, open-source, distributed storage system that runs
223on commodity hardware and delivers object, block and file system storage.
224
225
226#################################################################################
227# subpackages
228#################################################################################
229%package base
230Summary: Ceph Base Package
231%if 0%{?suse_version}
232Group: System/Filesystems
233%endif
31f18b77
FG
234Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
235Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
236Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
237Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
238Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
7c673cae 239%if 0%{with selinux}
31f18b77 240Requires: ceph-selinux = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
241%endif
242Requires: python
243Requires: python-requests
244Requires: python-setuptools
245Requires: grep
246Requires: xfsprogs
247Requires: logrotate
248Requires: util-linux
249Requires: cryptsetup
250Requires: findutils
251Requires: psmisc
252Requires: which
253%if 0%{?suse_version}
254Recommends: ntp-daemon
255%endif
7c673cae
FG
256%description base
257Base is the package that includes all the files shared amongst ceph servers
258
259%package -n ceph-common
260Summary: Ceph Common
261%if 0%{?suse_version}
262Group: System/Filesystems
263%endif
31f18b77
FG
264Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
265Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
266Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
267Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
268Requires: python-rbd = %{_epoch_prefix}%{version}-%{release}
269Requires: python-cephfs = %{_epoch_prefix}%{version}-%{release}
270Requires: python-rgw = %{_epoch_prefix}%{version}-%{release}
271%if 0%{?fedora} || 0%{?rhel}
7c673cae 272Requires: python-prettytable
31f18b77
FG
273%endif
274%if 0%{?suse_version}
275Requires: python-PrettyTable
276%endif
7c673cae
FG
277Requires: python-requests
278%{?systemd_requires}
279%if 0%{?suse_version}
280Requires(pre): pwdutils
281%endif
7c673cae
FG
282%description -n ceph-common
283Common utilities to mount and interact with a ceph storage cluster.
284Comprised of files that are common to Ceph clients and servers.
285
286%package mds
287Summary: Ceph Metadata Server Daemon
288%if 0%{?suse_version}
289Group: System/Filesystems
290%endif
31f18b77 291Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
292%description mds
293ceph-mds is the metadata server daemon for the Ceph distributed file system.
294One or more instances of ceph-mds collectively manage the file system
295namespace, coordinating access to the shared OSD cluster.
296
297%package mon
298Summary: Ceph Monitor Daemon
299%if 0%{?suse_version}
300Group: System/Filesystems
301%endif
31f18b77 302Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
303# For ceph-rest-api
304%if 0%{?fedora} || 0%{?rhel}
305Requires: python-flask
306%endif
307%if 0%{?suse_version}
308Requires: python-Flask
309%endif
310%description mon
311ceph-mon is the cluster monitor daemon for the Ceph distributed file
312system. One or more instances of ceph-mon form a Paxos part-time
313parliament cluster that provides extremely reliable and durable storage
314of cluster membership, configuration, and state.
315
316%package mgr
317Summary: Ceph Manager Daemon
7c673cae
FG
318%if 0%{?suse_version}
319Group: System/Filesystems
320%endif
31f18b77
FG
321Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
322%if 0%{?fedora} || 0%{?rhel}
323Requires: python-cherrypy
324Requires: python-werkzeug
325Requires: pyOpenSSL
326%endif
327%if 0%{?suse_version}
328Requires: python-CherryPy
329Requires: python-Werkzeug
330Requires: python-pyOpenSSL
331%endif
332Requires: python-pecan
7c673cae
FG
333%description mgr
334ceph-mgr enables python modules that provide services (such as the REST
335module derived from Calamari) and expose CLI hooks. ceph-mgr gathers
336the cluster maps, the daemon metadata, and performance counters, and
337exposes all these to the python modules.
338
339%package fuse
340Summary: Ceph fuse-based client
341%if 0%{?suse_version}
342Group: System/Filesystems
343%endif
181888fb 344Requires: fuse
7c673cae
FG
345%description fuse
346FUSE based client for Ceph distributed network file system
347
348%package -n rbd-fuse
349Summary: Ceph fuse-based client
350%if 0%{?suse_version}
351Group: System/Filesystems
352%endif
31f18b77
FG
353Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
354Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
355%description -n rbd-fuse
356FUSE based client to map Ceph rbd images to files
357
358%package -n rbd-mirror
359Summary: Ceph daemon for mirroring RBD images
360%if 0%{?suse_version}
361Group: System/Filesystems
362%endif
31f18b77
FG
363Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
364Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
365%description -n rbd-mirror
366Daemon for mirroring RBD images between Ceph clusters, streaming
367changes asynchronously.
368
369%package -n rbd-nbd
370Summary: Ceph RBD client base on NBD
371%if 0%{?suse_version}
372Group: System/Filesystems
373%endif
31f18b77
FG
374Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
375Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
376%description -n rbd-nbd
377NBD based client to map Ceph rbd images to local device
378
379%package radosgw
380Summary: Rados REST gateway
381%if 0%{?suse_version}
382Group: System/Filesystems
383%endif
31f18b77 384Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
7c673cae 385%if 0%{with selinux}
31f18b77 386Requires: ceph-selinux = %{_epoch_prefix}%{version}-%{release}
7c673cae 387%endif
31f18b77
FG
388Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
389Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
390%if 0%{?rhel} || 0%{?fedora}
391Requires: mailcap
392%endif
393%description radosgw
394RADOS is a distributed object store used by the Ceph distributed
395storage system. This package provides a REST gateway to the
396object store that aims to implement a superset of Amazon's S3
397service as well as the OpenStack Object Storage ("Swift") API.
398
399%if %{with ocf}
400%package resource-agents
401Summary: OCF-compliant resource agents for Ceph daemons
402%if 0%{?suse_version}
403Group: System/Filesystems
404%endif
31f18b77 405Requires: ceph-base = %{_epoch_prefix}%{version}
7c673cae
FG
406Requires: resource-agents
407%description resource-agents
408Resource agents for monitoring and managing Ceph daemons
409under Open Cluster Framework (OCF) compliant resource
410managers such as Pacemaker.
411%endif
412
413%package osd
414Summary: Ceph Object Storage Daemon
415%if 0%{?suse_version}
416Group: System/Filesystems
417%endif
31f18b77 418Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
419# for sgdisk, used by ceph-disk
420%if 0%{?fedora} || 0%{?rhel}
421Requires: gdisk
422%endif
423%if 0%{?suse_version}
424Requires: gptfdisk
425%endif
426Requires: parted
427%description osd
428ceph-osd is the object storage daemon for the Ceph distributed file
429system. It is responsible for storing objects on a local file system
430and providing access to them over the network.
431
432%package -n librados2
433Summary: RADOS distributed object store client library
434%if 0%{?suse_version}
435Group: System/Libraries
436%endif
7c673cae 437%if 0%{?rhel} || 0%{?fedora}
31f18b77 438Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
439%endif
440%description -n librados2
441RADOS is a reliable, autonomic distributed object storage cluster
442developed as part of the Ceph distributed storage system. This is a
443shared library allowing applications to access the distributed object
444store using a simple file-like interface.
445
446%package -n librados-devel
447Summary: RADOS headers
448%if 0%{?suse_version}
449Group: Development/Libraries/C and C++
450%endif
31f18b77
FG
451Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
452Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
453Provides: librados2-devel = %{_epoch_prefix}%{version}-%{release}
454Obsoletes: librados2-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
455%description -n librados-devel
456This package contains libraries and headers needed to develop programs
457that use RADOS object store.
458
459%package -n librgw2
460Summary: RADOS gateway client library
461%if 0%{?suse_version}
462Group: System/Libraries
463%endif
31f18b77 464Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
465%description -n librgw2
466This package provides a library implementation of the RADOS gateway
467(distributed object store with S3 and Swift personalities).
468
469%package -n librgw-devel
470Summary: RADOS gateway client library
471%if 0%{?suse_version}
472Group: Development/Libraries/C and C++
473%endif
31f18b77
FG
474Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
475Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
476Provides: librgw2-devel = %{_epoch_prefix}%{version}-%{release}
477Obsoletes: librgw2-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
478%description -n librgw-devel
479This package contains libraries and headers needed to develop programs
480that use RADOS gateway client library.
481
482%package -n python-rgw
483Summary: Python 2 libraries for the RADOS gateway
484%if 0%{?suse_version}
485Group: Development/Languages/Python
486%endif
31f18b77
FG
487Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
488Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
489Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
490%description -n python-rgw
491This package contains Python 2 libraries for interacting with Cephs RADOS
492gateway.
493
494%package -n python%{python3_pkgversion}-rgw
495Summary: Python 3 libraries for the RADOS gateway
496%if 0%{?suse_version}
497Group: Development/Languages/Python
498%endif
31f18b77
FG
499Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
500Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
501%description -n python%{python3_pkgversion}-rgw
502This package contains Python 3 libraries for interacting with Cephs RADOS
503gateway.
504
505%package -n python-rados
506Summary: Python 2 libraries for the RADOS object store
507%if 0%{?suse_version}
508Group: Development/Languages/Python
509%endif
31f18b77
FG
510Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
511Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
512%description -n python-rados
513This package contains Python 2 libraries for interacting with Cephs RADOS
514object store.
515
516%package -n python%{python3_pkgversion}-rados
517Summary: Python 3 libraries for the RADOS object store
518%if 0%{?suse_version}
519Group: Development/Languages/Python
520%endif
7c673cae 521Requires: python%{python3_pkgversion}
31f18b77 522Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
523%description -n python%{python3_pkgversion}-rados
524This package contains Python 3 libraries for interacting with Cephs RADOS
525object store.
526
527%package -n libradosstriper1
528Summary: RADOS striping interface
529%if 0%{?suse_version}
530Group: System/Libraries
531%endif
31f18b77 532Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
533%description -n libradosstriper1
534Striping interface built on top of the rados library, allowing
535to stripe bigger objects onto several standard rados objects using
536an interface very similar to the rados one.
537
538%package -n libradosstriper-devel
539Summary: RADOS striping interface headers
540%if 0%{?suse_version}
541Group: Development/Libraries/C and C++
542%endif
31f18b77
FG
543Requires: libradosstriper1 = %{_epoch_prefix}%{version}-%{release}
544Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
545Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
546Provides: libradosstriper1-devel = %{_epoch_prefix}%{version}-%{release}
547Obsoletes: libradosstriper1-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
548%description -n libradosstriper-devel
549This package contains libraries and headers needed to develop programs
550that use RADOS striping interface.
551
552%package -n librbd1
553Summary: RADOS block device client library
554%if 0%{?suse_version}
555Group: System/Libraries
556%endif
31f18b77
FG
557Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
558%if 0%{?suse_version}
559Requires(post): coreutils
560%endif
7c673cae 561%if 0%{?rhel} || 0%{?fedora}
31f18b77 562Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
563%endif
564%description -n librbd1
565RBD is a block device striped across multiple distributed objects in
566RADOS, a reliable, autonomic distributed object storage cluster
567developed as part of the Ceph distributed storage system. This is a
568shared library allowing applications to manage these block devices.
569
570%package -n librbd-devel
571Summary: RADOS block device headers
572%if 0%{?suse_version}
573Group: Development/Libraries/C and C++
574%endif
31f18b77
FG
575Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
576Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
577Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
578Provides: librbd1-devel = %{_epoch_prefix}%{version}-%{release}
579Obsoletes: librbd1-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
580%description -n librbd-devel
581This package contains libraries and headers needed to develop programs
582that use RADOS block device.
583
584%package -n python-rbd
585Summary: Python 2 libraries for the RADOS block device
586%if 0%{?suse_version}
587Group: Development/Languages/Python
588%endif
31f18b77
FG
589Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
590Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
591Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
592%description -n python-rbd
593This package contains Python 2 libraries for interacting with Cephs RADOS
594block device.
595
596%package -n python%{python3_pkgversion}-rbd
597Summary: Python 3 libraries for the RADOS block device
598%if 0%{?suse_version}
599Group: Development/Languages/Python
600%endif
31f18b77
FG
601Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
602Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
603%description -n python%{python3_pkgversion}-rbd
604This package contains Python 3 libraries for interacting with Cephs RADOS
605block device.
606
607%package -n libcephfs2
608Summary: Ceph distributed file system client library
609%if 0%{?suse_version}
610Group: System/Libraries
611%endif
224ce89b 612Obsoletes: libcephfs1
7c673cae 613%if 0%{?rhel} || 0%{?fedora}
31f18b77 614Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
615Obsoletes: ceph-libcephfs
616%endif
617%description -n libcephfs2
618Ceph is a distributed network file system designed to provide excellent
619performance, reliability, and scalability. This is a shared library
620allowing applications to access a Ceph distributed file system via a
621POSIX-like interface.
622
623%package -n libcephfs-devel
624Summary: Ceph distributed file system headers
625%if 0%{?suse_version}
626Group: Development/Libraries/C and C++
627%endif
31f18b77
FG
628Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
629Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
630Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
631Provides: libcephfs2-devel = %{_epoch_prefix}%{version}-%{release}
632Obsoletes: libcephfs2-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
633%description -n libcephfs-devel
634This package contains libraries and headers needed to develop programs
635that use Cephs distributed file system.
636
637%package -n python-cephfs
638Summary: Python 2 libraries for Ceph distributed file system
639%if 0%{?suse_version}
640Group: Development/Languages/Python
641%endif
31f18b77 642Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
7c673cae 643%if 0%{?suse_version}
31f18b77 644Recommends: python-rados = %{_epoch_prefix}%{version}-%{release}
7c673cae 645%endif
31f18b77 646Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
647%description -n python-cephfs
648This package contains Python 2 libraries for interacting with Cephs distributed
649file system.
650
651%package -n python%{python3_pkgversion}-cephfs
652Summary: Python 3 libraries for Ceph distributed file system
653%if 0%{?suse_version}
654Group: Development/Languages/Python
655%endif
31f18b77
FG
656Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
657Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
658%description -n python%{python3_pkgversion}-cephfs
659This package contains Python 3 libraries for interacting with Cephs distributed
660file system.
661
662%package -n python%{python3_pkgversion}-ceph-argparse
663Summary: Python 3 utility libraries for Ceph CLI
664%if 0%{?suse_version}
665Group: Development/Languages/Python
666%endif
7c673cae
FG
667%description -n python%{python3_pkgversion}-ceph-argparse
668This package contains types and routines for Python 3 used by the Ceph CLI as
669well as the RESTful interface. These have to do with querying the daemons for
670command-description information, validating user command input against those
671descriptions, and submitting the command to the appropriate daemon.
672
673%if 0%{with ceph_test_package}
674%package -n ceph-test
675Summary: Ceph benchmarks and test tools
676%if 0%{?suse_version}
677Group: System/Benchmark
678%endif
7c673cae
FG
679Requires: ceph-common
680Requires: xmlstarlet
31f18b77 681Requires: jq
c07f9fc5 682Requires: socat
7c673cae
FG
683%description -n ceph-test
684This package contains Ceph benchmarks and test tools.
685%endif
686
687%if 0%{with cephfs_java}
688
689%package -n libcephfs_jni1
690Summary: Java Native Interface library for CephFS Java bindings
691%if 0%{?suse_version}
692Group: System/Libraries
693%endif
7c673cae 694Requires: java
31f18b77 695Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
696%description -n libcephfs_jni1
697This package contains the Java Native Interface library for CephFS Java
698bindings.
699
700%package -n libcephfs_jni-devel
701Summary: Development files for CephFS Java Native Interface library
702%if 0%{?suse_version}
703Group: Development/Libraries/Java
704%endif
7c673cae 705Requires: java
31f18b77
FG
706Requires: libcephfs_jni1 = %{_epoch_prefix}%{version}-%{release}
707Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
708Provides: libcephfs_jni1-devel = %{_epoch_prefix}%{version}-%{release}
709Obsoletes: libcephfs_jni1-devel < %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
710%description -n libcephfs_jni-devel
711This package contains the development files for CephFS Java Native Interface
712library.
713
714%package -n cephfs-java
715Summary: Java libraries for the Ceph File System
716%if 0%{?suse_version}
717Group: System/Libraries
718%endif
7c673cae 719Requires: java
31f18b77 720Requires: libcephfs_jni1 = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
721Requires: junit
722BuildRequires: junit
723%description -n cephfs-java
724This package contains the Java libraries for the Ceph File System.
725
726%endif
727
728%package -n rados-objclass-devel
729Summary: RADOS object class development kit
730Group: Development/Libraries
31f18b77 731Requires: librados2-devel = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
732%description -n rados-objclass-devel
733This package contains libraries and headers needed to develop RADOS object
734class plugins.
735
736%if 0%{with selinux}
737
738%package selinux
739Summary: SELinux support for Ceph MON, OSD and MDS
740%if 0%{?suse_version}
741Group: System/Filesystems
742%endif
31f18b77 743Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
7c673cae 744Requires: policycoreutils, libselinux-utils
31f18b77 745Requires(post): ceph-base = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
746Requires(post): selinux-policy-base >= %{_selinux_policy_version}, policycoreutils, gawk
747Requires(postun): policycoreutils
748%description selinux
749This package contains SELinux support for Ceph MON, OSD and MDS. The package
750also performs file-system relabelling which can take a long time on heavily
751populated file-systems.
752
753%endif
754
755%package -n python-ceph-compat
756Summary: Compatibility package for Cephs python libraries
757%if 0%{?suse_version}
758Group: Development/Languages/Python
759%endif
7c673cae 760Obsoletes: python-ceph
31f18b77
FG
761Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
762Requires: python-rbd = %{_epoch_prefix}%{version}-%{release}
763Requires: python-cephfs = %{_epoch_prefix}%{version}-%{release}
764Requires: python-rgw = %{_epoch_prefix}%{version}-%{release}
7c673cae
FG
765Provides: python-ceph
766%description -n python-ceph-compat
767This is a compatibility package to accommodate python-ceph split into
768python-rados, python-rbd, python-rgw and python-cephfs. Packages still
769depending on python-ceph should be fixed to depend on python-rados,
770python-rbd, python-rgw or python-cephfs instead.
771
772#################################################################################
773# common
774#################################################################################
775%prep
181888fb 776%autosetup -p1 -n ceph-12.2.1
7c673cae
FG
777
778%build
779%if 0%{with cephfs_java}
780# Find jni.h
781for i in /usr/{lib64,lib}/jvm/java/include{,/linux}; do
782 [ -d $i ] && java_inc="$java_inc -I$i"
783done
784%endif
785
786%if %{with lowmem_builder}
787RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
788%endif
789export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
790
791export CPPFLAGS="$java_inc"
792export CFLAGS="$RPM_OPT_FLAGS"
793export CXXFLAGS="$RPM_OPT_FLAGS"
794
795env | sort
796
797%if %{with lowmem_builder}
798%if 0%{?jobs} > 8
799%define _smp_mflags -j8
800%endif
801%endif
802
803# unlimit _smp_mflags in system macro if not set above
804%define _smp_ncpus_max 0
805# extract the number of processors for use with cmake
806%define _smp_ncpus %(echo %{_smp_mflags} | sed 's/-j//')
807
808mkdir build
809cd build
810cmake .. \
811 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
812 -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
813 -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
814 -DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \
815 -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
816 -DCMAKE_INSTALL_MANDIR=%{_mandir} \
817 -DCMAKE_INSTALL_DOCDIR=%{_docdir}/ceph \
c07f9fc5 818 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
7c673cae
FG
819 -DWITH_EMBEDDED=OFF \
820 -DWITH_MANPAGE=ON \
821 -DWITH_PYTHON3=ON \
822 -DWITH_SYSTEMD=ON \
823%if 0%{?rhel} && ! 0%{?centos}
824 -DWITH_SUBMAN=ON \
825%endif
7c673cae
FG
826%if 0%{without ceph_test_package}
827 -DWITH_TESTS=OFF \
828%endif
829%if 0%{with cephfs_java}
830 -DWITH_CEPHFS_JAVA=ON \
831%endif
832%if 0%{with selinux}
833 -DWITH_SELINUX=ON \
834%endif
835%if %{with lttng}
836 -DWITH_LTTNG=ON \
c07f9fc5 837 -DWITH_BABELTRACE=ON \
7c673cae
FG
838%else
839 -DWITH_LTTNG=OFF \
c07f9fc5 840 -DWITH_BABELTRACE=OFF \
7c673cae
FG
841%endif
842 $CEPH_EXTRA_CMAKE_ARGS \
843%if 0%{with ocf}
844 -DWITH_OCF=ON \
31f18b77
FG
845%endif
846%ifarch aarch64 armv7hl mips mipsel ppc ppc64 ppc64le %{ix86} x86_64
847 -DWITH_RADOSGW_BEAST_FRONTEND=ON \
848%else
849 -DWITH_RADOSGW_BEAST_FRONTEND=OFF \
7c673cae
FG
850%endif
851 -DBOOST_J=%{_smp_ncpus}
852
853make %{?_smp_mflags}
854
855
856%if 0%{with make_check}
857%check
858# run in-tree unittests
859cd build
860ctest %{?_smp_mflags}
861
862%endif
863
864
865
866%install
867pushd build
868make DESTDIR=%{buildroot} install
869# we have dropped sysvinit bits
870rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
871popd
872install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
873%if 0%{?fedora} || 0%{?rhel}
874install -m 0644 -D etc/sysconfig/ceph %{buildroot}%{_sysconfdir}/sysconfig/ceph
875%endif
876%if 0%{?suse_version}
877install -m 0644 -D etc/sysconfig/ceph %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
878%endif
879install -m 0644 -D systemd/ceph.tmpfiles.d %{buildroot}%{_tmpfilesdir}/ceph-common.conf
880install -m 0755 -D systemd/ceph %{buildroot}%{_sbindir}/rcceph
881install -m 0644 -D systemd/50-ceph.preset %{buildroot}%{_libexecdir}/systemd/system-preset/50-ceph.preset
882mkdir -p %{buildroot}%{_sbindir}
883install -m 0644 -D src/logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/ceph
884chmod 0644 %{buildroot}%{_docdir}/ceph/sample.ceph.conf
31f18b77 885install -m 0644 -D COPYING %{buildroot}%{_docdir}/ceph/COPYING
7c673cae
FG
886
887# firewall templates and /sbin/mount.ceph symlink
888%if 0%{?suse_version}
889install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-mon %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon
890install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds
891mkdir -p %{buildroot}/sbin
892ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
893%endif
894
895# udev rules
896install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
897install -m 0644 -D udev/60-ceph-by-parttypeuuid.rules %{buildroot}%{_udevrulesdir}/60-ceph-by-parttypeuuid.rules
898install -m 0644 -D udev/95-ceph-osd.rules %{buildroot}%{_udevrulesdir}/95-ceph-osd.rules
899
900#set up placeholder directories
901mkdir -p %{buildroot}%{_sysconfdir}/ceph
902mkdir -p %{buildroot}%{_localstatedir}/run/ceph
903mkdir -p %{buildroot}%{_localstatedir}/log/ceph
904mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/tmp
905mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mon
906mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/osd
907mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mds
908mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mgr
909mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/radosgw
910mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-osd
911mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mds
912mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rgw
913mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mgr
d2e6a577 914mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd
7c673cae
FG
915
916%if 0%{?suse_version}
917# create __pycache__ directories and their contents
918%py3_compile %{buildroot}%{python3_sitelib}
919%endif
920
921%clean
922rm -rf %{buildroot}
923
924#################################################################################
925# files and systemd scriptlets
926#################################################################################
927%files
928
929%files base
7c673cae
FG
930%{_bindir}/crushtool
931%{_bindir}/monmaptool
932%{_bindir}/osdmaptool
933%{_bindir}/ceph-run
934%{_bindir}/ceph-detect-init
935%{_libexecdir}/systemd/system-preset/50-ceph.preset
936%{_sbindir}/ceph-create-keys
31f18b77 937%{_sbindir}/ceph-disk
d2e6a577
FG
938%{_sbindir}/ceph-volume
939%{_sbindir}/ceph-volume-systemd
7c673cae
FG
940%{_sbindir}/rcceph
941%dir %{_libexecdir}/ceph
942%{_libexecdir}/ceph/ceph_common.sh
943%dir %{_libdir}/rados-classes
944%{_libdir}/rados-classes/*
945%dir %{_libdir}/ceph
946%dir %{_libdir}/ceph/erasure-code
947%{_libdir}/ceph/erasure-code/libec_*.so*
948%dir %{_libdir}/ceph/compressor
949%{_libdir}/ceph/compressor/libceph_*.so*
950%ifarch x86_64
951%dir %{_libdir}/ceph/crypto
952%{_libdir}/ceph/crypto/libceph_*.so*
953%endif
954%if %{with lttng}
955%{_libdir}/libos_tp.so*
956%{_libdir}/libosd_tp.so*
957%endif
7c673cae
FG
958%config(noreplace) %{_sysconfdir}/logrotate.d/ceph
959%if 0%{?fedora} || 0%{?rhel}
960%config(noreplace) %{_sysconfdir}/sysconfig/ceph
961%endif
962%if 0%{?suse_version}
963%{_localstatedir}/adm/fillup-templates/sysconfig.*
964%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon
965%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds
966%endif
31f18b77 967%{_unitdir}/ceph-disk@.service
d2e6a577 968%{_unitdir}/ceph-volume@.service
7c673cae
FG
969%{_unitdir}/ceph.target
970%{python_sitelib}/ceph_detect_init*
971%{python_sitelib}/ceph_disk*
d2e6a577
FG
972%dir %{python_sitelib}/ceph_volume
973%{python_sitelib}/ceph_volume/*
974%{python_sitelib}/ceph_volume-*
7c673cae
FG
975%{_mandir}/man8/ceph-deploy.8*
976%{_mandir}/man8/ceph-detect-init.8*
977%{_mandir}/man8/ceph-create-keys.8*
31f18b77 978%{_mandir}/man8/ceph-disk.8*
b5b8bbf5
FG
979%{_mandir}/man8/ceph-volume.8*
980%{_mandir}/man8/ceph-volume-systemd.8*
7c673cae
FG
981%{_mandir}/man8/ceph-run.8*
982%{_mandir}/man8/crushtool.8*
983%{_mandir}/man8/osdmaptool.8*
984%{_mandir}/man8/monmaptool.8*
985#set up placeholder directories
986%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/tmp
987%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-osd
988%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mds
989%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rgw
990%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
d2e6a577 991%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
7c673cae
FG
992
993%post base
994/sbin/ldconfig
995%if 0%{?suse_version}
996%fillup_only
997if [ $1 -eq 1 ] ; then
31f18b77 998 /usr/bin/systemctl preset ceph-disk@\*.service ceph.target >/dev/null 2>&1 || :
7c673cae
FG
999fi
1000%endif
1001%if 0%{?fedora} || 0%{?rhel}
31f18b77 1002%systemd_post ceph-disk@\*.service ceph.target
d2e6a577 1003%systemd_post ceph-volume@\*.service ceph.target
7c673cae
FG
1004%endif
1005if [ $1 -eq 1 ] ; then
1006/usr/bin/systemctl start ceph.target >/dev/null 2>&1 || :
1007fi
1008
1009%preun base
1010%if 0%{?suse_version}
31f18b77 1011%service_del_preun ceph-disk@\*.service ceph.target
7c673cae
FG
1012%endif
1013%if 0%{?fedora} || 0%{?rhel}
31f18b77 1014%systemd_preun ceph-disk@\*.service ceph.target
d2e6a577 1015%systemd_preun ceph-volume@\*.service ceph.target
7c673cae
FG
1016%endif
1017
1018%postun base
1019/sbin/ldconfig
224ce89b 1020test -n "$FIRST_ARG" || FIRST_ARG=$1
7c673cae
FG
1021%if 0%{?suse_version}
1022DISABLE_RESTART_ON_UPDATE="yes"
31f18b77 1023%service_del_postun ceph-disk@\*.service ceph.target
7c673cae
FG
1024%endif
1025%if 0%{?fedora} || 0%{?rhel}
31f18b77 1026%systemd_postun ceph-disk@\*.service ceph.target
7c673cae 1027%endif
31f18b77
FG
1028if [ $FIRST_ARG -ge 1 ] ; then
1029 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1030 # "yes". In any case: if units are not running, do not touch them.
1031 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1032 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1033 source $SYSCONF_CEPH
1034 fi
1035 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
d2e6a577 1036 /usr/bin/systemctl try-restart ceph-disk@\*.service ceph-volume@\*.service > /dev/null 2>&1 || :
31f18b77
FG
1037 fi
1038fi
7c673cae
FG
1039
1040%files common
224ce89b 1041%dir %{_docdir}/ceph
31f18b77
FG
1042%doc %{_docdir}/ceph/sample.ceph.conf
1043%doc %{_docdir}/ceph/COPYING
7c673cae
FG
1044%{_bindir}/ceph
1045%{_bindir}/ceph-authtool
1046%{_bindir}/ceph-conf
1047%{_bindir}/ceph-dencoder
1048%{_bindir}/ceph-rbdnamer
1049%{_bindir}/ceph-syn
1050%{_bindir}/ceph-crush-location
1051%{_bindir}/cephfs-data-scan
1052%{_bindir}/cephfs-journal-tool
1053%{_bindir}/cephfs-table-tool
1054%{_bindir}/rados
1055%{_bindir}/radosgw-admin
1056%{_bindir}/rbd
1057%{_bindir}/rbd-replay
1058%{_bindir}/rbd-replay-many
1059%{_bindir}/rbdmap
1060%{_sbindir}/mount.ceph
1061%if 0%{?suse_version}
1062/sbin/mount.ceph
1063%endif
1064%if %{with lttng}
1065%{_bindir}/rbd-replay-prep
1066%endif
1067%{_bindir}/ceph-post-file
1068%{_bindir}/ceph-brag
1069%{_tmpfilesdir}/ceph-common.conf
1070%{_mandir}/man8/ceph-authtool.8*
1071%{_mandir}/man8/ceph-conf.8*
1072%{_mandir}/man8/ceph-dencoder.8*
1073%{_mandir}/man8/ceph-rbdnamer.8*
1074%{_mandir}/man8/ceph-syn.8*
1075%{_mandir}/man8/ceph-post-file.8*
1076%{_mandir}/man8/ceph.8*
1077%{_mandir}/man8/mount.ceph.8*
1078%{_mandir}/man8/rados.8*
1079%{_mandir}/man8/radosgw-admin.8*
1080%{_mandir}/man8/rbd.8*
1081%{_mandir}/man8/rbdmap.8*
1082%{_mandir}/man8/rbd-replay.8*
1083%{_mandir}/man8/rbd-replay-many.8*
1084%{_mandir}/man8/rbd-replay-prep.8*
1085%dir %{_datadir}/ceph/
1086%{_datadir}/ceph/known_hosts_drop.ceph.com
1087%{_datadir}/ceph/id_rsa_drop.ceph.com
1088%{_datadir}/ceph/id_rsa_drop.ceph.com.pub
1089%dir %{_sysconfdir}/ceph/
31f18b77 1090%config %{_sysconfdir}/bash_completion.d/ceph
7c673cae
FG
1091%config %{_sysconfdir}/bash_completion.d/rados
1092%config %{_sysconfdir}/bash_completion.d/rbd
1093%config %{_sysconfdir}/bash_completion.d/radosgw-admin
1094%config(noreplace) %{_sysconfdir}/ceph/rbdmap
1095%{_unitdir}/rbdmap.service
1096%{python_sitelib}/ceph_argparse.py*
1097%{python_sitelib}/ceph_daemon.py*
1098%dir %{_udevrulesdir}
1099%{_udevrulesdir}/50-rbd.rules
1100%attr(3770,ceph,ceph) %dir %{_localstatedir}/log/ceph/
1101%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/
1102
1103%pre common
1104CEPH_GROUP_ID=167
1105CEPH_USER_ID=167
1106%if 0%{?rhel} || 0%{?fedora}
1107/usr/sbin/groupadd ceph -g $CEPH_GROUP_ID -o -r 2>/dev/null || :
1108/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 || :
1109%endif
1110%if 0%{?suse_version}
1111if ! getent group ceph >/dev/null ; then
1112 CEPH_GROUP_ID_OPTION=""
1113 getent group $CEPH_GROUP_ID >/dev/null || CEPH_GROUP_ID_OPTION="-g $CEPH_GROUP_ID"
1114 groupadd ceph $CEPH_GROUP_ID_OPTION -r 2>/dev/null || :
1115fi
1116if ! getent passwd ceph >/dev/null ; then
1117 CEPH_USER_ID_OPTION=""
1118 getent passwd $CEPH_USER_ID >/dev/null || CEPH_USER_ID_OPTION="-u $CEPH_USER_ID"
1119 useradd ceph $CEPH_USER_ID_OPTION -r -g ceph -s /sbin/nologin 2>/dev/null || :
1120fi
1121usermod -c "Ceph storage service" \
1122 -d %{_localstatedir}/lib/ceph \
1123 -g ceph \
1124 -s /sbin/nologin \
1125 ceph
1126%endif
1127exit 0
1128
1129%post common
1130%tmpfiles_create %{_tmpfilesdir}/ceph-common.conf
1131
1132%postun common
1133# Package removal cleanup
1134if [ "$1" -eq "0" ] ; then
1135 rm -rf %{_localstatedir}/log/ceph
1136 rm -rf %{_sysconfdir}/ceph
1137fi
1138
1139%files mds
1140%{_bindir}/ceph-mds
1141%{_mandir}/man8/ceph-mds.8*
1142%{_unitdir}/ceph-mds@.service
1143%{_unitdir}/ceph-mds.target
1144%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mds
1145
1146%post mds
1147%if 0%{?suse_version}
1148if [ $1 -eq 1 ] ; then
1149 /usr/bin/systemctl preset ceph-mds@\*.service ceph-mds.target >/dev/null 2>&1 || :
1150fi
1151%endif
1152%if 0%{?fedora} || 0%{?rhel}
1153%systemd_post ceph-mds@\*.service ceph-mds.target
1154%endif
1155if [ $1 -eq 1 ] ; then
1156/usr/bin/systemctl start ceph-mds.target >/dev/null 2>&1 || :
1157fi
1158
1159%preun mds
1160%if 0%{?suse_version}
1161%service_del_preun ceph-mds@\*.service ceph-mds.target
1162%endif
1163%if 0%{?fedora} || 0%{?rhel}
1164%systemd_preun ceph-mds@\*.service ceph-mds.target
1165%endif
1166
1167%postun mds
1168test -n "$FIRST_ARG" || FIRST_ARG=$1
1169%if 0%{?suse_version}
1170DISABLE_RESTART_ON_UPDATE="yes"
1171%service_del_postun ceph-mds@\*.service ceph-mds.target
1172%endif
1173%if 0%{?fedora} || 0%{?rhel}
1174%systemd_postun ceph-mds@\*.service ceph-mds.target
1175%endif
1176if [ $FIRST_ARG -ge 1 ] ; then
1177 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1178 # "yes". In any case: if units are not running, do not touch them.
1179 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1180 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1181 source $SYSCONF_CEPH
1182 fi
1183 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1184 /usr/bin/systemctl try-restart ceph-mds@\*.service > /dev/null 2>&1 || :
1185 fi
1186fi
1187
1188%files mgr
1189%{_bindir}/ceph-mgr
1190%{_libdir}/ceph/mgr
1191%{_unitdir}/ceph-mgr@.service
1192%{_unitdir}/ceph-mgr.target
1193%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mgr
1194
1195%post mgr
1196%if 0%{?suse_version}
1197if [ $1 -eq 1 ] ; then
1198 /usr/bin/systemctl preset ceph-mgr@\*.service ceph-mgr.target >/dev/null 2>&1 || :
1199fi
1200%endif
1201%if 0%{?fedora} || 0%{?rhel}
1202%systemd_post ceph-mgr@\*.service ceph-mgr.target
1203%endif
1204if [ $1 -eq 1 ] ; then
1205/usr/bin/systemctl start ceph-mgr.target >/dev/null 2>&1 || :
1206fi
1207
1208%preun mgr
1209%if 0%{?suse_version}
1210%service_del_preun ceph-mgr@\*.service ceph-mgr.target
1211%endif
1212%if 0%{?fedora} || 0%{?rhel}
1213%systemd_preun ceph-mgr@\*.service ceph-mgr.target
1214%endif
1215
1216%postun mgr
1217test -n "$FIRST_ARG" || FIRST_ARG=$1
1218%if 0%{?suse_version}
1219DISABLE_RESTART_ON_UPDATE="yes"
1220%service_del_postun ceph-mgr@\*.service ceph-mgr.target
1221%endif
1222%if 0%{?fedora} || 0%{?rhel}
1223%systemd_postun ceph-mgr@\*.service ceph-mgr.target
1224%endif
1225if [ $FIRST_ARG -ge 1 ] ; then
1226 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1227 # "yes". In any case: if units are not running, do not touch them.
1228 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1229 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1230 source $SYSCONF_CEPH
1231 fi
1232 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1233 /usr/bin/systemctl try-restart ceph-mgr@\*.service > /dev/null 2>&1 || :
1234 fi
1235fi
1236
1237%files mon
1238%{_bindir}/ceph-mon
1239%{_bindir}/ceph-rest-api
1240%{_mandir}/man8/ceph-mon.8*
1241%{_mandir}/man8/ceph-rest-api.8*
1242%{python_sitelib}/ceph_rest_api.py*
1243%{_unitdir}/ceph-mon@.service
1244%{_unitdir}/ceph-mon.target
1245%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mon
1246
1247%post mon
1248%if 0%{?suse_version}
1249if [ $1 -eq 1 ] ; then
1250 /usr/bin/systemctl preset ceph-mon@\*.service ceph-mon.target >/dev/null 2>&1 || :
1251fi
1252%endif
1253%if 0%{?fedora} || 0%{?rhel}
1254%systemd_post ceph-mon@\*.service ceph-mon.target
1255%endif
1256if [ $1 -eq 1 ] ; then
1257/usr/bin/systemctl start ceph-mon.target >/dev/null 2>&1 || :
1258fi
1259
1260%preun mon
1261%if 0%{?suse_version}
1262%service_del_preun ceph-mon@\*.service ceph-mon.target
1263%endif
1264%if 0%{?fedora} || 0%{?rhel}
1265%systemd_preun ceph-mon@\*.service ceph-mon.target
1266%endif
1267
1268%postun mon
1269test -n "$FIRST_ARG" || FIRST_ARG=$1
1270%if 0%{?suse_version}
1271DISABLE_RESTART_ON_UPDATE="yes"
1272%service_del_postun ceph-mon@\*.service ceph-mon.target
1273%endif
1274%if 0%{?fedora} || 0%{?rhel}
1275%systemd_postun ceph-mon@\*.service ceph-mon.target
1276%endif
1277if [ $FIRST_ARG -ge 1 ] ; then
1278 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1279 # "yes". In any case: if units are not running, do not touch them.
1280 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1281 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1282 source $SYSCONF_CEPH
1283 fi
1284 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1285 /usr/bin/systemctl try-restart ceph-mon@\*.service > /dev/null 2>&1 || :
1286 fi
1287fi
1288
1289%files fuse
7c673cae
FG
1290%{_bindir}/ceph-fuse
1291%{_mandir}/man8/ceph-fuse.8*
1292%{_sbindir}/mount.fuse.ceph
1293%{_unitdir}/ceph-fuse@.service
1294%{_unitdir}/ceph-fuse.target
1295
1296%files -n rbd-fuse
7c673cae
FG
1297%{_bindir}/rbd-fuse
1298%{_mandir}/man8/rbd-fuse.8*
1299
1300%files -n rbd-mirror
7c673cae
FG
1301%{_bindir}/rbd-mirror
1302%{_mandir}/man8/rbd-mirror.8*
1303%{_unitdir}/ceph-rbd-mirror@.service
1304%{_unitdir}/ceph-rbd-mirror.target
1305
1306%post -n rbd-mirror
1307%if 0%{?suse_version}
1308if [ $1 -eq 1 ] ; then
1309 /usr/bin/systemctl preset ceph-rbd-mirror@\*.service ceph-rbd-mirror.target >/dev/null 2>&1 || :
1310fi
1311%endif
1312%if 0%{?fedora} || 0%{?rhel}
1313%systemd_post ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1314%endif
1315if [ $1 -eq 1 ] ; then
1316/usr/bin/systemctl start ceph-rbd-mirror.target >/dev/null 2>&1 || :
1317fi
1318
1319%preun -n rbd-mirror
1320%if 0%{?suse_version}
1321%service_del_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1322%endif
1323%if 0%{?fedora} || 0%{?rhel}
1324%systemd_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1325%endif
1326
1327%postun -n rbd-mirror
1328test -n "$FIRST_ARG" || FIRST_ARG=$1
1329%if 0%{?suse_version}
1330DISABLE_RESTART_ON_UPDATE="yes"
1331%service_del_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1332%endif
1333%if 0%{?fedora} || 0%{?rhel}
1334%systemd_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1335%endif
1336if [ $FIRST_ARG -ge 1 ] ; then
1337 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1338 # "yes". In any case: if units are not running, do not touch them.
1339 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1340 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1341 source $SYSCONF_CEPH
1342 fi
1343 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1344 /usr/bin/systemctl try-restart ceph-rbd-mirror@\*.service > /dev/null 2>&1 || :
1345 fi
1346fi
1347
1348%files -n rbd-nbd
7c673cae
FG
1349%{_bindir}/rbd-nbd
1350%{_mandir}/man8/rbd-nbd.8*
1351
1352%files radosgw
7c673cae
FG
1353%{_bindir}/radosgw
1354%{_bindir}/radosgw-token
31f18b77 1355%{_bindir}/radosgw-es
7c673cae
FG
1356%{_bindir}/radosgw-object-expirer
1357%{_mandir}/man8/radosgw.8*
1358%dir %{_localstatedir}/lib/ceph/radosgw
1359%{_unitdir}/ceph-radosgw@.service
1360%{_unitdir}/ceph-radosgw.target
1361
1362%post radosgw
1363%if 0%{?suse_version}
1364if [ $1 -eq 1 ] ; then
1365 /usr/bin/systemctl preset ceph-radosgw@\*.service ceph-radosgw.target >/dev/null 2>&1 || :
1366fi
1367%endif
1368%if 0%{?fedora} || 0%{?rhel}
1369%systemd_post ceph-radosgw@\*.service ceph-radosgw.target
1370%endif
1371if [ $1 -eq 1 ] ; then
1372/usr/bin/systemctl start ceph-radosgw.target >/dev/null 2>&1 || :
1373fi
1374
1375%preun radosgw
1376%if 0%{?suse_version}
1377%service_del_preun ceph-radosgw@\*.service ceph-radosgw.target
1378%endif
1379%if 0%{?fedora} || 0%{?rhel}
1380%systemd_preun ceph-radosgw@\*.service ceph-radosgw.target
1381%endif
1382
1383%postun radosgw
1384test -n "$FIRST_ARG" || FIRST_ARG=$1
1385%if 0%{?suse_version}
1386DISABLE_RESTART_ON_UPDATE="yes"
1387%service_del_postun ceph-radosgw@\*.service ceph-radosgw.target
1388%endif
1389%if 0%{?fedora} || 0%{?rhel}
1390%systemd_postun ceph-radosgw@\*.service ceph-radosgw.target
1391%endif
1392if [ $FIRST_ARG -ge 1 ] ; then
1393 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1394 # "yes". In any case: if units are not running, do not touch them.
1395 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1396 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1397 source $SYSCONF_CEPH
1398 fi
1399 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1400 /usr/bin/systemctl try-restart ceph-radosgw@\*.service > /dev/null 2>&1 || :
1401 fi
1402fi
1403
1404%files osd
1405%{_bindir}/ceph-clsinfo
1406%{_bindir}/ceph-bluestore-tool
1407%{_bindir}/ceph-objectstore-tool
1408%{_bindir}/ceph-osd
7c673cae
FG
1409%{_libexecdir}/ceph/ceph-osd-prestart.sh
1410%dir %{_udevrulesdir}
1411%{_udevrulesdir}/60-ceph-by-parttypeuuid.rules
1412%{_udevrulesdir}/95-ceph-osd.rules
1413%{_mandir}/man8/ceph-clsinfo.8*
7c673cae
FG
1414%{_mandir}/man8/ceph-osd.8*
1415%if 0%{?rhel} && ! 0%{?centos}
31f18b77 1416%attr(0755,-,-) %{_sysconfdir}/cron.hourly/subman
7c673cae
FG
1417%endif
1418%{_unitdir}/ceph-osd@.service
1419%{_unitdir}/ceph-osd.target
7c673cae
FG
1420%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
1421
1422%post osd
1423%if 0%{?suse_version}
1424if [ $1 -eq 1 ] ; then
31f18b77 1425 /usr/bin/systemctl preset ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || :
7c673cae
FG
1426fi
1427%endif
1428%if 0%{?fedora} || 0%{?rhel}
31f18b77 1429%systemd_post ceph-osd@\*.service ceph-osd.target
7c673cae
FG
1430%endif
1431if [ $1 -eq 1 ] ; then
1432/usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || :
1433fi
1434
1435%preun osd
1436%if 0%{?suse_version}
31f18b77 1437%service_del_preun ceph-osd@\*.service ceph-osd.target
7c673cae
FG
1438%endif
1439%if 0%{?fedora} || 0%{?rhel}
31f18b77 1440%systemd_preun ceph-osd@\*.service ceph-osd.target
7c673cae
FG
1441%endif
1442
1443%postun osd
1444test -n "$FIRST_ARG" || FIRST_ARG=$1
1445%if 0%{?suse_version}
1446DISABLE_RESTART_ON_UPDATE="yes"
31f18b77 1447%service_del_postun ceph-osd@\*.service ceph-osd.target
7c673cae
FG
1448%endif
1449%if 0%{?fedora} || 0%{?rhel}
31f18b77 1450%systemd_postun ceph-osd@\*.service ceph-osd.target
7c673cae
FG
1451%endif
1452if [ $FIRST_ARG -ge 1 ] ; then
1453 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1454 # "yes". In any case: if units are not running, do not touch them.
1455 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1456 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1457 source $SYSCONF_CEPH
1458 fi
1459 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
31f18b77 1460 /usr/bin/systemctl try-restart ceph-osd@\*.service > /dev/null 2>&1 || :
7c673cae
FG
1461 fi
1462fi
1463
1464%if %{with ocf}
1465
1466%files resource-agents
7c673cae
FG
1467%dir %{_prefix}/lib/ocf
1468%dir %{_prefix}/lib/ocf/resource.d
1469%dir %{_prefix}/lib/ocf/resource.d/ceph
1470%{_prefix}/lib/ocf/resource.d/ceph/rbd
1471
1472%endif
1473
1474%files -n librados2
7c673cae
FG
1475%{_libdir}/librados.so.*
1476%dir %{_libdir}/ceph
1477%{_libdir}/ceph/libceph-common.so*
1478%if %{with lttng}
1479%{_libdir}/librados_tp.so.*
1480%endif
1481
1482%post -n librados2 -p /sbin/ldconfig
1483
1484%postun -n librados2 -p /sbin/ldconfig
1485
1486%files -n librados-devel
7c673cae
FG
1487%dir %{_includedir}/rados
1488%{_includedir}/rados/librados.h
1489%{_includedir}/rados/librados.hpp
1490%{_includedir}/rados/buffer.h
1491%{_includedir}/rados/buffer_fwd.h
1492%{_includedir}/rados/inline_memory.h
1493%{_includedir}/rados/page.h
1494%{_includedir}/rados/crc32c.h
1495%{_includedir}/rados/rados_types.h
1496%{_includedir}/rados/rados_types.hpp
1497%{_includedir}/rados/memory.h
1498%{_libdir}/librados.so
1499%if %{with lttng}
1500%{_libdir}/librados_tp.so
1501%endif
1502%{_bindir}/librados-config
1503%{_mandir}/man8/librados-config.8*
1504
1505%files -n python-rados
7c673cae
FG
1506%{python_sitearch}/rados.so
1507%{python_sitearch}/rados-*.egg-info
1508
1509%files -n python%{python3_pkgversion}-rados
7c673cae
FG
1510%{python3_sitearch}/rados.cpython*.so
1511%{python3_sitearch}/rados-*.egg-info
1512
1513%files -n libradosstriper1
7c673cae
FG
1514%{_libdir}/libradosstriper.so.*
1515
1516%post -n libradosstriper1 -p /sbin/ldconfig
1517
1518%postun -n libradosstriper1 -p /sbin/ldconfig
1519
1520%files -n libradosstriper-devel
7c673cae
FG
1521%dir %{_includedir}/radosstriper
1522%{_includedir}/radosstriper/libradosstriper.h
1523%{_includedir}/radosstriper/libradosstriper.hpp
1524%{_libdir}/libradosstriper.so
1525
1526%files -n librbd1
7c673cae
FG
1527%{_libdir}/librbd.so.*
1528%if %{with lttng}
1529%{_libdir}/librbd_tp.so.*
1530%endif
1531
181888fb 1532%post -n librbd1 -p /sbin/ldconfig
7c673cae
FG
1533
1534%postun -n librbd1 -p /sbin/ldconfig
1535
1536%files -n librbd-devel
7c673cae
FG
1537%dir %{_includedir}/rbd
1538%{_includedir}/rbd/librbd.h
1539%{_includedir}/rbd/librbd.hpp
1540%{_includedir}/rbd/features.h
1541%{_libdir}/librbd.so
1542%if %{with lttng}
1543%{_libdir}/librbd_tp.so
1544%endif
1545
1546%files -n librgw2
7c673cae
FG
1547%{_libdir}/librgw.so.*
1548
1549%post -n librgw2 -p /sbin/ldconfig
1550
1551%postun -n librgw2 -p /sbin/ldconfig
1552
1553%files -n librgw-devel
7c673cae
FG
1554%dir %{_includedir}/rados
1555%{_includedir}/rados/librgw.h
1556%{_includedir}/rados/rgw_file.h
1557%{_libdir}/librgw.so
1558
1559%files -n python-rgw
7c673cae
FG
1560%{python_sitearch}/rgw.so
1561%{python_sitearch}/rgw-*.egg-info
1562
1563%files -n python%{python3_pkgversion}-rgw
7c673cae
FG
1564%{python3_sitearch}/rgw.cpython*.so
1565%{python3_sitearch}/rgw-*.egg-info
1566
1567%files -n python-rbd
7c673cae
FG
1568%{python_sitearch}/rbd.so
1569%{python_sitearch}/rbd-*.egg-info
1570
1571%files -n python%{python3_pkgversion}-rbd
7c673cae
FG
1572%{python3_sitearch}/rbd.cpython*.so
1573%{python3_sitearch}/rbd-*.egg-info
1574
1575%files -n libcephfs2
7c673cae
FG
1576%{_libdir}/libcephfs.so.*
1577
1578%post -n libcephfs2 -p /sbin/ldconfig
1579
1580%postun -n libcephfs2 -p /sbin/ldconfig
1581
1582%files -n libcephfs-devel
7c673cae
FG
1583%dir %{_includedir}/cephfs
1584%{_includedir}/cephfs/libcephfs.h
1585%{_includedir}/cephfs/ceph_statx.h
1586%{_libdir}/libcephfs.so
1587
1588%files -n python-cephfs
7c673cae
FG
1589%{python_sitearch}/cephfs.so
1590%{python_sitearch}/cephfs-*.egg-info
1591%{python_sitelib}/ceph_volume_client.py*
1592
1593%files -n python%{python3_pkgversion}-cephfs
7c673cae
FG
1594%{python3_sitearch}/cephfs.cpython*.so
1595%{python3_sitearch}/cephfs-*.egg-info
1596%{python3_sitelib}/ceph_volume_client.py
1597%{python3_sitelib}/__pycache__/ceph_volume_client.cpython*.py*
1598
1599%files -n python%{python3_pkgversion}-ceph-argparse
7c673cae
FG
1600%{python3_sitelib}/ceph_argparse.py
1601%{python3_sitelib}/__pycache__/ceph_argparse.cpython*.py*
1602%{python3_sitelib}/ceph_daemon.py
1603%{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py*
1604
1605%if 0%{with ceph_test_package}
1606%files -n ceph-test
7c673cae
FG
1607%{_bindir}/ceph-client-debug
1608%{_bindir}/ceph_bench_log
1609%{_bindir}/ceph_kvstorebench
1610%{_bindir}/ceph_multi_stress_watch
1611%{_bindir}/ceph_erasure_code
1612%{_bindir}/ceph_erasure_code_benchmark
1613%{_bindir}/ceph_omapbench
1614%{_bindir}/ceph_objectstore_bench
1615%{_bindir}/ceph_perf_objectstore
1616%{_bindir}/ceph_perf_local
1617%{_bindir}/ceph_perf_msgr_client
1618%{_bindir}/ceph_perf_msgr_server
1619%{_bindir}/ceph_psim
1620%{_bindir}/ceph_radosacl
1621%{_bindir}/ceph_rgw_jsonparser
1622%{_bindir}/ceph_rgw_multiparser
1623%{_bindir}/ceph_scratchtool
1624%{_bindir}/ceph_scratchtoolpp
1625%{_bindir}/ceph_smalliobench
1626%{_bindir}/ceph_smalliobenchdumb
1627%{_bindir}/ceph_smalliobenchfs
1628%{_bindir}/ceph_smalliobenchrbd
1629%{_bindir}/ceph_test_*
1630%{_bindir}/ceph_tpbench
1631%{_bindir}/ceph_xattr_bench
1632%{_bindir}/ceph-coverage
1633%{_bindir}/ceph-monstore-tool
1634%{_bindir}/ceph-osdomap-tool
1635%{_bindir}/ceph-kvstore-tool
1636%{_bindir}/ceph-debugpack
7c673cae
FG
1637%{_mandir}/man8/ceph-debugpack.8*
1638%dir %{_libdir}/ceph
1639%{_libdir}/ceph/ceph-monstore-update-crush.sh
1640%endif
1641
1642%if 0%{with cephfs_java}
1643%files -n libcephfs_jni1
7c673cae
FG
1644%{_libdir}/libcephfs_jni.so.*
1645
1646%post -n libcephfs_jni1 -p /sbin/ldconfig
1647
1648%postun -n libcephfs_jni1 -p /sbin/ldconfig
1649
1650%files -n libcephfs_jni-devel
7c673cae
FG
1651%{_libdir}/libcephfs_jni.so
1652
1653%files -n cephfs-java
7c673cae
FG
1654%{_javadir}/libcephfs.jar
1655%{_javadir}/libcephfs-test.jar
1656%endif
1657
1658%files -n rados-objclass-devel
7c673cae
FG
1659%dir %{_includedir}/rados
1660%{_includedir}/rados/objclass.h
1661
1662%if 0%{with selinux}
1663%files selinux
7c673cae
FG
1664%attr(0600,root,root) %{_datadir}/selinux/packages/ceph.pp
1665%{_datadir}/selinux/devel/include/contrib/ceph.if
1666%{_mandir}/man8/ceph_selinux.8*
1667
1668%post selinux
1669# backup file_contexts before update
1670. /etc/selinux/config
1671FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1672cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1673
1674# Install the policy
1675/usr/sbin/semodule -i %{_datadir}/selinux/packages/ceph.pp
1676
1677# Load the policy if SELinux is enabled
1678if ! /usr/sbin/selinuxenabled; then
1679 # Do not relabel if selinux is not enabled
1680 exit 0
1681fi
1682
1683if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
1684 # Do not relabel if file contexts did not change
1685 exit 0
1686fi
1687
1688# Check whether the daemons are running
1689/usr/bin/systemctl status ceph.target > /dev/null 2>&1
1690STATUS=$?
1691
1692# Stop the daemons if they were running
1693if test $STATUS -eq 0; then
1694 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1695fi
1696
31f18b77
FG
1697# Relabel the files
1698# Use ceph-disk fix for first package install and fixfiles otherwise
1699if [ "$1" = "1" ]; then
1700 /usr/sbin/ceph-disk fix --selinux
1701else
1702 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1703fi
1704
7c673cae
FG
1705rm -f ${FILE_CONTEXT}.pre
1706# The fixfiles command won't fix label for /var/run/ceph
1707/usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1708
1709# Start the daemons iff they were running before
1710if test $STATUS -eq 0; then
1711 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1712fi
1713exit 0
1714
1715%postun selinux
1716if [ $1 -eq 0 ]; then
1717 # backup file_contexts before update
1718 . /etc/selinux/config
1719 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1720 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1721
1722 # Remove the module
1723 /usr/sbin/semodule -n -r ceph > /dev/null 2>&1
1724
1725 # Reload the policy if SELinux is enabled
1726 if ! /usr/sbin/selinuxenabled ; then
1727 # Do not relabel if SELinux is not enabled
1728 exit 0
1729 fi
1730
1731 # Check whether the daemons are running
1732 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
1733 STATUS=$?
1734
1735 # Stop the daemons if they were running
1736 if test $STATUS -eq 0; then
1737 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1738 fi
1739
1740 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1741 rm -f ${FILE_CONTEXT}.pre
1742 # The fixfiles command won't fix label for /var/run/ceph
1743 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1744
1745 # Start the daemons if they were running before
1746 if test $STATUS -eq 0; then
1747 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1748 fi
1749fi
1750exit 0
1751
1752%endif # with selinux
1753
1754%files -n python-ceph-compat
1755# We need an empty %%files list for python-ceph-compat, to tell rpmbuild to
1756# actually build this meta package.
1757
1758
1759%changelog