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