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