File openstack-cyborg.spec of Package openstack-cyborg

#
# spec file for package openstack-cyborg
#
# 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 https://bugs.opensuse.org/
#


%if 0%{?rhel} || 0%{?fedora}
%global rdo 1
%endif
Name:           openstack-cyborg
Version:        1.0.1~dev4
Release:        0
Summary:        OpenStack Accelerator as a Service
License:        Apache-2.0
Group:          Applications/System
URL:            https://launchpad.net/cyborg
Source0:        cyborg-stable-rocky.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-macros
BuildRequires:  openstack-tempest
BuildRequires:  python-WSME
BuildRequires:  python-astroid
BuildRequires:  python-coverage
BuildRequires:  python-ddt
BuildRequires:  python-eventlet
BuildRequires:  python-fixtures
BuildRequires:  python-jsonpatch
BuildRequires:  python-keystonemiddleware
BuildRequires:  python-mock
BuildRequires:  python-oslo.config
BuildRequires:  python-oslo.context
BuildRequires:  python-oslo.db
BuildRequires:  python-oslo.i18n
BuildRequires:  python-oslo.log
BuildRequires:  python-oslo.policy
BuildRequires:  python-oslo.versionedobjects
BuildRequires:  python-oslosphinx
BuildRequires:  python-oslotest
BuildRequires:  python-pecan
BuildRequires:  python-psutil
BuildRequires:  python-reno
BuildRequires:  python-six
BuildRequires:  python-testrepository
BuildRequires:  python-testresources
BuildRequires:  python-testscenarios
BuildRequires:  python-testtools
Requires:       python-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     python-cyborg
Summary:        Cyborg Python library
Group:          Applications/System
Requires:       python-SQLAlchemy
Requires:       python-WSME
Requires:       python-alembic
Requires:       python-eventlet
Requires:       python-jsonpatch
Requires:       python-keystonemiddleware
Requires:       python-oslo.concurrency
Requires:       python-oslo.config
Requires:       python-oslo.context
Requires:       python-oslo.db
Requires:       python-oslo.i18n
Requires:       python-oslo.log
Requires:       python-oslo.messaging
Requires:       python-oslo.policy
Requires:       python-oslo.service
Requires:       python-oslo.utils
Requires:       python-oslo.versionedobjects
Requires:       python-pbr
Requires:       python-pecan
Requires:       python-psutil
Requires:       python-six
Requires:       python-stevedore

%description -n python-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:  python-Sphinx
BuildRequires:  python-os-api-ref
BuildRequires:  python-oslosphinx
BuildRequires:  python-sphinxcontrib-pecanwsme
BuildRequires:  python-sphinxcontrib-seqdiag

%description doc
OpenStack Cyborg documentation.

This package contains the documentation

%prep
%autosetup -p1 -n openstack-cyborg-1.0.1.dev4
%py_req_cleanup
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg

%build
%{py2_build}

PBR_VERSION=1.0.1.dev4 sphinx-build -b html doc/source doc/build/html
PBR_VERSION=1.0.1.dev4 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
CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-data="/"
install -d -m 755 %{buildroot}%{_localstatedir}/log/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}%{python2_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
%dir %attr(0750, root, cyborg) %{_sysconfdir}/cyborg/
%dir %attr(0750, root, cyborg) %{_sysconfdir}/cyborg/rootwrap.d/
%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/rootwrap.conf
%config(noreplace) %attr(0640, root, cyborg) %{_sysconfdir}/cyborg/rootwrap.d/acceleration.filters
%dir %attr(0750, cyborg, cyborg) %{_localstatedir}/log/cyborg

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

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

%changelog
openSUSE Build Service is sponsored by