Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / ceph.spec.in
1 # vim: set noexpandtab ts=8 sw=8 :
2 #
3 # spec file for package ceph
4 #
5 # Copyright (C) 2004-2017 The Ceph Project Developers. See COPYING file
6 # at the top-level directory of this distribution and at
7 # https://github.com/ceph/ceph/blob/master/COPYING
8 #
9 # All modifications and additions to the file contributed by third parties
10 # remain the property of their copyright owners, unless otherwise agreed
11 # upon.
12 #
13 # This file is under the GNU Lesser General Public License, version 2.1
14 #
15 # Please submit bugfixes or comments via http://tracker.ceph.com/
16 #
17 %bcond_without ocf
18 %bcond_without cephfs_java
19 %if 0%{?suse_version}
20 %bcond_with ceph_test_package
21 %else
22 %bcond_without ceph_test_package
23 %endif
24 %bcond_with make_check
25 %ifarch s390 s390x
26 %bcond_with tcmalloc
27 %else
28 %bcond_without tcmalloc
29 %endif
30 %bcond_with lowmem_builder
31 %if 0%{?fedora} || 0%{?rhel}
32 %bcond_without selinux
33 %endif
34 %if 0%{?suse_version}
35 %bcond_with selinux
36 %endif
37
38 # LTTng-UST enabled on Fedora, RHEL 6+, and SLE (not openSUSE)
39 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
40 %if ! 0%{?is_opensuse}
41 %bcond_without lttng
42 %endif
43 %endif
44
45 %if %{with selinux}
46 # get selinux policy version
47 %{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null || echo 0.0.0)}
48 %endif
49
50 %{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d}
51 %{!?tmpfiles_create: %global tmpfiles_create systemd-tmpfiles --create}
52 %{!?python3_pkgversion: %global python3_pkgversion 3}
53
54 # unify libexec for all targets
55 %global _libexecdir %{_exec_prefix}/lib
56
57 # disable dwz which compresses the debuginfo
58 %global _find_debuginfo_dwz_opts %{nil}
59
60 #################################################################################
61 # main package definition
62 #################################################################################
63 Name:           ceph
64 Version:        @VERSION@
65 Release:        @RPM_RELEASE@%{?dist}
66 %if 0%{?fedora} || 0%{?rhel}
67 Epoch:          2
68 %endif
69
70 # define _epoch_prefix macro which will expand to the empty string if epoch is
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/@TARBALL_BASENAME@.tar.bz2
81 %if 0%{?suse_version}
82 %if 0%{?is_opensuse}
83 ExclusiveArch:  x86_64 aarch64 ppc64 ppc64le
84 %else
85 ExclusiveArch:  x86_64 aarch64 ppc64le s390x
86 %endif
87 %endif
88 #################################################################################
89 # dependencies that apply across all distro families
90 #################################################################################
91 Requires:       ceph-osd = %{_epoch_prefix}%{version}-%{release}
92 Requires:       ceph-mds = %{_epoch_prefix}%{version}-%{release}
93 Requires:       ceph-mgr = %{_epoch_prefix}%{version}-%{release}
94 Requires:       ceph-mon = %{_epoch_prefix}%{version}-%{release}
95 Requires(post): binutils
96 %if 0%{with cephfs_java}
97 BuildRequires:  java-devel
98 BuildRequires:  sharutils
99 %endif
100 %if 0%{with selinux}
101 BuildRequires:  checkpolicy
102 BuildRequires:  selinux-policy-devel
103 BuildRequires:  /usr/share/selinux/devel/policyhelp
104 %endif
105 %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 @TARBALL_BASENAME@
779
780 %build
781 %if 0%{with cephfs_java}
782 # Find jni.h
783 for i in /usr/{lib64,lib}/jvm/java/include{,/linux}; do
784     [ -d $i ] && java_inc="$java_inc -I$i"
785 done
786 %endif
787
788 %if %{with lowmem_builder}
789 RPM_OPT_FLAGS="$RPM_OPT_FLAGS --param ggc-min-expand=20 --param ggc-min-heapsize=32768"
790 %endif
791 export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
792
793 export CPPFLAGS="$java_inc"
794 export CFLAGS="$RPM_OPT_FLAGS"
795 export CXXFLAGS="$RPM_OPT_FLAGS"
796
797 env | sort
798
799 %if %{with lowmem_builder}
800 %if 0%{?jobs} > 8
801 %define _smp_mflags -j8
802 %endif
803 %endif
804
805 # unlimit _smp_mflags in system macro if not set above
806 %define _smp_ncpus_max 0
807 # extract the number of processors for use with cmake
808 %define _smp_ncpus %(echo %{_smp_mflags} | sed 's/-j//')
809
810 mkdir build
811 cd build
812 cmake .. \
813     -DCMAKE_INSTALL_PREFIX=%{_prefix} \
814     -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
815     -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
816     -DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \
817     -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
818     -DCMAKE_INSTALL_MANDIR=%{_mandir} \
819     -DCMAKE_INSTALL_DOCDIR=%{_docdir}/ceph \
820     -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-kvstore-tool
937 %{_bindir}/ceph-run
938 %{_bindir}/ceph-detect-init
939 %{_libexecdir}/systemd/system-preset/50-ceph.preset
940 %{_sbindir}/ceph-create-keys
941 %{_sbindir}/ceph-disk
942 %{_sbindir}/ceph-volume
943 %{_sbindir}/ceph-volume-systemd
944 %{_sbindir}/rcceph
945 %dir %{_libexecdir}/ceph
946 %{_libexecdir}/ceph/ceph_common.sh
947 %dir %{_libdir}/rados-classes
948 %{_libdir}/rados-classes/*
949 %dir %{_libdir}/ceph
950 %dir %{_libdir}/ceph/erasure-code
951 %{_libdir}/ceph/erasure-code/libec_*.so*
952 %dir %{_libdir}/ceph/compressor
953 %{_libdir}/ceph/compressor/libceph_*.so*
954 %ifarch x86_64
955 %dir %{_libdir}/ceph/crypto
956 %{_libdir}/ceph/crypto/libceph_*.so*
957 %endif
958 %if %{with lttng}
959 %{_libdir}/libos_tp.so*
960 %{_libdir}/libosd_tp.so*
961 %endif
962 %config(noreplace) %{_sysconfdir}/logrotate.d/ceph
963 %if 0%{?fedora} || 0%{?rhel}
964 %config(noreplace) %{_sysconfdir}/sysconfig/ceph
965 %endif
966 %if 0%{?suse_version}
967 %{_localstatedir}/adm/fillup-templates/sysconfig.*
968 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon
969 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds
970 %endif
971 %{_unitdir}/ceph-disk@.service
972 %{_unitdir}/ceph-volume@.service
973 %{_unitdir}/ceph.target
974 %{python_sitelib}/ceph_detect_init*
975 %{python_sitelib}/ceph_disk*
976 %dir %{python_sitelib}/ceph_volume
977 %{python_sitelib}/ceph_volume/*
978 %{python_sitelib}/ceph_volume-*
979 %{_mandir}/man8/ceph-deploy.8*
980 %{_mandir}/man8/ceph-detect-init.8*
981 %{_mandir}/man8/ceph-create-keys.8*
982 %{_mandir}/man8/ceph-disk.8*
983 %{_mandir}/man8/ceph-volume.8*
984 %{_mandir}/man8/ceph-volume-systemd.8*
985 %{_mandir}/man8/ceph-run.8*
986 %{_mandir}/man8/crushtool.8*
987 %{_mandir}/man8/osdmaptool.8*
988 %{_mandir}/man8/monmaptool.8*
989 %{_mandir}/man8/ceph-kvstore-tool.8*
990 #set up placeholder directories
991 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/tmp
992 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-osd
993 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mds
994 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rgw
995 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
996 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
997
998 %post base
999 /sbin/ldconfig
1000 %if 0%{?suse_version}
1001 %fillup_only
1002 if [ $1 -eq 1 ] ; then
1003   /usr/bin/systemctl preset ceph-disk@\*.service ceph.target >/dev/null 2>&1 || :
1004 fi
1005 %endif
1006 %if 0%{?fedora} || 0%{?rhel}
1007 %systemd_post ceph-disk@\*.service ceph.target
1008 %systemd_post ceph-volume@\*.service ceph.target
1009 %endif
1010 if [ $1 -eq 1 ] ; then
1011 /usr/bin/systemctl start ceph.target >/dev/null 2>&1 || :
1012 fi
1013
1014 %preun base
1015 %if 0%{?suse_version}
1016 %service_del_preun ceph-disk@\*.service ceph.target
1017 %endif
1018 %if 0%{?fedora} || 0%{?rhel}
1019 %systemd_preun ceph-disk@\*.service ceph.target
1020 %systemd_preun ceph-volume@\*.service ceph.target
1021 %endif
1022
1023 %postun base
1024 /sbin/ldconfig
1025 test -n "$FIRST_ARG" || FIRST_ARG=$1
1026 %if 0%{?suse_version}
1027 DISABLE_RESTART_ON_UPDATE="yes"
1028 %service_del_postun ceph-disk@\*.service ceph.target
1029 %endif
1030 %if 0%{?fedora} || 0%{?rhel}
1031 %systemd_postun ceph-disk@\*.service ceph.target
1032 %endif
1033 if [ $FIRST_ARG -ge 1 ] ; then
1034   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1035   # "yes". In any case: if units are not running, do not touch them.
1036   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1037   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1038     source $SYSCONF_CEPH
1039   fi
1040   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1041     /usr/bin/systemctl try-restart ceph-disk@\*.service ceph-volume@\*.service > /dev/null 2>&1 || :
1042   fi
1043 fi
1044
1045 %files common
1046 %dir %{_docdir}/ceph
1047 %doc %{_docdir}/ceph/sample.ceph.conf
1048 %doc %{_docdir}/ceph/COPYING
1049 %{_bindir}/ceph
1050 %{_bindir}/ceph-authtool
1051 %{_bindir}/ceph-conf
1052 %{_bindir}/ceph-dencoder
1053 %{_bindir}/ceph-rbdnamer
1054 %{_bindir}/ceph-syn
1055 %{_bindir}/ceph-crush-location
1056 %{_bindir}/cephfs-data-scan
1057 %{_bindir}/cephfs-journal-tool
1058 %{_bindir}/cephfs-table-tool
1059 %{_bindir}/rados
1060 %{_bindir}/radosgw-admin
1061 %{_bindir}/rbd
1062 %{_bindir}/rbd-replay
1063 %{_bindir}/rbd-replay-many
1064 %{_bindir}/rbdmap
1065 %{_sbindir}/mount.ceph
1066 %if 0%{?suse_version}
1067 /sbin/mount.ceph
1068 %endif
1069 %if %{with lttng}
1070 %{_bindir}/rbd-replay-prep
1071 %endif
1072 %{_bindir}/ceph-post-file
1073 %{_bindir}/ceph-brag
1074 %{_tmpfilesdir}/ceph-common.conf
1075 %{_mandir}/man8/ceph-authtool.8*
1076 %{_mandir}/man8/ceph-conf.8*
1077 %{_mandir}/man8/ceph-dencoder.8*
1078 %{_mandir}/man8/ceph-rbdnamer.8*
1079 %{_mandir}/man8/ceph-syn.8*
1080 %{_mandir}/man8/ceph-post-file.8*
1081 %{_mandir}/man8/ceph.8*
1082 %{_mandir}/man8/mount.ceph.8*
1083 %{_mandir}/man8/rados.8*
1084 %{_mandir}/man8/radosgw-admin.8*
1085 %{_mandir}/man8/rbd.8*
1086 %{_mandir}/man8/rbdmap.8*
1087 %{_mandir}/man8/rbd-replay.8*
1088 %{_mandir}/man8/rbd-replay-many.8*
1089 %{_mandir}/man8/rbd-replay-prep.8*
1090 %dir %{_datadir}/ceph/
1091 %{_datadir}/ceph/known_hosts_drop.ceph.com
1092 %{_datadir}/ceph/id_rsa_drop.ceph.com
1093 %{_datadir}/ceph/id_rsa_drop.ceph.com.pub
1094 %dir %{_sysconfdir}/ceph/
1095 %config %{_sysconfdir}/bash_completion.d/ceph
1096 %config %{_sysconfdir}/bash_completion.d/rados
1097 %config %{_sysconfdir}/bash_completion.d/rbd
1098 %config %{_sysconfdir}/bash_completion.d/radosgw-admin
1099 %config(noreplace) %{_sysconfdir}/ceph/rbdmap
1100 %{_unitdir}/rbdmap.service
1101 %{python_sitelib}/ceph_argparse.py*
1102 %{python_sitelib}/ceph_daemon.py*
1103 %dir %{_udevrulesdir}
1104 %{_udevrulesdir}/50-rbd.rules
1105 %attr(3770,ceph,ceph) %dir %{_localstatedir}/log/ceph/
1106 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/
1107
1108 %pre common
1109 CEPH_GROUP_ID=167
1110 CEPH_USER_ID=167
1111 %if 0%{?rhel} || 0%{?fedora}
1112 /usr/sbin/groupadd ceph -g $CEPH_GROUP_ID -o -r 2>/dev/null || :
1113 /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 || :
1114 %endif
1115 %if 0%{?suse_version}
1116 if ! getent group ceph >/dev/null ; then
1117     CEPH_GROUP_ID_OPTION=""
1118     getent group $CEPH_GROUP_ID >/dev/null || CEPH_GROUP_ID_OPTION="-g $CEPH_GROUP_ID"
1119     groupadd ceph $CEPH_GROUP_ID_OPTION -r 2>/dev/null || :
1120 fi
1121 if ! getent passwd ceph >/dev/null ; then
1122     CEPH_USER_ID_OPTION=""
1123     getent passwd $CEPH_USER_ID >/dev/null || CEPH_USER_ID_OPTION="-u $CEPH_USER_ID"
1124     useradd ceph $CEPH_USER_ID_OPTION -r -g ceph -s /sbin/nologin 2>/dev/null || :
1125 fi
1126 usermod -c "Ceph storage service" \
1127         -d %{_localstatedir}/lib/ceph \
1128         -g ceph \
1129         -s /sbin/nologin \
1130         ceph
1131 %endif
1132 exit 0
1133
1134 %post common
1135 %tmpfiles_create %{_tmpfilesdir}/ceph-common.conf
1136
1137 %postun common
1138 # Package removal cleanup
1139 if [ "$1" -eq "0" ] ; then
1140     rm -rf %{_localstatedir}/log/ceph
1141     rm -rf %{_sysconfdir}/ceph
1142 fi
1143
1144 %files mds
1145 %{_bindir}/ceph-mds
1146 %{_mandir}/man8/ceph-mds.8*
1147 %{_unitdir}/ceph-mds@.service
1148 %{_unitdir}/ceph-mds.target
1149 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mds
1150
1151 %post mds
1152 %if 0%{?suse_version}
1153 if [ $1 -eq 1 ] ; then
1154   /usr/bin/systemctl preset ceph-mds@\*.service ceph-mds.target >/dev/null 2>&1 || :
1155 fi
1156 %endif
1157 %if 0%{?fedora} || 0%{?rhel}
1158 %systemd_post ceph-mds@\*.service ceph-mds.target
1159 %endif
1160 if [ $1 -eq 1 ] ; then
1161 /usr/bin/systemctl start ceph-mds.target >/dev/null 2>&1 || :
1162 fi
1163
1164 %preun mds
1165 %if 0%{?suse_version}
1166 %service_del_preun ceph-mds@\*.service ceph-mds.target
1167 %endif
1168 %if 0%{?fedora} || 0%{?rhel}
1169 %systemd_preun ceph-mds@\*.service ceph-mds.target
1170 %endif
1171
1172 %postun mds
1173 test -n "$FIRST_ARG" || FIRST_ARG=$1
1174 %if 0%{?suse_version}
1175 DISABLE_RESTART_ON_UPDATE="yes"
1176 %service_del_postun ceph-mds@\*.service ceph-mds.target
1177 %endif
1178 %if 0%{?fedora} || 0%{?rhel}
1179 %systemd_postun ceph-mds@\*.service ceph-mds.target
1180 %endif
1181 if [ $FIRST_ARG -ge 1 ] ; then
1182   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1183   # "yes". In any case: if units are not running, do not touch them.
1184   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1185   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1186     source $SYSCONF_CEPH
1187   fi
1188   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1189     /usr/bin/systemctl try-restart ceph-mds@\*.service > /dev/null 2>&1 || :
1190   fi
1191 fi
1192
1193 %files mgr
1194 %{_bindir}/ceph-mgr
1195 %{_libdir}/ceph/mgr
1196 %{_unitdir}/ceph-mgr@.service
1197 %{_unitdir}/ceph-mgr.target
1198 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mgr
1199
1200 %post mgr
1201 %if 0%{?suse_version}
1202 if [ $1 -eq 1 ] ; then
1203   /usr/bin/systemctl preset ceph-mgr@\*.service ceph-mgr.target >/dev/null 2>&1 || :
1204 fi
1205 %endif
1206 %if 0%{?fedora} || 0%{?rhel}
1207 %systemd_post ceph-mgr@\*.service ceph-mgr.target
1208 %endif
1209 if [ $1 -eq 1 ] ; then
1210 /usr/bin/systemctl start ceph-mgr.target >/dev/null 2>&1 || :
1211 fi
1212
1213 %preun mgr
1214 %if 0%{?suse_version}
1215 %service_del_preun ceph-mgr@\*.service ceph-mgr.target
1216 %endif
1217 %if 0%{?fedora} || 0%{?rhel}
1218 %systemd_preun ceph-mgr@\*.service ceph-mgr.target
1219 %endif
1220
1221 %postun mgr
1222 test -n "$FIRST_ARG" || FIRST_ARG=$1
1223 %if 0%{?suse_version}
1224 DISABLE_RESTART_ON_UPDATE="yes"
1225 %service_del_postun ceph-mgr@\*.service ceph-mgr.target
1226 %endif
1227 %if 0%{?fedora} || 0%{?rhel}
1228 %systemd_postun ceph-mgr@\*.service ceph-mgr.target
1229 %endif
1230 if [ $FIRST_ARG -ge 1 ] ; then
1231   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1232   # "yes". In any case: if units are not running, do not touch them.
1233   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1234   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1235     source $SYSCONF_CEPH
1236   fi
1237   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1238     /usr/bin/systemctl try-restart ceph-mgr@\*.service > /dev/null 2>&1 || :
1239   fi
1240 fi
1241
1242 %files mon
1243 %{_bindir}/ceph-mon
1244 %{_bindir}/ceph-rest-api
1245 %{_bindir}/ceph-monstore-tool
1246 %{_mandir}/man8/ceph-mon.8*
1247 %{_mandir}/man8/ceph-rest-api.8*
1248 %{python_sitelib}/ceph_rest_api.py*
1249 %{_unitdir}/ceph-mon@.service
1250 %{_unitdir}/ceph-mon.target
1251 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mon
1252
1253 %post mon
1254 %if 0%{?suse_version}
1255 if [ $1 -eq 1 ] ; then
1256   /usr/bin/systemctl preset ceph-mon@\*.service ceph-mon.target >/dev/null 2>&1 || :
1257 fi
1258 %endif
1259 %if 0%{?fedora} || 0%{?rhel}
1260 %systemd_post ceph-mon@\*.service ceph-mon.target
1261 %endif
1262 if [ $1 -eq 1 ] ; then
1263 /usr/bin/systemctl start ceph-mon.target >/dev/null 2>&1 || :
1264 fi
1265
1266 %preun mon
1267 %if 0%{?suse_version}
1268 %service_del_preun ceph-mon@\*.service ceph-mon.target
1269 %endif
1270 %if 0%{?fedora} || 0%{?rhel}
1271 %systemd_preun ceph-mon@\*.service ceph-mon.target
1272 %endif
1273
1274 %postun mon
1275 test -n "$FIRST_ARG" || FIRST_ARG=$1
1276 %if 0%{?suse_version}
1277 DISABLE_RESTART_ON_UPDATE="yes"
1278 %service_del_postun ceph-mon@\*.service ceph-mon.target
1279 %endif
1280 %if 0%{?fedora} || 0%{?rhel}
1281 %systemd_postun ceph-mon@\*.service ceph-mon.target
1282 %endif
1283 if [ $FIRST_ARG -ge 1 ] ; then
1284   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1285   # "yes". In any case: if units are not running, do not touch them.
1286   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1287   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1288     source $SYSCONF_CEPH
1289   fi
1290   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1291     /usr/bin/systemctl try-restart ceph-mon@\*.service > /dev/null 2>&1 || :
1292   fi
1293 fi
1294
1295 %files fuse
1296 %{_bindir}/ceph-fuse
1297 %{_mandir}/man8/ceph-fuse.8*
1298 %{_sbindir}/mount.fuse.ceph
1299 %{_unitdir}/ceph-fuse@.service
1300 %{_unitdir}/ceph-fuse.target
1301
1302 %files -n rbd-fuse
1303 %{_bindir}/rbd-fuse
1304 %{_mandir}/man8/rbd-fuse.8*
1305
1306 %files -n rbd-mirror
1307 %{_bindir}/rbd-mirror
1308 %{_mandir}/man8/rbd-mirror.8*
1309 %{_unitdir}/ceph-rbd-mirror@.service
1310 %{_unitdir}/ceph-rbd-mirror.target
1311
1312 %post -n rbd-mirror
1313 %if 0%{?suse_version}
1314 if [ $1 -eq 1 ] ; then
1315   /usr/bin/systemctl preset ceph-rbd-mirror@\*.service ceph-rbd-mirror.target >/dev/null 2>&1 || :
1316 fi
1317 %endif
1318 %if 0%{?fedora} || 0%{?rhel}
1319 %systemd_post ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1320 %endif
1321 if [ $1 -eq 1 ] ; then
1322 /usr/bin/systemctl start ceph-rbd-mirror.target >/dev/null 2>&1 || :
1323 fi
1324
1325 %preun -n rbd-mirror
1326 %if 0%{?suse_version}
1327 %service_del_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1328 %endif
1329 %if 0%{?fedora} || 0%{?rhel}
1330 %systemd_preun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1331 %endif
1332
1333 %postun -n rbd-mirror
1334 test -n "$FIRST_ARG" || FIRST_ARG=$1
1335 %if 0%{?suse_version}
1336 DISABLE_RESTART_ON_UPDATE="yes"
1337 %service_del_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1338 %endif
1339 %if 0%{?fedora} || 0%{?rhel}
1340 %systemd_postun ceph-rbd-mirror@\*.service ceph-rbd-mirror.target
1341 %endif
1342 if [ $FIRST_ARG -ge 1 ] ; then
1343   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1344   # "yes". In any case: if units are not running, do not touch them.
1345   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1346   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1347     source $SYSCONF_CEPH
1348   fi
1349   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1350     /usr/bin/systemctl try-restart ceph-rbd-mirror@\*.service > /dev/null 2>&1 || :
1351   fi
1352 fi
1353
1354 %files -n rbd-nbd
1355 %{_bindir}/rbd-nbd
1356 %{_mandir}/man8/rbd-nbd.8*
1357
1358 %files radosgw
1359 %{_bindir}/radosgw
1360 %{_bindir}/radosgw-token
1361 %{_bindir}/radosgw-es
1362 %{_bindir}/radosgw-object-expirer
1363 %{_mandir}/man8/radosgw.8*
1364 %dir %{_localstatedir}/lib/ceph/radosgw
1365 %{_unitdir}/ceph-radosgw@.service
1366 %{_unitdir}/ceph-radosgw.target
1367
1368 %post radosgw
1369 %if 0%{?suse_version}
1370 if [ $1 -eq 1 ] ; then
1371   /usr/bin/systemctl preset ceph-radosgw@\*.service ceph-radosgw.target >/dev/null 2>&1 || :
1372 fi
1373 %endif
1374 %if 0%{?fedora} || 0%{?rhel}
1375 %systemd_post ceph-radosgw@\*.service ceph-radosgw.target
1376 %endif
1377 if [ $1 -eq 1 ] ; then
1378 /usr/bin/systemctl start ceph-radosgw.target >/dev/null 2>&1 || :
1379 fi
1380
1381 %preun radosgw
1382 %if 0%{?suse_version}
1383 %service_del_preun ceph-radosgw@\*.service ceph-radosgw.target
1384 %endif
1385 %if 0%{?fedora} || 0%{?rhel}
1386 %systemd_preun ceph-radosgw@\*.service ceph-radosgw.target
1387 %endif
1388
1389 %postun radosgw
1390 test -n "$FIRST_ARG" || FIRST_ARG=$1
1391 %if 0%{?suse_version}
1392 DISABLE_RESTART_ON_UPDATE="yes"
1393 %service_del_postun ceph-radosgw@\*.service ceph-radosgw.target
1394 %endif
1395 %if 0%{?fedora} || 0%{?rhel}
1396 %systemd_postun ceph-radosgw@\*.service ceph-radosgw.target
1397 %endif
1398 if [ $FIRST_ARG -ge 1 ] ; then
1399   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1400   # "yes". In any case: if units are not running, do not touch them.
1401   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1402   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1403     source $SYSCONF_CEPH
1404   fi
1405   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1406     /usr/bin/systemctl try-restart ceph-radosgw@\*.service > /dev/null 2>&1 || :
1407   fi
1408 fi
1409
1410 %files osd
1411 %{_bindir}/ceph-clsinfo
1412 %{_bindir}/ceph-bluestore-tool
1413 %{_bindir}/ceph-objectstore-tool
1414 %{_bindir}/ceph-osdomap-tool
1415 %{_bindir}/ceph-osd
1416 %{_libexecdir}/ceph/ceph-osd-prestart.sh
1417 %dir %{_udevrulesdir}
1418 %{_udevrulesdir}/60-ceph-by-parttypeuuid.rules
1419 %{_udevrulesdir}/95-ceph-osd.rules
1420 %{_mandir}/man8/ceph-clsinfo.8*
1421 %{_mandir}/man8/ceph-osd.8*
1422 %{_mandir}/man8/ceph-bluestore-tool.8*
1423 %if 0%{?rhel} && ! 0%{?centos}
1424 %attr(0755,-,-) %{_sysconfdir}/cron.hourly/subman
1425 %endif
1426 %{_unitdir}/ceph-osd@.service
1427 %{_unitdir}/ceph-osd.target
1428 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
1429 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
1430
1431 %post osd
1432 %if 0%{?suse_version}
1433 if [ $1 -eq 1 ] ; then
1434   /usr/bin/systemctl preset ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || :
1435 fi
1436 %endif
1437 %if 0%{?fedora} || 0%{?rhel}
1438 %systemd_post ceph-osd@\*.service ceph-osd.target
1439 %endif
1440 if [ $1 -eq 1 ] ; then
1441 /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || :
1442 fi
1443 %if 0%{?sysctl_apply}
1444     %sysctl_apply 90-ceph-osd.conf
1445 %else
1446     /usr/lib/systemd/systemd-sysctl %{_sysctldir}/90-ceph-osd.conf > /dev/null 2>&1 || :
1447 %endif
1448
1449 %preun osd
1450 %if 0%{?suse_version}
1451 %service_del_preun ceph-osd@\*.service ceph-osd.target
1452 %endif
1453 %if 0%{?fedora} || 0%{?rhel}
1454 %systemd_preun ceph-osd@\*.service ceph-osd.target
1455 %endif
1456
1457 %postun osd
1458 test -n "$FIRST_ARG" || FIRST_ARG=$1
1459 %if 0%{?suse_version}
1460 DISABLE_RESTART_ON_UPDATE="yes"
1461 %service_del_postun ceph-osd@\*.service ceph-osd.target
1462 %endif
1463 %if 0%{?fedora} || 0%{?rhel}
1464 %systemd_postun ceph-osd@\*.service ceph-osd.target
1465 %endif
1466 if [ $FIRST_ARG -ge 1 ] ; then
1467   # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
1468   # "yes". In any case: if units are not running, do not touch them.
1469   SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
1470   if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
1471     source $SYSCONF_CEPH
1472   fi
1473   if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
1474     /usr/bin/systemctl try-restart ceph-osd@\*.service > /dev/null 2>&1 || :
1475   fi
1476 fi
1477
1478 %if %{with ocf}
1479
1480 %files resource-agents
1481 %dir %{_prefix}/lib/ocf
1482 %dir %{_prefix}/lib/ocf/resource.d
1483 %dir %{_prefix}/lib/ocf/resource.d/ceph
1484 %{_prefix}/lib/ocf/resource.d/ceph/rbd
1485
1486 %endif
1487
1488 %files -n librados2
1489 %{_libdir}/librados.so.*
1490 %dir %{_libdir}/ceph
1491 %{_libdir}/ceph/libceph-common.so*
1492 %if %{with lttng}
1493 %{_libdir}/librados_tp.so.*
1494 %endif
1495
1496 %post -n librados2 -p /sbin/ldconfig
1497
1498 %postun -n librados2 -p /sbin/ldconfig
1499
1500 %files -n librados-devel
1501 %dir %{_includedir}/rados
1502 %{_includedir}/rados/librados.h
1503 %{_includedir}/rados/librados.hpp
1504 %{_includedir}/rados/buffer.h
1505 %{_includedir}/rados/buffer_fwd.h
1506 %{_includedir}/rados/inline_memory.h
1507 %{_includedir}/rados/page.h
1508 %{_includedir}/rados/crc32c.h
1509 %{_includedir}/rados/rados_types.h
1510 %{_includedir}/rados/rados_types.hpp
1511 %{_includedir}/rados/memory.h
1512 %{_libdir}/librados.so
1513 %if %{with lttng}
1514 %{_libdir}/librados_tp.so
1515 %endif
1516 %{_bindir}/librados-config
1517 %{_mandir}/man8/librados-config.8*
1518
1519 %files -n python-rados
1520 %{python_sitearch}/rados.so
1521 %{python_sitearch}/rados-*.egg-info
1522
1523 %files -n python%{python3_pkgversion}-rados
1524 %{python3_sitearch}/rados.cpython*.so
1525 %{python3_sitearch}/rados-*.egg-info
1526
1527 %files -n libradosstriper1
1528 %{_libdir}/libradosstriper.so.*
1529
1530 %post -n libradosstriper1 -p /sbin/ldconfig
1531
1532 %postun -n libradosstriper1 -p /sbin/ldconfig
1533
1534 %files -n libradosstriper-devel
1535 %dir %{_includedir}/radosstriper
1536 %{_includedir}/radosstriper/libradosstriper.h
1537 %{_includedir}/radosstriper/libradosstriper.hpp
1538 %{_libdir}/libradosstriper.so
1539
1540 %files -n librbd1
1541 %{_libdir}/librbd.so.*
1542 %if %{with lttng}
1543 %{_libdir}/librbd_tp.so.*
1544 %endif
1545
1546 %post -n librbd1 -p /sbin/ldconfig
1547
1548 %postun -n librbd1 -p /sbin/ldconfig
1549
1550 %files -n librbd-devel
1551 %dir %{_includedir}/rbd
1552 %{_includedir}/rbd/librbd.h
1553 %{_includedir}/rbd/librbd.hpp
1554 %{_includedir}/rbd/features.h
1555 %{_libdir}/librbd.so
1556 %if %{with lttng}
1557 %{_libdir}/librbd_tp.so
1558 %endif
1559
1560 %files -n librgw2
1561 %{_libdir}/librgw.so.*
1562
1563 %post -n librgw2 -p /sbin/ldconfig
1564
1565 %postun -n librgw2 -p /sbin/ldconfig
1566
1567 %files -n librgw-devel
1568 %dir %{_includedir}/rados
1569 %{_includedir}/rados/librgw.h
1570 %{_includedir}/rados/rgw_file.h
1571 %{_libdir}/librgw.so
1572
1573 %files -n python-rgw
1574 %{python_sitearch}/rgw.so
1575 %{python_sitearch}/rgw-*.egg-info
1576
1577 %files -n python%{python3_pkgversion}-rgw
1578 %{python3_sitearch}/rgw.cpython*.so
1579 %{python3_sitearch}/rgw-*.egg-info
1580
1581 %files -n python-rbd
1582 %{python_sitearch}/rbd.so
1583 %{python_sitearch}/rbd-*.egg-info
1584
1585 %files -n python%{python3_pkgversion}-rbd
1586 %{python3_sitearch}/rbd.cpython*.so
1587 %{python3_sitearch}/rbd-*.egg-info
1588
1589 %files -n libcephfs2
1590 %{_libdir}/libcephfs.so.*
1591
1592 %post -n libcephfs2 -p /sbin/ldconfig
1593
1594 %postun -n libcephfs2 -p /sbin/ldconfig
1595
1596 %files -n libcephfs-devel
1597 %dir %{_includedir}/cephfs
1598 %{_includedir}/cephfs/libcephfs.h
1599 %{_includedir}/cephfs/ceph_statx.h
1600 %{_libdir}/libcephfs.so
1601
1602 %files -n python-cephfs
1603 %{python_sitearch}/cephfs.so
1604 %{python_sitearch}/cephfs-*.egg-info
1605 %{python_sitelib}/ceph_volume_client.py*
1606
1607 %files -n python%{python3_pkgversion}-cephfs
1608 %{python3_sitearch}/cephfs.cpython*.so
1609 %{python3_sitearch}/cephfs-*.egg-info
1610 %{python3_sitelib}/ceph_volume_client.py
1611 %{python3_sitelib}/__pycache__/ceph_volume_client.cpython*.py*
1612
1613 %files -n python%{python3_pkgversion}-ceph-argparse
1614 %{python3_sitelib}/ceph_argparse.py
1615 %{python3_sitelib}/__pycache__/ceph_argparse.cpython*.py*
1616 %{python3_sitelib}/ceph_daemon.py
1617 %{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py*
1618
1619 %if 0%{with ceph_test_package}
1620 %files -n ceph-test
1621 %{_bindir}/ceph-client-debug
1622 %{_bindir}/ceph_bench_log
1623 %{_bindir}/ceph_kvstorebench
1624 %{_bindir}/ceph_multi_stress_watch
1625 %{_bindir}/ceph_erasure_code
1626 %{_bindir}/ceph_erasure_code_benchmark
1627 %{_bindir}/ceph_omapbench
1628 %{_bindir}/ceph_objectstore_bench
1629 %{_bindir}/ceph_perf_objectstore
1630 %{_bindir}/ceph_perf_local
1631 %{_bindir}/ceph_perf_msgr_client
1632 %{_bindir}/ceph_perf_msgr_server
1633 %{_bindir}/ceph_psim
1634 %{_bindir}/ceph_radosacl
1635 %{_bindir}/ceph_rgw_jsonparser
1636 %{_bindir}/ceph_rgw_multiparser
1637 %{_bindir}/ceph_scratchtool
1638 %{_bindir}/ceph_scratchtoolpp
1639 %{_bindir}/ceph_smalliobench
1640 %{_bindir}/ceph_smalliobenchdumb
1641 %{_bindir}/ceph_smalliobenchfs
1642 %{_bindir}/ceph_smalliobenchrbd
1643 %{_bindir}/ceph_test_*
1644 %{_bindir}/ceph_tpbench
1645 %{_bindir}/ceph_xattr_bench
1646 %{_bindir}/ceph-coverage
1647 %{_bindir}/ceph-debugpack
1648 %{_mandir}/man8/ceph-debugpack.8*
1649 %dir %{_libdir}/ceph
1650 %{_libdir}/ceph/ceph-monstore-update-crush.sh
1651 %endif
1652
1653 %if 0%{with cephfs_java}
1654 %files -n libcephfs_jni1
1655 %{_libdir}/libcephfs_jni.so.*
1656
1657 %post -n libcephfs_jni1 -p /sbin/ldconfig
1658
1659 %postun -n libcephfs_jni1 -p /sbin/ldconfig
1660
1661 %files -n libcephfs_jni-devel
1662 %{_libdir}/libcephfs_jni.so
1663
1664 %files -n cephfs-java
1665 %{_javadir}/libcephfs.jar
1666 %{_javadir}/libcephfs-test.jar
1667 %endif
1668
1669 %files -n rados-objclass-devel
1670 %dir %{_includedir}/rados
1671 %{_includedir}/rados/objclass.h
1672
1673 %if 0%{with selinux}
1674 %files selinux
1675 %attr(0600,root,root) %{_datadir}/selinux/packages/ceph.pp
1676 %{_datadir}/selinux/devel/include/contrib/ceph.if
1677 %{_mandir}/man8/ceph_selinux.8*
1678
1679 %post selinux
1680 # backup file_contexts before update
1681 . /etc/selinux/config
1682 FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1683 cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1684
1685 # Install the policy
1686 /usr/sbin/semodule -i %{_datadir}/selinux/packages/ceph.pp
1687
1688 # Load the policy if SELinux is enabled
1689 if ! /usr/sbin/selinuxenabled; then
1690     # Do not relabel if selinux is not enabled
1691     exit 0
1692 fi
1693
1694 if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
1695    # Do not relabel if file contexts did not change
1696    exit 0
1697 fi
1698
1699 # Check whether the daemons are running
1700 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
1701 STATUS=$?
1702
1703 # Stop the daemons if they were running
1704 if test $STATUS -eq 0; then
1705     /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1706 fi
1707
1708 # Relabel the files
1709 # Use ceph-disk fix for first package install and fixfiles otherwise
1710 if [ "$1" = "1" ]; then
1711     /usr/sbin/ceph-disk fix --selinux
1712 else
1713     /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1714 fi
1715
1716 rm -f ${FILE_CONTEXT}.pre
1717 # The fixfiles command won't fix label for /var/run/ceph
1718 /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1719
1720 # Start the daemons iff they were running before
1721 if test $STATUS -eq 0; then
1722     /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1723 fi
1724 exit 0
1725
1726 %postun selinux
1727 if [ $1 -eq 0 ]; then
1728     # backup file_contexts before update
1729     . /etc/selinux/config
1730     FILE_CONTEXT=/etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts
1731     cp ${FILE_CONTEXT} ${FILE_CONTEXT}.pre
1732
1733     # Remove the module
1734     /usr/sbin/semodule -n -r ceph > /dev/null 2>&1
1735
1736     # Reload the policy if SELinux is enabled
1737     if ! /usr/sbin/selinuxenabled ; then
1738         # Do not relabel if SELinux is not enabled
1739         exit 0
1740     fi
1741
1742     # Check whether the daemons are running
1743     /usr/bin/systemctl status ceph.target > /dev/null 2>&1
1744     STATUS=$?
1745
1746     # Stop the daemons if they were running
1747     if test $STATUS -eq 0; then
1748         /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
1749     fi
1750
1751     /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
1752     rm -f ${FILE_CONTEXT}.pre
1753     # The fixfiles command won't fix label for /var/run/ceph
1754     /usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
1755
1756     # Start the daemons if they were running before
1757     if test $STATUS -eq 0; then
1758         /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
1759     fi
1760 fi
1761 exit 0
1762
1763 %endif # with selinux
1764
1765 %files -n python-ceph-compat
1766 # We need an empty %%files list for python-ceph-compat, to tell rpmbuild to
1767 # actually build this meta package.
1768
1769
1770 %changelog