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