# Upstream ceph commit upon which this package is based:
# patches_base=353d6970361a26381539b74a94bba8ac32666dc1
Name: cephadm
Epoch: 2
Version: 15.2.9
Release: 46%{?dist}
Summary: Utility to bootstrap Ceph clusters
License: LGPL-2.1
URL: https://ceph.io
Source0: https://github.com/ceph/ceph/raw/353d6970361a26381539b74a94bba8ac32666dc1/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
* Tue Mar 02 2021 Ken Dreyer <kdreyer@redhat.com> - 2:15.2.9-46
- initial octopus package