From: Kefu Chai Date: Fri, 23 Jul 2021 11:19:43 +0000 (+0800) Subject: ceph.spec.in: split ceph-volume into a separated package X-Git-Tag: v17.1.0~879^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8e0e9ef382c5749954eb416107e4a7d22f92d41c;p=ceph.git ceph.spec.in: split ceph-volume into a separated package ceph-volume is a tool implemented in pure python, so it would be better to make it a architecture independent package for better maintainability. Signed-off-by: Kefu Chai --- diff --git a/ceph.spec.in b/ceph.spec.in index e643163a1925e..6ae89d9a4c140 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -796,12 +796,11 @@ Group: System/Filesystems %endif Provides: ceph-test:/usr/bin/ceph-osdomap-tool Requires: ceph-base = %{_epoch_prefix}%{version}-%{release} -Requires: lvm2 Requires: sudo Requires: libstoragemgmt -Requires: parted -Requires: python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release} -Requires: python%{python3_pkgversion}-setuptools +%if 0%{?weak_deps} +Recommends: ceph-volume = %{_epoch_prefix}%{version}-%{release} +%endif %description osd ceph-osd is the object storage daemon for the Ceph distributed file system. It is responsible for storing objects on a local file system @@ -821,6 +820,22 @@ system. It is responsible for storing objects on a local file system and providing access to them over the network. %endif +%package volume +Summary: Ceph OSD deployment and inspection tool +BuildArch: noarch +%if 0%{?suse_version} +Group: System/Filesystems +%endif +Requires: ceph-osd = %{_epoch_prefix}%{version}-%{release} +Requires: lvm2 +Requires: parted +Requires: python%{python3_pkgversion}-setuptools +Requires: python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release} +%description volume +This package contains a tool to deploy OSD with different devices like +lvm or physical disks, and trying to follow a predictable, and robust +way of preparing, activating, and starting the deployed OSD. + %package -n librados2 Summary: RADOS distributed object store client library %if 0%{?suse_version} @@ -2079,30 +2094,22 @@ fi %{_bindir}/ceph-osdomap-tool %{_bindir}/ceph-osd %{_libexecdir}/ceph/ceph-osd-prestart.sh -%{_sbindir}/ceph-volume -%{_sbindir}/ceph-volume-systemd -%dir %{python3_sitelib}/ceph_volume -%{python3_sitelib}/ceph_volume/* -%{python3_sitelib}/ceph_volume-* %{_mandir}/man8/ceph-clsinfo.8* %{_mandir}/man8/ceph-osd.8* %{_mandir}/man8/ceph-bluestore-tool.8* -%{_mandir}/man8/ceph-volume.8* -%{_mandir}/man8/ceph-volume-systemd.8* %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-osd.target -%{_unitdir}/ceph-volume@.service %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd %config(noreplace) %{_sysctldir}/90-ceph-osd.conf %post osd %if 0%{?suse_version} if [ $1 -eq 1 ] ; then - /usr/bin/systemctl preset ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target >/dev/null 2>&1 || : + /usr/bin/systemctl preset ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || : fi %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_post ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target +%systemd_post ceph-osd@\*.service ceph-osd.target %endif if [ $1 -eq 1 ] ; then /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || : @@ -2115,10 +2122,10 @@ fi %preun osd %if 0%{?suse_version} -%service_del_preun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target +%service_del_preun ceph-osd@\*.service ceph-osd.target %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_preun ceph-osd@\*.service ceph-volume@\*.service ceph-osd.target +%systemd_preun ceph-osd@\*.service ceph-osd.target %endif %postun osd @@ -2140,6 +2147,48 @@ fi %{_bindir}/crimson-osd %endif +%files volume +%{_sbindir}/ceph-volume +%{_sbindir}/ceph-volume-systemd +%dir %{python3_sitelib}/ceph_volume +%{python3_sitelib}/ceph_volume/* +%{python3_sitelib}/ceph_volume-* +%{_mandir}/man8/ceph-volume.8* +%{_mandir}/man8/ceph-volume-systemd.8* +%{_unitdir}/ceph-volume@.service + +%post volume +%if 0%{?suse_version} +if [ $1 -eq 1 ] ; then + /usr/bin/systemctl preset ceph-volume@\*.service >/dev/null 2>&1 || : +fi +%endif +%if 0%{?fedora} || 0%{?rhel} +%systemd_post ceph-volume@\*.service +%endif + +%preun volume +%if 0%{?suse_version} +%service_del_preun ceph-volume@\*.service +%endif +%if 0%{?fedora} || 0%{?rhel} +%systemd_preun ceph-volume@\*.service +%endif + +%postun volume +%systemd_postun ceph-volume@\*.service +if [ $1 -ge 1 ] ; then + # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to + # "yes". In any case: if units are not running, do not touch them. + SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph + if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then + source $SYSCONF_CEPH + fi + if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then + /usr/bin/systemctl try-restart ceph-volume@\*.service > /dev/null 2>&1 || : + fi +fi + %if %{with ocf} %files resource-agents