File openstack-cyborg.spec of Package openstack-cyborg

#
# spec file for package openstack-cyborg
#
# 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/
#


%if 0%{?rhel} || 0%{?fedora}
%global rdo 1
%endif
Name:           openstack-cyborg
Version:        9.0.0.0~xrc2~dev2
Release:        0
Summary:        OpenStack Accelerator as a Service
License:        Apache-2.0
URL:            https://docs.openstack.org/cyborg
Source0:        cyborg-stable-zed.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-macros
BuildRequires:  openstack-tempest
BuildRequires:  python39-WSME
BuildRequires:  python39-ddt
BuildRequires:  python39-eventlet
BuildRequires:  python39-fixtures
BuildRequires:  python39-jsonpatch
BuildRequires:  python39-keystoneauth1
BuildRequires:  python39-keystonemiddleware
BuildRequires:  python39-oslo.config
BuildRequires:  python39-oslo.context
BuildRequires:  python39-oslo.db
BuildRequires:  python39-oslo.i18n
BuildRequires:  python39-oslo.log
BuildRequires:  python39-oslo.policy
BuildRequires:  python39-oslo.versionedobjects
BuildRequires:  python39-oslotest
BuildRequires:  python39-pecan
BuildRequires:  python39-psutil
BuildRequires:  python39-six
Requires:       python3-cyborg = %{version}-%{release}
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  systemd-rpm-macros
Requires(pre):  pwdutils
%{?systemd_requires}
%endif
%if 0%{?rdo}
BuildRequires:  systemd
Requires(post): systemd
Requires(postun):systemd
Requires(pre):  shadow-utils
Requires(preun):systemd
%endif

%description
Cyborg (previously known as Nomad) is an OpenStack project that aims to
provide a general purpose management framework for acceleration
resources (i.e. various types of accelerators such as GPU, FPGA, ASIC,
NP, SoCs, NVMe/NOF SSDs, ODP, DPDK/SPDK and so on).

%package -n     python3-cyborg
Summary:        Cyborg Python library
Group:          Applications/System
Requires:       python39-SQLAlchemy
Requires:       python39-WSME
Requires:       python39-alembic
Requires:       python39-eventlet
Requires:       python39-jsonpatch
Requires:       python39-keystoneauth1
Requires:       python39-keystonemiddleware
Requires:       python39-oslo.concurrency
Requires:       python39-oslo.config
Requires:       python39-oslo.context
Requires:       python39-oslo.db
Requires:       python39-oslo.i18n
Requires:       python39-oslo.log
Requires:       python39-oslo.messaging
Requires:       python39-oslo.policy
Requires:       python39-oslo.service
Requires:       python39-oslo.utils
Requires:       python39-oslo.versionedobjects
Requires:       python39-pbr
Requires:       python39-pecan
Requires:       python39-psutil
Requires:       python39-six
Requires:       python39-stevedore

%description -n python3-cyborg
Cyborg (previously known as Nomad) is an OpenStack project that aims to
provide a general purpose management framework for acceleration
resources (i.e. various types of accelerators such as GPU, FPGA, ASIC,
NP, SoCs, NVMe/NOF SSDs, ODP, DPDK/SPDK and so on).

This package contains the Cyborg python libraries.

%package doc
Summary:        Documentation for OpenStack Backup Service
Group:          Documentation/HTML
BuildRequires:  fdupes
BuildRequires:  python39-Sphinx
BuildRequires:  python39-openstackdocstheme
BuildRequires:  python39-os-api-ref
BuildRequires:  python39-sphinx-feature-classification
BuildRequires:  python39-sphinxcontrib-pecanwsme
BuildRequires:  python39-sphinxcontrib-seqdiag
BuildRequires:  python39-sphinxcontrib-svg2pdfconverter

%description doc
OpenStack Cyborg documentation.

This package contains the documentation

%prep
%autosetup -p1 -n openstack-cyborg-9.0.0.0rc2.dev2
%py_req_cleanup

%build
%{py3_build}

PBR_VERSION=9.0.0.0rc2.dev2 %sphinx_build -b html doc/source doc/build/html
PBR_VERSION=9.0.0.0rc2.dev2 %sphinx_build -b man doc/source doc/build/man
rm -r doc/build/html/.{doctrees,buildinfo}

# config file generation
PYTHONPATH=. oslo-config-generator --config-file tools/config/cyborg-config-generator.conf \
    --output-file etc/cyborg/cyborg.conf.sample
PYTHONPATH=. oslopolicy-sample-generator --config-file tools/config/cyborg-policy-generator.conf \
    --output-file etc/cyborg/policy.json.sample

%install
%{py3_install}
install -d -m 755 %{buildroot}%{_localstatedir}/log/cyborg
install -d -m 755 %{buildroot}%{_sysconfdir}/cyborg

mv %{buildroot}%{_prefix}%{_sysconfdir}/cyborg/*  %{buildroot}%{_sysconfdir}/cyborg/
install -p -D -m 640 etc/cyborg/cyborg.conf.sample %{buildroot}%{_sysconfdir}/cyborg/cyborg.conf
install -p -D -m 640 etc/cyborg/policy.json.sample %{buildroot}%{_sysconfdir}/cyborg/policy.json

# remove duplicates
%fdupes %{buildroot}%{python3_sitelib}

%pre
%openstack_pre_user_group_create cyborg cyborg /sbin/nologin

%files
%license LICENSE
%doc README.rst
%{_bindir}/cyborg-api
%{_bindir}/cyborg-conductor
%{_bindir}/cyborg-dbsync
%{_bindir}/cyborg-agent
%{_bindir}/cyborg-status
%{_bindir}/cyborg-wsgi-api
%dir %attr(0750, root, cyborg) %{_sysconfdir}/cyborg/
%config(noreplace) %attr(0640, root, cyborg) %{_sysconfdir}/cyborg/cyborg.conf
%config(noreplace) %attr(0640, root, cyborg) %{_sysconfdir}/cyborg/api-paste.ini
%config(noreplace) %attr(0640, root, cyborg) %{_sysconfdir}/cyborg/policy.json
%config(noreplace) %attr(0640, root, cyborg) %{_sysconfdir}/cyborg/policy.yaml
%dir %attr(0750, cyborg, cyborg) %{_localstatedir}/log/cyborg

%files -n python3-cyborg
%doc README.rst
%license LICENSE
%{python3_sitelib}/cyborg/
%{python3_sitelib}/openstack_cyborg*.egg-info

%files doc
%license LICENSE
%doc doc/build/html

%changelog
openSUSE Build Service is sponsored by