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