# Upstream ceph commit upon which this package is based:
# patches_base=e132babf2904505731f0d45d5168c7e0e12c06be
Name: cephadm
Epoch: 2
Version: 16.2.4
Release: 5%{?dist}
Summary: Utility to bootstrap Ceph clusters
License: LGPL-2.1
URL: https://ceph.io
#Source0: https://github.com/ceph/ceph/raw/e132babf2904505731f0d45d5168c7e0e12c06be/src/cephadm/cephadm
Source0: https://raw.githubusercontent.com/ceph/ceph/pacific/src/cephadm/cephadm
Source1: COPYING-LGPL2.1
BuildArch: noarch
Requires: lvm2
Requires: python3
Recommends: podman
%description
Utility to bootstrap a Ceph cluster and manage Ceph daemons deployed
with systemd and podman.
%prep
cp %{SOURCE0} .
cp %{SOURCE1} .
%build
%install
mkdir -p %{buildroot}%{_sbindir}
install -m 0755 cephadm %{buildroot}%{_sbindir}/cephadm
mkdir -p %{buildroot}%{_sharedstatedir}/cephadm
chmod 0700 %{buildroot}%{_sharedstatedir}/cephadm
mkdir -p %{buildroot}%{_sharedstatedir}/cephadm/.ssh
chmod 0700 %{buildroot}%{_sharedstatedir}/cephadm/.ssh
touch %{buildroot}%{_sharedstatedir}/cephadm/.ssh/authorized_keys
chmod 0600 %{buildroot}%{_sharedstatedir}/cephadm/.ssh/authorized_keys
%pre
getent group cephadm >/dev/null || groupadd -r cephadm
getent passwd cephadm >/dev/null || useradd -r -g cephadm -s /bin/bash -c "cephadm user for mgr/cephadm" -d %{_sharedstatedir}/cephadm cephadm
exit 0
%postun
userdel -r cephadm || true
exit 0
%files
%license COPYING-LGPL2.1
%{_sbindir}/cephadm
%attr(0700,cephadm,cephadm) %dir %{_sharedstatedir}/cephadm
%attr(0700,cephadm,cephadm) %dir %{_sharedstatedir}/cephadm/.ssh
%attr(0600,cephadm,cephadm) %{_sharedstatedir}/cephadm/.ssh/authorized_keys
%changelog
* Thu Jun 17 2021 Francesco Pantano <fpantano@redhat.com> - 2:16.2.4-5
- 16.2.4-5 GA
* Thu Jun 11 2021 Francesco Pantano <fpantano@redhat.com> - 2:16.2.4-4
- 16.2.4-4 GA
* Thu Jun 10 2021 Francesco Pantano <fpantano@redhat.com> - 2:16.2.4-3
- 16.2.4-3 GA
* Thu Mar 25 2021 Francesco Pantano <fpantano@redhat.com> - 2:16.1.0-2
- 16.1.0-2 GA