Use proper naming macros for sushy-tools

Change-Id: I913dfdfaab0f29316cc3351b1e72b13f98796b56
This commit is contained in:
guangyee 2023-03-02 09:40:47 -08:00
parent d524d6f6bc
commit 4a4e844c87
1 changed files with 9 additions and 9 deletions

View File

@ -34,14 +34,14 @@ Requires(preun): systemd
%description
A set of tools to support the development and test of the Sushy library
%package -n python3-{{ py2name() }}
%package -n {{ py2name(py_versions='py3') }}
Summary: A set of tools to support the development and test of the Sushy library
Requires: {{ py3('Flask') }}
Requires: {{ py3('pbr') }}
Requires: {{ py3('requests') }}
Requires: {{ py3('tenacity') }}
%description -n python3-{{ py2name() }}
%description -n {{ py2name(py_versions='py3') }}
A set of tools to support the development and test of the Sushy library
%if 0%{?with_doc}
@ -51,7 +51,7 @@ BuildRequires: {{ py3('Sphinx') }}
BuildRequires: {{ py3('openstackdocstheme') }}
BuildRequires: {{ py3('sphinxcontrib-apidoc') }}
%description -n python3-{{ py2name() }}-doc
%description -n {{ py2name() }}-doc
Summary: sushy-tools documentation
%endif
@ -87,7 +87,7 @@ mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%endif
%files -n python3-{{ py2name() }}
%files -n {{ py2name(py_versions='py3') }}
%license LICENSE
%{_bindir}/sushy-emulator
%{_bindir}/sushy-static
@ -101,24 +101,24 @@ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%{_sbindir}/rc%{name}
%endif
%pre -n python3-{{ py2name() }}
%pre -n {{ py2name(py_versions='py3') }}
getent group sushy-tools >/dev/null || groupadd -r sushy-tools
getent passwd sushy-tools >/dev/null || useradd -r \
-g sushy-tools -M -s /sbin/nologin -c "Redfish Emulator" sushy-tools
%if 0%{?with_doc}
%files -n python-{{ py2name() }}-doc
%files -n {{ py2name() }}-doc
%license LICENSE
%doc doc/build/html README.rst
%endif
%post -n python3-{{ py2name() }}
%post -n {{ py2name(py_versions='py3') }}
%systemd_post sushy-emulator.service
%preun -n python3-{{ py2name() }}
%preun -n {{ py2name(py_versions='py3') }}
%systemd_preun sushy-emulator.service
%postun -n python3-{{ py2name() }}
%postun -n {{ py2name(py_versions='py3') }}
%systemd_postun_with_restart sushy-emulator.service
%changelog