File python-virtualbmc.spec of Package python-virtualbmc
#
# spec file for package python39-virtualbmc
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python39-virtualbmc
Version: 2.2.1
Release: 0
Summary: Python module to create virtual BMCs for controlling virtual instances via IPMI
License: Apache-2.0
Group: Development/Languages/Python
URL: https://docs.openstack.org/virtualbmc
Source0: https://files.pythonhosted.org/packages/source/v/virtualbmc/virtualbmc-2.2.1.tar.gz
Source1: virtualbmc.service
BuildRequires: fdupes
BuildRequires: openstack-macros
BuildRequires: python39-pbr
Requires: python39-cliff
Requires: python39-libvirt-python
Requires: python39-pbr
Requires: python39-pyghmi
Requires: python39-pyzmq
Requires: python39-six
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%else
BuildRequires: systemd
Requires(post): systemd
Requires(postun):systemd
Requires(preun):systemd
%endif
%if 0%{?suse_version}
Requires(post): update-alternatives
Requires(postun):update-alternatives
%else
# on RDO, update-alternatives is in chkconfig
Requires(post): chkconfig
Requires(postun):chkconfig
%endif
%description
A virtual BMC for controlling virtual machines using IPMI commands.
%prep
%autosetup -p1 -n virtualbmc-2.2.1
%py_req_cleanup
%build
%py3_build
%install
%py3_install
# directories
install -d -m 755 %{buildroot}%{_datadir}/virtualbmc
install -d -m 755 %{buildroot}%{_sharedstatedir}/virtualbmc
install -d -m 750 %{buildroot}%{_localstatedir}/lib/virtualbmc
# systemd
install -p -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}/virtualbmc.service
%post
%systemd_post virtualbmc.service
%postun
%systemd_postun virtualbmc.service
%preun
%systemd_preun virtualbmc.service
%files
%license LICENSE
%{python3_sitelib}/*
%{_bindir}/vbmc
%{_bindir}/vbmcd
%{_unitdir}/virtualbmc.service
%changelog