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