]> git.proxmox.com Git - ceph.git/blob - ceph/ceph.spec
update sources to 12.2.2
[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 %ifarch s390 s390x
26 %bcond_with tcmalloc
27 %else
28 %bcond_without tcmalloc
29 %endif
30 %bcond_with lowmem_builder
31 %if 0%{?fedora} || 0%{?rhel}
32 %bcond_without selinux
33 %endif
34 %if 0%{?suse_version}
35 %bcond_with selinux
36 %endif
37
38 # LTTng-UST enabled on Fedora, RHEL 6+, and SLE (not openSUSE)
39 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
40 %if ! 0%{?is_opensuse}
41 %bcond_without lttng
42 %endif
43 %endif
44
45 %if %{with selinux}
46 # get selinux policy version
47 %{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null || echo 0.0.0)}
48 %endif
49
50 %{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d}
51 %{!?tmpfiles_create: %global tmpfiles_create systemd-tmpfiles --create}
52 %{!?python3_pkgversion: %global python3_pkgversion 3}
53
54 # unify libexec for all targets
55 %global _libexecdir %{_exec_prefix}/lib
56
57 # disable dwz which compresses the debuginfo
58 %global _find_debuginfo_dwz_opts %{nil}
59
60 #################################################################################
61 # main package definition
62 #################################################################################
63 Name: ceph
64 Version: 12.2.2
65 Release: 0%{?dist}
66 %if 0%{?fedora} || 0%{?rhel}
67 Epoch: 2
68 %endif
69
70 # define _epoch_prefix macro which will expand to the empty string if epoch is
71 # 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.2.2.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 %if 0%{with make_check}
106 %if 0%{?fedora} || 0%{?rhel}
107 BuildRequires: python-cherrypy
108 BuildRequires: python-werkzeug
109 %endif
110 %if 0%{?suse_version}
111 BuildRequires: python-CherryPy
112 BuildRequires: python-Werkzeug
113 BuildRequires: python-numpy-devel
114 %endif
115 BuildRequires: python-pecan
116 BuildRequires: socat
117 %endif
118 BuildRequires: bc
119 BuildRequires: gperf
120 BuildRequires: cmake
121 BuildRequires: cryptsetup
122 BuildRequires: fuse-devel
123 BuildRequires: gcc-c++
124 BuildRequires: gdbm
125 %if 0%{with tcmalloc}
126 BuildRequires: gperftools-devel >= 2.4
127 %endif
128 BuildRequires: jq
129 BuildRequires: leveldb-devel > 1.2
130 BuildRequires: libaio-devel
131 BuildRequires: libblkid-devel >= 2.17
132 BuildRequires: libcurl-devel
133 BuildRequires: libudev-devel
134 BuildRequires: libtool
135 BuildRequires: libxml2-devel
136 BuildRequires: make
137 BuildRequires: parted
138 BuildRequires: perl
139 BuildRequires: pkgconfig
140 BuildRequires: python
141 BuildRequires: python-devel
142 BuildRequires: python-nose
143 BuildRequires: python-requests
144 BuildRequires: python-virtualenv
145 BuildRequires: snappy-devel
146 BuildRequires: udev
147 BuildRequires: util-linux
148 BuildRequires: valgrind-devel
149 BuildRequires: which
150 BuildRequires: xfsprogs
151 BuildRequires: xfsprogs-devel
152 BuildRequires: xmlstarlet
153 BuildRequires: yasm
154
155 #################################################################################
156 # distro-conditional dependencies
157 #################################################################################
158 %if 0%{?suse_version}
159 BuildRequires: pkgconfig(systemd)
160 BuildRequires: systemd-rpm-macros
161 BuildRequires: systemd
162 %{?systemd_requires}
163 PreReq: %fillup_prereq
164 BuildRequires: net-tools
165 BuildRequires: libbz2-devel
166 BuildRequires: btrfsprogs
167 BuildRequires: mozilla-nss-devel
168 BuildRequires: keyutils-devel
169 BuildRequires: libopenssl-devel
170 BuildRequires: lsb-release
171 BuildRequires: openldap2-devel
172 BuildRequires: python-Cython
173 BuildRequires: python-PrettyTable
174 BuildRequires: python-Sphinx
175 BuildRequires: rdma-core-devel
176 %endif
177 %if 0%{?fedora} || 0%{?rhel}
178 Requires: systemd
179 BuildRequires: boost-random
180 BuildRequires: btrfs-progs
181 BuildRequires: nss-devel
182 BuildRequires: keyutils-libs-devel
183 BuildRequires: libibverbs-devel
184 BuildRequires: openldap-devel
185 BuildRequires: openssl-devel
186 BuildRequires: redhat-lsb-core
187 BuildRequires: Cython
188 BuildRequires: python-prettytable
189 BuildRequires: python-sphinx
190 %endif
191 # python34-... for RHEL, python3-... for all other supported distros
192 %if 0%{?rhel}
193 BuildRequires: python34-devel
194 BuildRequires: python34-setuptools
195 BuildRequires: python34-Cython
196 %else
197 BuildRequires: python3-devel
198 BuildRequires: python3-setuptools
199 BuildRequires: python3-Cython
200 %endif
201 # lttng and babeltrace for rbd-replay-prep
202 %if %{with lttng}
203 %if 0%{?fedora} || 0%{?rhel}
204 BuildRequires: lttng-ust-devel
205 BuildRequires: libbabeltrace-devel
206 %endif
207 %if 0%{?suse_version}
208 BuildRequires: lttng-ust-devel
209 BuildRequires: babeltrace-devel
210 %endif
211 %endif
212 %if 0%{?suse_version}
213 BuildRequires: libexpat-devel
214 %endif
215 %if 0%{?rhel} || 0%{?fedora}
216 BuildRequires: expat-devel
217 %endif
218 #hardened-cc1
219 %if 0%{?fedora} || 0%{?rhel}
220 BuildRequires: redhat-rpm-config
221 %endif
222
223 %description
224 Ceph is a massively scalable, open-source, distributed storage system that runs
225 on commodity hardware and delivers object, block and file system storage.
226
227
228 #################################################################################
229 # subpackages
230 #################################################################################
231 %package base
232 Summary: Ceph Base Package
233 %if 0%{?suse_version}
234 Group: System/Filesystems
235 %endif
236 Requires: ceph-common = %{_epoch_prefix}%{version}-%{release}
237 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
238 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
239 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
240 Requires: librgw2 = %{_epoch_prefix}%{version}-%{release}
241 %if 0%{with selinux}
242 Requires: ceph-selinux = %{_epoch_prefix}%{version}-%{release}
243 %endif
244 Requires: python
245 Requires: python-requests
246 Requires: python-setuptools
247 Requires: grep
248 Requires: xfsprogs
249 Requires: logrotate
250 Requires: util-linux
251 Requires: cryptsetup
252 Requires: findutils
253 Requires: psmisc
254 Requires: which
255 %if 0%{?suse_version}
256 Recommends: ntp-daemon
257 %endif
258 %description base
259 Base is the package that includes all the files shared amongst ceph servers
260
261 %package -n ceph-common
262 Summary: Ceph Common
263 %if 0%{?suse_version}
264 Group: System/Filesystems
265 %endif
266 Requires: librbd1 = %{_epoch_prefix}%{version}-%{release}
267 Requires: librados2 = %{_epoch_prefix}%{version}-%{release}
268 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
269 Requires: python-rados = %{_epoch_prefix}%{version}-%{release}
270 Requires: python-rbd = %{_epoch_prefix}%{version}-%{release}
271 Requires: python-cephfs = %{_epoch_prefix}%{version}-%{release}
272 Requires: python-rgw = %{_epoch_prefix}%{version}-%{release}
273 %if 0%{?fedora} || 0%{?rhel}
274 Requires: python-prettytable
275 %endif
276 %if 0%{?suse_version}
277 Requires: python-PrettyTable
278 %endif
279 Requires: python-requests
280 %{?systemd_requires}
281 %if 0%{?suse_version}
282 Requires(pre): pwdutils
283 %endif
284 %description -n ceph-common
285 Common utilities to mount and interact with a ceph storage cluster.
286 Comprised of files that are common to Ceph clients and servers.
287
288 %package mds
289 Summary: Ceph Metadata Server Daemon
290 %if 0%{?suse_version}
291 Group: System/Filesystems
292 %endif
293 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
294 %description mds
295 ceph-mds is the metadata server daemon for the Ceph distributed file system.
296 One or more instances of ceph-mds collectively manage the file system
297 namespace, coordinating access to the shared OSD cluster.
298
299 %package mon
300 Summary: Ceph Monitor Daemon
301 %if 0%{?suse_version}
302 Group: System/Filesystems
303 %endif
304 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
305 # For ceph-rest-api
306 %if 0%{?fedora} || 0%{?rhel}
307 Requires: python-flask
308 %endif
309 %if 0%{?suse_version}
310 Requires: python-Flask
311 %endif
312 %description mon
313 ceph-mon is the cluster monitor daemon for the Ceph distributed file
314 system. One or more instances of ceph-mon form a Paxos part-time
315 parliament cluster that provides extremely reliable and durable storage
316 of cluster membership, configuration, and state.
317
318 %package mgr
319 Summary: Ceph Manager Daemon
320 %if 0%{?suse_version}
321 Group: System/Filesystems
322 %endif
323 Requires: ceph-base = %{_epoch_prefix}%{version}-%{release}
324 %if 0%{?fedora} || 0%{?rhel}
325 Requires: python-cherrypy
326 Requires: python-werkzeug
327 Requires: pyOpenSSL
328 %endif
329 %if 0%{?suse_version}
330 Requires: python-CherryPy
331 Requires: python-Werkzeug
332 Requires: python-pyOpenSSL
333 %endif
334 Requires: python-pecan
335 %description mgr
336 ceph-mgr enables python modules that provide services (such as the REST
337 module derived from Calamari) and expose CLI hooks. ceph-mgr gathers
338 the cluster maps, the daemon metadata, and performance counters, and
339 exposes all these to the python modules.
340
341 %package fuse
342 Summary: Ceph fuse-based client
343 %if 0%{?suse_version}
344 Group: System/Filesystems
345 %endif
346 Requires: fuse
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 Obsoletes: libcephfs1
615 %if 0%{?rhel} || 0%{?fedora}
616 Obsoletes: ceph-libs < %{_epoch_prefix}%{version}-%{release}
617 Obsoletes: ceph-libcephfs
618 %endif
619 %description -n libcephfs2
620 Ceph is a distributed network file system designed to provide excellent
621 performance, reliability, and scalability. This is a shared library
622 allowing applications to access a Ceph distributed file system via a
623 POSIX-like interface.
624
625 %package -n libcephfs-devel
626 Summary: Ceph distributed file system headers
627 %if 0%{?suse_version}
628 Group: Development/Libraries/C and C++
629 %endif
630 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
631 Requires: librados-devel = %{_epoch_prefix}%{version}-%{release}
632 Obsoletes: ceph-devel < %{_epoch_prefix}%{version}-%{release}
633 Provides: libcephfs2-devel = %{_epoch_prefix}%{version}-%{release}
634 Obsoletes: libcephfs2-devel < %{_epoch_prefix}%{version}-%{release}
635 %description -n libcephfs-devel
636 This package contains libraries and headers needed to develop programs
637 that use Cephs distributed file system.
638
639 %package -n python-cephfs
640 Summary: Python 2 libraries for Ceph distributed file system
641 %if 0%{?suse_version}
642 Group: Development/Languages/Python
643 %endif
644 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
645 %if 0%{?suse_version}
646 Recommends: python-rados = %{_epoch_prefix}%{version}-%{release}
647 %endif
648 Obsoletes: python-ceph < %{_epoch_prefix}%{version}-%{release}
649 %description -n python-cephfs
650 This package contains Python 2 libraries for interacting with Cephs distributed
651 file system.
652
653 %package -n python%{python3_pkgversion}-cephfs
654 Summary: Python 3 libraries for Ceph distributed file system
655 %if 0%{?suse_version}
656 Group: Development/Languages/Python
657 %endif
658 Requires: libcephfs2 = %{_epoch_prefix}%{version}-%{release}
659 Requires: python%{python3_pkgversion}-rados = %{_epoch_prefix}%{version}-%{release}
660 %description -n python%{python3_pkgversion}-cephfs
661 This package contains Python 3 libraries for interacting with Cephs distributed
662 file system.
663
664 %package -n python%{python3_pkgversion}-ceph-argparse
665 Summary: Python 3 utility libraries for Ceph CLI
666 %if 0%{?suse_version}
667 Group: Development/Languages/Python
668 %endif
669 %description -n python%{python3_pkgversion}-ceph-argparse
670 This package contains types and routines for Python 3 used by the Ceph CLI as
671 well as the RESTful interface. These have to do with querying the daemons for
672 command-description information, validating user command input against those
673 descriptions, and submitting the command to the appropriate daemon.
674
675 %if 0%{with ceph_test_package}
676 %package -n ceph-test
677 Summary: Ceph benchmarks and test tools
678 %if 0%{?suse_version}
679 Group: System/Benchmark
680 %endif
681 Requires: ceph-common
682 Requires: xmlstarlet
683 Requires: jq
684 Requires: socat
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 ceph-12.2.2
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 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
821 -DWITH_EMBEDDED=OFF \
822 -DWITH_MANPAGE=ON \
823 -DWITH_PYTHON3=ON \
824 -DWITH_SYSTEMD=ON \
825 %if 0%{?rhel} && ! 0%{?centos}
826 -DWITH_SUBMAN=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 -DWITH_BABELTRACE=ON \
840 %else
841 -DWITH_LTTNG=OFF \
842 -DWITH_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 install -m 0644 -D src/90-ceph-osd.conf %{buildroot}%{_sysctldir}/90-ceph-osd.conf
889
890 # firewall templates and /sbin/mount.ceph symlink
891 %if 0%{?suse_version}
892 install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-mon %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon
893 install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds
894 mkdir -p %{buildroot}/sbin
895 ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
896 %endif
897
898 # udev rules
899 install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
900 install -m 0644 -D udev/60-ceph-by-parttypeuuid.rules %{buildroot}%{_udevrulesdir}/60-ceph-by-parttypeuuid.rules
901 install -m 0644 -D udev/95-ceph-osd.rules %{buildroot}%{_udevrulesdir}/95-ceph-osd.rules
902
903 #set up placeholder directories
904 mkdir -p %{buildroot}%{_sysconfdir}/ceph
905 mkdir -p %{buildroot}%{_localstatedir}/run/ceph
906 mkdir -p %{buildroot}%{_localstatedir}/log/ceph
907 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/tmp
908 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mon
909 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/osd
910 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mds
911 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mgr
912 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/radosgw
913 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-osd
914 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mds
915 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rgw
916 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mgr
917 mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-rbd
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}/ceph-volume
942 %{_sbindir}/ceph-volume-systemd
943 %{_sbindir}/rcceph
944 %dir %{_libexecdir}/ceph
945 %{_libexecdir}/ceph/ceph_common.sh
946 %dir %{_libdir}/rados-classes
947 %{_libdir}/rados-classes/*
948 %dir %{_libdir}/ceph
949 %dir %{_libdir}/ceph/erasure-code
950 %{_libdir}/ceph/erasure-code/libec_*.so*
951 %dir %{_libdir}/ceph/compressor
952 %{_libdir}/ceph/compressor/libceph_*.so*
953 %ifarch x86_64
954 %dir %{_libdir}/ceph/crypto
955 %{_libdir}/ceph/crypto/libceph_*.so*
956 %endif
957 %if %{with lttng}
958 %{_libdir}/libos_tp.so*
959 %{_libdir}/libosd_tp.so*
960 %endif
961 %config(noreplace) %{_sysconfdir}/logrotate.d/ceph
962 %if 0%{?fedora} || 0%{?rhel}
963 %config(noreplace) %{_sysconfdir}/sysconfig/ceph
964 %endif
965 %if 0%{?suse_version}
966 %{_localstatedir}/adm/fillup-templates/sysconfig.*
967 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon
968 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds
969 %endif
970 %{_unitdir}/ceph-disk@.service
971 %{_unitdir}/ceph-volume@.service
972 %{_unitdir}/ceph.target
973 %{python_sitelib}/ceph_detect_init*
974 %{python_sitelib}/ceph_disk*
975 %dir %{python_sitelib}/ceph_volume
976 %{python_sitelib}/ceph_volume/*
977 %{python_sitelib}/ceph_volume-*
978 %{_mandir}/man8/ceph-deploy.8*
979 %{_mandir}/man8/ceph-detect-init.8*
980 %{_mandir}/man8/ceph-create-keys.8*
981 %{_mandir}/man8/ceph-disk.8*
982 %{_mandir}/man8/ceph-volume.8*
983 %{_mandir}/man8/ceph-volume-systemd.8*
984 %{_mandir}/man8/ceph-run.8*
985 %{_mandir}/man8/crushtool.8*
986 %{_mandir}/man8/osdmaptool.8*
987 %{_mandir}/man8/monmaptool.8*
988 #set up placeholder directories
989 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/tmp
990 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-osd
991 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mds
992 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rgw
993 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
994 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
995
996 %post base
997 /sbin/ldconfig
998 %if 0%{?suse_version}
999 %fillup_only
1000 if [ $1 -eq 1 ] ; then
1001 /usr/bin/systemctl preset ceph-disk@\*.service ceph.target >/dev/null 2>&1 || :
1002 fi
1003 %endif
1004 %if 0%{?fedora} || 0%{?rhel}
1005 %systemd_post ceph-disk@\*.service ceph.target
1006 %systemd_post ceph-volume@\*.service ceph.target
1007 %endif
1008 if [ $1 -eq 1 ] ; then
1009 /usr/bin/systemctl start ceph.target >/dev/null 2>&1 || :
1010 fi
1011
1012 %preun base
1013 %if 0%{?suse_version}
1014 %service_del_preun ceph-disk@\*.service ceph.target
1015 %endif
1016 %if 0%{?fedora} || 0%{?rhel}
1017 %systemd_preun ceph-disk@\*.service ceph.target
1018 %systemd_preun ceph-volume@\*.service ceph.target
1019 %endif
1020
1021 %postun base
1022 /sbin/ldconfig
1023 test -n "$FIRST_ARG" || FIRST_ARG=$1
1024 %if 0%{?suse_version}
1025 DISABLE_RESTART_ON_UPDATE="yes"
1026 %service_del_postun ceph-disk@\*.service ceph.target
1027 %endif
1028 %if 0%{?fedora} || 0%{?rhel}
1029 %systemd_postun ceph-disk@\*.service ceph.target
1030 %endif
1031 if [ $FIRST_ARG -ge 1 ] ; then
1032 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1033 # "yes". In any case: if units are not running, do not touch them.
1034 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1035 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1036 source $SYSCONF_CEPH
1037 fi
1038 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1039 /usr/bin/systemctl try-restart ceph-disk@\*.service ceph-volume@\*.service > /dev/null 2>&1 || :
1040 fi
1041 fi
1042
1043 %files common
1044 %dir %{_docdir}/ceph
1045 %doc %{_docdir}/ceph/sample.ceph.conf
1046 %doc %{_docdir}/ceph/COPYING
1047 %{_bindir}/ceph
1048 %{_bindir}/ceph-authtool
1049 %{_bindir}/ceph-conf
1050 %{_bindir}/ceph-dencoder
1051 %{_bindir}/ceph-rbdnamer
1052 %{_bindir}/ceph-syn
1053 %{_bindir}/ceph-crush-location
1054 %{_bindir}/cephfs-data-scan
1055 %{_bindir}/cephfs-journal-tool
1056 %{_bindir}/cephfs-table-tool
1057 %{_bindir}/rados
1058 %{_bindir}/radosgw-admin
1059 %{_bindir}/rbd
1060 %{_bindir}/rbd-replay
1061 %{_bindir}/rbd-replay-many
1062 %{_bindir}/rbdmap
1063 %{_sbindir}/mount.ceph
1064 %if 0%{?suse_version}
1065 /sbin/mount.ceph
1066 %endif
1067 %if %{with lttng}
1068 %{_bindir}/rbd-replay-prep
1069 %endif
1070 %{_bindir}/ceph-post-file
1071 %{_bindir}/ceph-brag
1072 %{_tmpfilesdir}/ceph-common.conf
1073 %{_mandir}/man8/ceph-authtool.8*
1074 %{_mandir}/man8/ceph-conf.8*
1075 %{_mandir}/man8/ceph-dencoder.8*
1076 %{_mandir}/man8/ceph-rbdnamer.8*
1077 %{_mandir}/man8/ceph-syn.8*
1078 %{_mandir}/man8/ceph-post-file.8*
1079 %{_mandir}/man8/ceph.8*
1080 %{_mandir}/man8/mount.ceph.8*
1081 %{_mandir}/man8/rados.8*
1082 %{_mandir}/man8/radosgw-admin.8*
1083 %{_mandir}/man8/rbd.8*
1084 %{_mandir}/man8/rbdmap.8*
1085 %{_mandir}/man8/rbd-replay.8*
1086 %{_mandir}/man8/rbd-replay-many.8*
1087 %{_mandir}/man8/rbd-replay-prep.8*
1088 %dir %{_datadir}/ceph/
1089 %{_datadir}/ceph/known_hosts_drop.ceph.com
1090 %{_datadir}/ceph/id_rsa_drop.ceph.com
1091 %{_datadir}/ceph/id_rsa_drop.ceph.com.pub
1092 %dir %{_sysconfdir}/ceph/
1093 %config %{_sysconfdir}/bash_completion.d/ceph
1094 %config %{_sysconfdir}/bash_completion.d/rados
1095 %config %{_sysconfdir}/bash_completion.d/rbd
1096 %config %{_sysconfdir}/bash_completion.d/radosgw-admin
1097 %config(noreplace) %{_sysconfdir}/ceph/rbdmap
1098 %{_unitdir}/rbdmap.service
1099 %{python_sitelib}/ceph_argparse.py*
1100 %{python_sitelib}/ceph_daemon.py*
1101 %dir %{_udevrulesdir}
1102 %{_udevrulesdir}/50-rbd.rules
1103 %attr(3770,ceph,ceph) %dir %{_localstatedir}/log/ceph/
1104 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/
1105
1106 %pre common
1107 CEPH_GROUP_ID=167
1108 CEPH_USER_ID=167
1109 %if 0%{?rhel} || 0%{?fedora}
1110 /usr/sbin/groupadd ceph -g $CEPH_GROUP_ID -o -r 2>/dev/null || :
1111 /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 || :
1112 %endif
1113 %if 0%{?suse_version}
1114 if ! getent group ceph >/dev/null ; then
1115 CEPH_GROUP_ID_OPTION=""
1116 getent group $CEPH_GROUP_ID >/dev/null || CEPH_GROUP_ID_OPTION="-g $CEPH_GROUP_ID"
1117 groupadd ceph $CEPH_GROUP_ID_OPTION -r 2>/dev/null || :
1118 fi
1119 if ! getent passwd ceph >/dev/null ; then
1120 CEPH_USER_ID_OPTION=""
1121 getent passwd $CEPH_USER_ID >/dev/null || CEPH_USER_ID_OPTION="-u $CEPH_USER_ID"
1122 useradd ceph $CEPH_USER_ID_OPTION -r -g ceph -s /sbin/nologin 2>/dev/null || :
1123 fi
1124 usermod -c "Ceph storage service" \
1125 -d %{_localstatedir}/lib/ceph \
1126 -g ceph \
1127 -s /sbin/nologin \
1128 ceph
1129 %endif
1130 exit 0
1131
1132 %post common
1133 %tmpfiles_create %{_tmpfilesdir}/ceph-common.conf
1134
1135 %postun common
1136 # Package removal cleanup
1137 if [ "$1" -eq "0" ] ; then
1138 rm -rf %{_localstatedir}/log/ceph
1139 rm -rf %{_sysconfdir}/ceph
1140 fi
1141
1142 %files mds
1143 %{_bindir}/ceph-mds
1144 %{_mandir}/man8/ceph-mds.8*
1145 %{_unitdir}/ceph-mds@.service
1146 %{_unitdir}/ceph-mds.target
1147 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mds
1148
1149 %post mds
1150 %if 0%{?suse_version}
1151 if [ $1 -eq 1 ] ; then
1152 /usr/bin/systemctl preset ceph-mds@\*.service ceph-mds.target >/dev/null 2>&1 || :
1153 fi
1154 %endif
1155 %if 0%{?fedora} || 0%{?rhel}
1156 %systemd_post ceph-mds@\*.service ceph-mds.target
1157 %endif
1158 if [ $1 -eq 1 ] ; then
1159 /usr/bin/systemctl start ceph-mds.target >/dev/null 2>&1 || :
1160 fi
1161
1162 %preun mds
1163 %if 0%{?suse_version}
1164 %service_del_preun ceph-mds@\*.service ceph-mds.target
1165 %endif
1166 %if 0%{?fedora} || 0%{?rhel}
1167 %systemd_preun ceph-mds@\*.service ceph-mds.target
1168 %endif
1169
1170 %postun mds
1171 test -n "$FIRST_ARG" || FIRST_ARG=$1
1172 %if 0%{?suse_version}
1173 DISABLE_RESTART_ON_UPDATE="yes"
1174 %service_del_postun ceph-mds@\*.service ceph-mds.target
1175 %endif
1176 %if 0%{?fedora} || 0%{?rhel}
1177 %systemd_postun ceph-mds@\*.service ceph-mds.target
1178 %endif
1179 if [ $FIRST_ARG -ge 1 ] ; then
1180 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1181 # "yes". In any case: if units are not running, do not touch them.
1182 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1183 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1184 source $SYSCONF_CEPH
1185 fi
1186 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1187 /usr/bin/systemctl try-restart ceph-mds@\*.service > /dev/null 2>&1 || :
1188 fi
1189 fi
1190
1191 %files mgr
1192 %{_bindir}/ceph-mgr
1193 %{_libdir}/ceph/mgr
1194 %{_unitdir}/ceph-mgr@.service
1195 %{_unitdir}/ceph-mgr.target
1196 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mgr
1197
1198 %post mgr
1199 %if 0%{?suse_version}
1200 if [ $1 -eq 1 ] ; then
1201 /usr/bin/systemctl preset ceph-mgr@\*.service ceph-mgr.target >/dev/null 2>&1 || :
1202 fi
1203 %endif
1204 %if 0%{?fedora} || 0%{?rhel}
1205 %systemd_post ceph-mgr@\*.service ceph-mgr.target
1206 %endif
1207 if [ $1 -eq 1 ] ; then
1208 /usr/bin/systemctl start ceph-mgr.target >/dev/null 2>&1 || :
1209 fi
1210
1211 %preun mgr
1212 %if 0%{?suse_version}
1213 %service_del_preun ceph-mgr@\*.service ceph-mgr.target
1214 %endif
1215 %if 0%{?fedora} || 0%{?rhel}
1216 %systemd_preun ceph-mgr@\*.service ceph-mgr.target
1217 %endif
1218
1219 %postun mgr
1220 test -n "$FIRST_ARG" || FIRST_ARG=$1
1221 %if 0%{?suse_version}
1222 DISABLE_RESTART_ON_UPDATE="yes"
1223 %service_del_postun ceph-mgr@\*.service ceph-mgr.target
1224 %endif
1225 %if 0%{?fedora} || 0%{?rhel}
1226 %systemd_postun ceph-mgr@\*.service ceph-mgr.target
1227 %endif
1228 if [ $FIRST_ARG -ge 1 ] ; then
1229 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1230 # "yes". In any case: if units are not running, do not touch them.
1231 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1232 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1233 source $SYSCONF_CEPH
1234 fi
1235 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1236 /usr/bin/systemctl try-restart ceph-mgr@\*.service > /dev/null 2>&1 || :
1237 fi
1238 fi
1239
1240 %files mon
1241 %{_bindir}/ceph-mon
1242 %{_bindir}/ceph-rest-api
1243 %{_mandir}/man8/ceph-mon.8*
1244 %{_mandir}/man8/ceph-rest-api.8*
1245 %{python_sitelib}/ceph_rest_api.py*
1246 %{_unitdir}/ceph-mon@.service
1247 %{_unitdir}/ceph-mon.target
1248 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mon
1249
1250 %post mon
1251 %if 0%{?suse_version}
1252 if [ $1 -eq 1 ] ; then
1253 /usr/bin/systemctl preset ceph-mon@\*.service ceph-mon.target >/dev/null 2>&1 || :
1254 fi
1255 %endif
1256 %if 0%{?fedora} || 0%{?rhel}
1257 %systemd_post ceph-mon@\*.service ceph-mon.target
1258 %endif
1259 if [ $1 -eq 1 ] ; then
1260 /usr/bin/systemctl start ceph-mon.target >/dev/null 2>&1 || :
1261 fi
1262
1263 %preun mon
1264 %if 0%{?suse_version}
1265 %service_del_preun ceph-mon@\*.service ceph-mon.target
1266 %endif
1267 %if 0%{?fedora} || 0%{?rhel}
1268 %systemd_preun ceph-mon@\*.service ceph-mon.target
1269 %endif
1270
1271 %postun mon
1272 test -n "$FIRST_ARG" || FIRST_ARG=$1
1273 %if 0%{?suse_version}
1274 DISABLE_RESTART_ON_UPDATE="yes"
1275 %service_del_postun ceph-mon@\*.service ceph-mon.target
1276 %endif
1277 %if 0%{?fedora} || 0%{?rhel}
1278 %systemd_postun ceph-mon@\*.service ceph-mon.target
1279 %endif
1280 if [ $FIRST_ARG -ge 1 ] ; then
1281 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1282 # "yes". In any case: if units are not running, do not touch them.
1283 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1284 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1285 source $SYSCONF_CEPH
1286 fi
1287 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1288 /usr/bin/systemctl try-restart ceph-mon@\*.service > /dev/null 2>&1 || :
1289 fi
1290 fi
1291
1292 %files fuse
1293 %{_bindir}/ceph-fuse
1294 %{_mandir}/man8/ceph-fuse.8*
1295 %{_sbindir}/mount.fuse.ceph
1296 %{_unitdir}/ceph-fuse@.service
1297 %{_unitdir}/ceph-fuse.target
1298
1299 %files -n rbd-fuse
1300 %{_bindir}/rbd-fuse
1301 %{_mandir}/man8/rbd-fuse.8*
1302
1303 %files -n rbd-mirror
1304 %{_bindir}/rbd-mirror
1305 %{_mandir}/man8/rbd-mirror.8*
1306 %{_unitdir}/ceph-rbd-mirror@.service
1307 %{_unitdir}/ceph-rbd-mirror.target
1308
1309 %post -n rbd-mirror
1310 %if 0%{?suse_version}
1311 if [ $1 -eq 1 ] ; then
1312 /usr/bin/systemctl preset ceph-rbd-mirror@\*.service ceph-rbd-mirror.target >/dev/null 2>&1 || :
1313 fi
1314 %endif
1315 %if 0%{?fedora} || 0%{?rhel}
1316 %systemd_post ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1317 %endif
1318 if [ $1 -eq 1 ] ; then
1319 /usr/bin/systemctl start ceph-rbd-mirror.target >/dev/null 2>&1 || :
1320 fi
1321
1322 %preun -n rbd-mirror
1323 %if 0%{?suse_version}
1324 %service_del_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1325 %endif
1326 %if 0%{?fedora} || 0%{?rhel}
1327 %systemd_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1328 %endif
1329
1330 %postun -n rbd-mirror
1331 test -n "$FIRST_ARG" || FIRST_ARG=$1
1332 %if 0%{?suse_version}
1333 DISABLE_RESTART_ON_UPDATE="yes"
1334 %service_del_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1335 %endif
1336 %if 0%{?fedora} || 0%{?rhel}
1337 %systemd_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1338 %endif
1339 if [ $FIRST_ARG -ge 1 ] ; then
1340 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1341 # "yes". In any case: if units are not running, do not touch them.
1342 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1343 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1344 source $SYSCONF_CEPH
1345 fi
1346 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1347 /usr/bin/systemctl try-restart ceph-rbd-mirror@\*.service > /dev/null 2>&1 || :
1348 fi
1349 fi
1350
1351 %files -n rbd-nbd
1352 %{_bindir}/rbd-nbd
1353 %{_mandir}/man8/rbd-nbd.8*
1354
1355 %files radosgw
1356 %{_bindir}/radosgw
1357 %{_bindir}/radosgw-token
1358 %{_bindir}/radosgw-es
1359 %{_bindir}/radosgw-object-expirer
1360 %{_mandir}/man8/radosgw.8*
1361 %dir %{_localstatedir}/lib/ceph/radosgw
1362 %{_unitdir}/ceph-radosgw@.service
1363 %{_unitdir}/ceph-radosgw.target
1364
1365 %post radosgw
1366 %if 0%{?suse_version}
1367 if [ $1 -eq 1 ] ; then
1368 /usr/bin/systemctl preset ceph-radosgw@\*.service ceph-radosgw.target >/dev/null 2>&1 || :
1369 fi
1370 %endif
1371 %if 0%{?fedora} || 0%{?rhel}
1372 %systemd_post ceph-radosgw@\*.service ceph-radosgw.target
1373 %endif
1374 if [ $1 -eq 1 ] ; then
1375 /usr/bin/systemctl start ceph-radosgw.target >/dev/null 2>&1 || :
1376 fi
1377
1378 %preun radosgw
1379 %if 0%{?suse_version}
1380 %service_del_preun ceph-radosgw@\*.service ceph-radosgw.target
1381 %endif
1382 %if 0%{?fedora} || 0%{?rhel}
1383 %systemd_preun ceph-radosgw@\*.service ceph-radosgw.target
1384 %endif
1385
1386 %postun radosgw
1387 test -n "$FIRST_ARG" || FIRST_ARG=$1
1388 %if 0%{?suse_version}
1389 DISABLE_RESTART_ON_UPDATE="yes"
1390 %service_del_postun ceph-radosgw@\*.service ceph-radosgw.target
1391 %endif
1392 %if 0%{?fedora} || 0%{?rhel}
1393 %systemd_postun ceph-radosgw@\*.service ceph-radosgw.target
1394 %endif
1395 if [ $FIRST_ARG -ge 1 ] ; then
1396 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1397 # "yes". In any case: if units are not running, do not touch them.
1398 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1399 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1400 source $SYSCONF_CEPH
1401 fi
1402 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1403 /usr/bin/systemctl try-restart ceph-radosgw@\*.service > /dev/null 2>&1 || :
1404 fi
1405 fi
1406
1407 %files osd
1408 %{_bindir}/ceph-clsinfo
1409 %{_bindir}/ceph-bluestore-tool
1410 %{_bindir}/ceph-objectstore-tool
1411 %{_bindir}/ceph-osd
1412 %{_libexecdir}/ceph/ceph-osd-prestart.sh
1413 %dir %{_udevrulesdir}
1414 %{_udevrulesdir}/60-ceph-by-parttypeuuid.rules
1415 %{_udevrulesdir}/95-ceph-osd.rules
1416 %{_mandir}/man8/ceph-clsinfo.8*
1417 %{_mandir}/man8/ceph-osd.8*
1418 %{_mandir}/man8/ceph-bluestore-tool.8*
1419 %if 0%{?rhel} && ! 0%{?centos}
1420 %attr(0755,-,-) %{_sysconfdir}/cron.hourly/subman
1421 %endif
1422 %{_unitdir}/ceph-osd@.service
1423 %{_unitdir}/ceph-osd.target
1424 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
1425 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
1426
1427 %post osd
1428 %if 0%{?suse_version}
1429 if [ $1 -eq 1 ] ; then
1430 /usr/bin/systemctl preset ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || :
1431 fi
1432 %endif
1433 %if 0%{?fedora} || 0%{?rhel}
1434 %systemd_post ceph-osd@\*.service ceph-osd.target
1435 %endif
1436 if [ $1 -eq 1 ] ; then
1437 /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || :
1438 fi
1439 %if 0%{?sysctl_apply}
1440 %sysctl_apply 90-ceph-osd.conf
1441 %else
1442 /usr/lib/systemd/systemd-sysctl %{_sysctldir}/90-ceph-osd.conf > /dev/null 2>&1 || :
1443 %endif
1444
1445 %preun osd
1446 %if 0%{?suse_version}
1447 %service_del_preun ceph-osd@\*.service ceph-osd.target
1448 %endif
1449 %if 0%{?fedora} || 0%{?rhel}
1450 %systemd_preun ceph-osd@\*.service ceph-osd.target
1451 %endif
1452
1453 %postun osd
1454 test -n "$FIRST_ARG" || FIRST_ARG=$1
1455 %if 0%{?suse_version}
1456 DISABLE_RESTART_ON_UPDATE="yes"
1457 %service_del_postun ceph-osd@\*.service ceph-osd.target
1458 %endif
1459 %if 0%{?fedora} || 0%{?rhel}
1460 %systemd_postun ceph-osd@\*.service ceph-osd.target
1461 %endif
1462 if [ $FIRST_ARG -ge 1 ] ; then
1463 # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1464 # "yes". In any case: if units are not running, do not touch them.
1465 SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1466 if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1467 source $SYSCONF_CEPH
1468 fi
1469 if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1470 /usr/bin/systemctl try-restart ceph-osd@\*.service > /dev/null 2>&1 || :
1471 fi
1472 fi
1473
1474 %if %{with ocf}
1475
1476 %files resource-agents
1477 %dir %{_prefix}/lib/ocf
1478 %dir %{_prefix}/lib/ocf/resource.d
1479 %dir %{_prefix}/lib/ocf/resource.d/ceph
1480 %{_prefix}/lib/ocf/resource.d/ceph/rbd
1481
1482 %endif
1483
1484 %files -n librados2
1485 %{_libdir}/librados.so.*
1486 %dir %{_libdir}/ceph
1487 %{_libdir}/ceph/libceph-common.so*
1488 %if %{with lttng}
1489 %{_libdir}/librados_tp.so.*
1490 %endif
1491
1492 %post -n librados2 -p /sbin/ldconfig
1493
1494 %postun -n librados2 -p /sbin/ldconfig
1495
1496 %files -n librados-devel
1497 %dir %{_includedir}/rados
1498 %{_includedir}/rados/librados.h
1499 %{_includedir}/rados/librados.hpp
1500 %{_includedir}/rados/buffer.h
1501 %{_includedir}/rados/buffer_fwd.h
1502 %{_includedir}/rados/inline_memory.h
1503 %{_includedir}/rados/page.h
1504 %{_includedir}/rados/crc32c.h
1505 %{_includedir}/rados/rados_types.h
1506 %{_includedir}/rados/rados_types.hpp
1507 %{_includedir}/rados/memory.h
1508 %{_libdir}/librados.so
1509 %if %{with lttng}
1510 %{_libdir}/librados_tp.so
1511 %endif
1512 %{_bindir}/librados-config
1513 %{_mandir}/man8/librados-config.8*
1514
1515 %files -n python-rados
1516 %{python_sitearch}/rados.so
1517 %{python_sitearch}/rados-*.egg-info
1518
1519 %files -n python%{python3_pkgversion}-rados
1520 %{python3_sitearch}/rados.cpython*.so
1521 %{python3_sitearch}/rados-*.egg-info
1522
1523 %files -n libradosstriper1
1524 %{_libdir}/libradosstriper.so.*
1525
1526 %post -n libradosstriper1 -p /sbin/ldconfig
1527
1528 %postun -n libradosstriper1 -p /sbin/ldconfig
1529
1530 %files -n libradosstriper-devel
1531 %dir %{_includedir}/radosstriper
1532 %{_includedir}/radosstriper/libradosstriper.h
1533 %{_includedir}/radosstriper/libradosstriper.hpp
1534 %{_libdir}/libradosstriper.so
1535
1536 %files -n librbd1
1537 %{_libdir}/librbd.so.*
1538 %if %{with lttng}
1539 %{_libdir}/librbd_tp.so.*
1540 %endif
1541
1542 %post -n librbd1 -p /sbin/ldconfig
1543
1544 %postun -n librbd1 -p /sbin/ldconfig
1545
1546 %files -n librbd-devel
1547 %dir %{_includedir}/rbd
1548 %{_includedir}/rbd/librbd.h
1549 %{_includedir}/rbd/librbd.hpp
1550 %{_includedir}/rbd/features.h
1551 %{_libdir}/librbd.so
1552 %if %{with lttng}
1553 %{_libdir}/librbd_tp.so
1554 %endif
1555
1556 %files -n librgw2
1557 %{_libdir}/librgw.so.*
1558
1559 %post -n librgw2 -p /sbin/ldconfig
1560
1561 %postun -n librgw2 -p /sbin/ldconfig
1562
1563 %files -n librgw-devel
1564 %dir %{_includedir}/rados
1565 %{_includedir}/rados/librgw.h
1566 %{_includedir}/rados/rgw_file.h
1567 %{_libdir}/librgw.so
1568
1569 %files -n python-rgw
1570 %{python_sitearch}/rgw.so
1571 %{python_sitearch}/rgw-*.egg-info
1572
1573 %files -n python%{python3_pkgversion}-rgw
1574 %{python3_sitearch}/rgw.cpython*.so
1575 %{python3_sitearch}/rgw-*.egg-info
1576
1577 %files -n python-rbd
1578 %{python_sitearch}/rbd.so
1579 %{python_sitearch}/rbd-*.egg-info
1580
1581 %files -n python%{python3_pkgversion}-rbd
1582 %{python3_sitearch}/rbd.cpython*.so
1583 %{python3_sitearch}/rbd-*.egg-info
1584
1585 %files -n libcephfs2
1586 %{_libdir}/libcephfs.so.*
1587
1588 %post -n libcephfs2 -p /sbin/ldconfig
1589
1590 %postun -n libcephfs2 -p /sbin/ldconfig
1591
1592 %files -n libcephfs-devel
1593 %dir %{_includedir}/cephfs
1594 %{_includedir}/cephfs/libcephfs.h
1595 %{_includedir}/cephfs/ceph_statx.h
1596 %{_libdir}/libcephfs.so
1597
1598 %files -n python-cephfs
1599 %{python_sitearch}/cephfs.so
1600 %{python_sitearch}/cephfs-*.egg-info
1601 %{python_sitelib}/ceph_volume_client.py*
1602
1603 %files -n python%{python3_pkgversion}-cephfs
1604 %{python3_sitearch}/cephfs.cpython*.so
1605 %{python3_sitearch}/cephfs-*.egg-info
1606 %{python3_sitelib}/ceph_volume_client.py
1607 %{python3_sitelib}/__pycache__/ceph_volume_client.cpython*.py*
1608
1609 %files -n python%{python3_pkgversion}-ceph-argparse
1610 %{python3_sitelib}/ceph_argparse.py
1611 %{python3_sitelib}/__pycache__/ceph_argparse.cpython*.py*
1612 %{python3_sitelib}/ceph_daemon.py
1613 %{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py*
1614
1615 %if 0%{with ceph_test_package}
1616 %files -n ceph-test
1617 %{_bindir}/ceph-client-debug
1618 %{_bindir}/ceph_bench_log
1619 %{_bindir}/ceph_kvstorebench
1620 %{_bindir}/ceph_multi_stress_watch
1621 %{_bindir}/ceph_erasure_code
1622 %{_bindir}/ceph_erasure_code_benchmark
1623 %{_bindir}/ceph_omapbench
1624 %{_bindir}/ceph_objectstore_bench
1625 %{_bindir}/ceph_perf_objectstore
1626 %{_bindir}/ceph_perf_local
1627 %{_bindir}/ceph_perf_msgr_client
1628 %{_bindir}/ceph_perf_msgr_server
1629 %{_bindir}/ceph_psim
1630 %{_bindir}/ceph_radosacl
1631 %{_bindir}/ceph_rgw_jsonparser
1632 %{_bindir}/ceph_rgw_multiparser
1633 %{_bindir}/ceph_scratchtool
1634 %{_bindir}/ceph_scratchtoolpp
1635 %{_bindir}/ceph_smalliobench
1636 %{_bindir}/ceph_smalliobenchdumb
1637 %{_bindir}/ceph_smalliobenchfs
1638 %{_bindir}/ceph_smalliobenchrbd
1639 %{_bindir}/ceph_test_*
1640 %{_bindir}/ceph_tpbench
1641 %{_bindir}/ceph_xattr_bench
1642 %{_bindir}/ceph-coverage
1643 %{_bindir}/ceph-monstore-tool
1644 %{_bindir}/ceph-osdomap-tool
1645 %{_bindir}/ceph-kvstore-tool
1646 %{_bindir}/ceph-debugpack
1647 %{_mandir}/man8/ceph-debugpack.8*
1648 %dir %{_libdir}/ceph
1649 %{_libdir}/ceph/ceph-monstore-update-crush.sh
1650 %endif
1651
1652 %if 0%{with cephfs_java}
1653 %files -n libcephfs_jni1
1654 %{_libdir}/libcephfs_jni.so.*
1655
1656 %post -n libcephfs_jni1 -p /sbin/ldconfig
1657
1658 %postun -n libcephfs_jni1 -p /sbin/ldconfig
1659
1660 %files -n libcephfs_jni-devel
1661 %{_libdir}/libcephfs_jni.so
1662
1663 %files -n cephfs-java
1664 %{_javadir}/libcephfs.jar
1665 %{_javadir}/libcephfs-test.jar
1666 %endif
1667
1668 %files -n rados-objclass-devel
1669 %dir %{_includedir}/rados
1670 %{_includedir}/rados/objclass.h
1671
1672 %if 0%{with selinux}
1673 %files selinux
1674 %attr(0600,root,root) %{_datadir}/selinux/packages/ceph.pp
1675 %{_datadir}/selinux/devel/include/contrib/ceph.if
1676 %{_mandir}/man8/ceph_selinux.8*
1677
1678 %post selinux
1679 # backup file_contexts before update
1680 . /etc/selinux/config
1681 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1682 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1683
1684 # Install the policy
1685 /usr/sbin/semodule -i %{_datadir}/selinux/packages/ceph.pp
1686
1687 # Load the policy if SELinux is enabled
1688 if ! /usr/sbin/selinuxenabled; then
1689 # Do not relabel if selinux is not enabled
1690 exit 0
1691 fi
1692
1693 if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
1694 # Do not relabel if file contexts did not change
1695 exit 0
1696 fi
1697
1698 # Check whether the daemons are running
1699 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
1700 STATUS=$?
1701
1702 # Stop the daemons if they were running
1703 if test $STATUS -eq 0; then
1704 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1705 fi
1706
1707 # Relabel the files
1708 # Use ceph-disk fix for first package install and fixfiles otherwise
1709 if [ "$1" = "1" ]; then
1710 /usr/sbin/ceph-disk fix --selinux
1711 else
1712 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1713 fi
1714
1715 rm -f ${FILE_CONTEXT}.pre
1716 # The fixfiles command won't fix label for /var/run/ceph
1717 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1718
1719 # Start the daemons iff they were running before
1720 if test $STATUS -eq 0; then
1721 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1722 fi
1723 exit 0
1724
1725 %postun selinux
1726 if [ $1 -eq 0 ]; then
1727 # backup file_contexts before update
1728 . /etc/selinux/config
1729 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1730 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1731
1732 # Remove the module
1733 /usr/sbin/semodule -n -r ceph > /dev/null 2>&1
1734
1735 # Reload the policy if SELinux is enabled
1736 if ! /usr/sbin/selinuxenabled ; then
1737 # Do not relabel if SELinux is not enabled
1738 exit 0
1739 fi
1740
1741 # Check whether the daemons are running
1742 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
1743 STATUS=$?
1744
1745 # Stop the daemons if they were running
1746 if test $STATUS -eq 0; then
1747 /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1748 fi
1749
1750 /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1751 rm -f ${FILE_CONTEXT}.pre
1752 # The fixfiles command won't fix label for /var/run/ceph
1753 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1754
1755 # Start the daemons if they were running before
1756 if test $STATUS -eq 0; then
1757 /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1758 fi
1759 fi
1760 exit 0
1761
1762 %endif # with selinux
1763
1764 %files -n python-ceph-compat
1765 # We need an empty %%files list for python-ceph-compat, to tell rpmbuild to
1766 # actually build this meta package.
1767
1768
1769 %changelog