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