File openstack-mistral.spec of Package openstack-mistral

#
# spec file for package openstack-mistral
#
# 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-mistral
Version:        7.0.4
Release:        0
Summary:        Workflow Service for OpenStack cloud
License:        Apache-2.0
Group:          Development/Libraries
URL:            https://launchpad.net/mistral
Source0:        https://files.pythonhosted.org/packages/source/m/mistral/mistral-7.0.4.tar.gz
Source1:        mistral-api.service
Source2:        mistral-engine.service
Source3:        mistral-executor.service
# https://review.opendev.org/672185
Patch0:         0001-disable-triggering-version-discovery-in-test_generat.patch
BuildRequires:  openstack-macros
BuildRequires:  python-PyJWT
BuildRequires:  python-aodhclient
BuildRequires:  python-barbicanclient
BuildRequires:  python-cinderclient
BuildRequires:  python-croniter
BuildRequires:  python-designateclient
BuildRequires:  python-devel
BuildRequires:  python-fixtures
BuildRequires:  python-glanceclient
BuildRequires:  python-glareclient
BuildRequires:  python-gnocchiclient
BuildRequires:  python-heatclient
BuildRequires:  python-ironic-inspector-client
BuildRequires:  python-ironicclient
BuildRequires:  python-kazoo
BuildRequires:  python-keystoneclient
BuildRequires:  python-keystonemiddleware
BuildRequires:  python-magnumclient
BuildRequires:  python-manilaclient
BuildRequires:  python-mistral-lib
BuildRequires:  python-mistralclient
BuildRequires:  python-muranoclient
BuildRequires:  python-neutronclient
BuildRequires:  python-nose
BuildRequires:  python-novaclient
BuildRequires:  python-oslo.concurrency
BuildRequires:  python-oslo.config
BuildRequires:  python-oslo.db
BuildRequires:  python-oslo.i18n
BuildRequires:  python-oslo.log
BuildRequires:  python-oslo.messaging
BuildRequires:  python-oslo.middleware
BuildRequires:  python-oslo.policy
BuildRequires:  python-oslo.service
BuildRequires:  python-oslotest
BuildRequires:  python-osprofiler
BuildRequires:  python-pbr
BuildRequires:  python-python-subunit
BuildRequires:  python-qinlingclient
BuildRequires:  python-reno
BuildRequires:  python-requests-mock
BuildRequires:  python-senlinclient
BuildRequires:  python-six
BuildRequires:  python-stevedore
BuildRequires:  python-swiftclient
BuildRequires:  python-tackerclient
BuildRequires:  python-testrepository
BuildRequires:  python-testscenarios
BuildRequires:  python-testtools
BuildRequires:  python-tooz
BuildRequires:  python-troveclient
BuildRequires:  python-unittest2
BuildRequires:  python-vitrageclient
BuildRequires:  python-zaqarclient
BuildRequires:  python-zunclient
Requires:       python-mistral = %{version}-%{release}
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  systemd-rpm-macros
%else
BuildRequires:  systemd
%endif

%description
System package - %{name}
Python package - python-mistral

%package        doc
Summary:        Documentation for OpenStack Workflow Service
Group:          Development/Libraries
BuildRequires:  git
BuildRequires:  openstack-tempest
BuildRequires:  python-Sphinx
BuildRequires:  python-WSME
BuildRequires:  python-jsonschema
BuildRequires:  python-networkx
BuildRequires:  python-openstackdocstheme
BuildRequires:  python-paramiko
BuildRequires:  python-pecan
BuildRequires:  python-pep8
BuildRequires:  python-sphinxcontrib-httpdomain
BuildRequires:  python-sphinxcontrib-pecanwsme
BuildRequires:  python-yaql

%description    doc
OpenStack Mistral documentaion.
.
This package contains the documentation

