File python-virtualbmc.spec of Package python-virtualbmc

# spec file for package python-virtualbmc
# Copyright (c) 2020 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

Name:           python-virtualbmc
Version:        1.4.0
Release:        0
Summary:        Python module to create virtual BMCs for controlling virtual instances via IPMI
License:        Apache-2.0
Group:          Development/Languages/Python
Source1:        virtualbmc.service
BuildRequires:  fdupes
BuildRequires:  openstack-macros
BuildRequires:  python-devel
BuildRequires:  python2-pbr
BuildRequires:  python3-devel
BuildRequires:  python3-pbr
Requires:       python-PrettyTable
Requires:       python-libvirt-python
Requires:       python-pbr
Requires:       python-pyghmi
Requires:       python-six
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  systemd-rpm-macros
BuildRequires:  systemd
Requires(post): systemd
Requires(postun): systemd
Requires(preun): systemd
%if 0%{?suse_version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
# on RDO, update-alternatives is in chkconfig
Requires(post): chkconfig
Requires(postun): chkconfig

A virtual BMC for controlling virtual machines using IPMI commands.

%autosetup -p1 -n virtualbmc-1.4.0
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg


%python_clone -a %{buildroot}%{_bindir}/vbmc
%python_clone -a %{buildroot}%{_bindir}/vbmcd

# 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

%python_install_alternative vbmc
%python_install_alternative vbmcd
%systemd_post virtualbmc.service

%systemd_postun virtualbmc.service
%python_uninstall_alternative vbmc
%python_uninstall_alternative vbmcd

%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/vbmc
%python_alternative %{_bindir}/vbmcd
%if 0%{?suse_version}
%python3_only %{_unitdir}/virtualbmc.service

openSUSE Build Service is sponsored by