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