%package -n     python-mistral
Summary:        Mistral Python libraries
Group:          Development/Libraries
Requires:       python-Babel
Requires:       python-PyJWT
Requires:       python-PyYAML
Requires:       python-SQLAlchemy
Requires:       python-WSME
Requires:       python-alembic
Requires:       python-barbicanclient
Requires:       python-cachetools
Requires:       python-cinderclient
Requires:       python-croniter
Requires:       python-designateclient
Requires:       python-eventlet
Requires:       python-glanceclient
Requires:       python-glareclient
Requires:       python-heatclient
Requires:       python-ironic-inspector-client
Requires:       python-ironicclient
Requires:       python-jsonschema
Requires:       python-keystoneclient
Requires:       python-keystonemiddleware
Requires:       python-magnumclient
Requires:       python-manilaclient
Requires:       python-mistral-lib
Requires:       python-mistralclient
Requires:       python-mock
Requires:       python-muranoclient
Requires:       python-networkx
Requires:       python-neutronclient
Requires:       python-novaclient
Requires:       python-oslo.concurrency
Requires:       python-oslo.config
Requires:       python-oslo.db
Requires:       python-oslo.log
Requires:       python-oslo.messaging
Requires:       python-oslo.middleware
Requires:       python-oslo.policy
Requires:       python-oslo.serialization
Requires:       python-oslo.service
Requires:       python-oslo.utils
Requires:       python-osprofiler
Requires:       python-paramiko
Requires:       python-pbr
Requires:       python-pecan
Requires:       python-qinlingclient
Requires:       python-requests
Requires:       python-retrying
Requires:       python-senlinclient
Requires:       python-setuptools
Requires:       python-six
Requires:       python-stevedore
Requires:       python-swiftclient
Requires:       python-tackerclient
Requires:       python-tooz
Requires:       python-troveclient
Requires:       python-vitrageclient
Requires:       python-yaql
Requires:       python-zake
Requires:       python-zaqarclient
Requires:       python-zunclient

%description -n python-mistral
Mistral is a workflow service.
Most business processes consist of multiple distinct interconnected steps that need to be executed in a particular order
in a distributed environment. One can describe such process as a set of tasks and task relations and upload such description
to Mistral so that it takes care of state management, correct execution order, parallelism, synchronization and high availability.
.
This package contains the Python libraries.

%package        api
Summary:        OpenStack Mistral API service
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description    api
OpenStack rest API to the Mistral api.
.
This package contains the ReST API.

%package        engine
Summary:        OpenStack Mistral Engine service
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description    engine
OpenStack Mistral Engine service.
.
This package contains the mistral engine, which is one of core services of mistral.

%package        executor
Summary:        OpenStack Mistral Executor service
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description    executor
OpenStack Mistral Executor service.
.
This package contains the mistral executor, which is one of core services of mistral, and
which the API servers will use.

%prep
%if 0%{?rdo}
%autosetup -p1 -n mistral-%{upstream_version}
%else
%autosetup -p1 -n mistral-7.0.4
%endif
%py_req_cleanup
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg

%build
%{py2_build}
export PYTHONPATH="."
oslo-config-generator --config-file tools/config/config-generator.mistral.conf \
--output-file etc/mistral.conf.sample

PBR_VERSION=7.0.4 sphinx-build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%{py2_install}

mkdir -p %{buildroot}%{_sysconfdir}/mistral/
mkdir -p %{buildroot}%{_localstatedir}/log/mistral
mkdir -p %{buildroot}%{_rundir}/mistral
#systemd unitfiles
install -p -D -m 644 %SOURCE1 %{buildroot}%{_unitdir}/openstack-mistral-api.service
install -p -D -m 644 %SOURCE2 %{buildroot}%{_unitdir}/openstack-mistral-engine.service
install -p -D -m 644 %SOURCE3 %{buildroot}%{_unitdir}/openstack-mistral-executor.service

install -p -D -m 640 etc/mistral.conf.sample %{buildroot}%{_sysconfdir}/mistral/mistral.conf
install -p -D -m 640 etc/logging.conf.sample %{buildroot}%{_sysconfdir}/mistral/logging.conf
install -p -D -m 640 etc/wf_trace_logging.conf.sample %{buildroot}%{_sysconfdir}/mistral/wf_trace_logging.conf
chmod +x %{buildroot}%{_bindir}/mistral*

%pre
%openstack_pre_user_group_create mistral mistral

%check
%{__python2} -m stestr.cli run

%post api
%systemd_post openstack-mistral-api.service

%preun api
%systemd_preun openstack-mistral-api.service

%postun api
%systemd_postun_with_restart openstack-mistral-api.service

%post engine
%systemd_post openstack-mistral-engine.service

%preun engine
%systemd_preun openstack-mistral-engine.service

%postun engine
%systemd_postun_with_restart openstack-mistral-engine.service

%post executor
%systemd_post openstack-mistral-executor.service

%preun executor
%systemd_preun openstack-mistral-executor.service

%postun executor
%systemd_postun_with_restart openstack-mistral-executor.service

%files api
%{_unitdir}/openstack-mistral-api.service

%files
%license LICENSE
%dir %{_sysconfdir}/mistral
%config(noreplace) %attr(-, mistral, mistral) %{_sysconfdir}/mistral/*
%{_bindir}/mistral-*
%dir %attr(750, mistral, mistral) %{_rundir}/mistral
%dir %attr(750, mistral, mistral) %{_localstatedir}/log/mistral

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

%files engine
%{_unitdir}/openstack-mistral-engine.service

%files executor
%{_unitdir}/openstack-mistral-executor.service

%files -n python-mistral
%{python2_sitelib}/mistral*

%changelog
openSUSE Build Service is sponsored by