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