%if 0%{?rhel} || 0%{?fedora} %global rdo 1 %endif %if 0%{?rhel} == 7 %global skip_python3 1 %endif %global sname masakari Name: openstack-masakari Version: 6.0.0 Release: 0.1.b3.dev1%{?dist} Summary: Virtual Machine High Availability (VMHA) service for OpenStack License: ASL 2.0 Group: Development/Languages/Python URL: https://launchpad.net/masakari Source0: masakari-master.tar.gz Source1: masakari-api.service Source2: masakari-engine.service Source3: masakari.tmpfiles BuildRequires: openstack-macros BuildRequires: python-sphinx BuildRequires: python-ddt BuildRequires: python-eventlet BuildRequires: python-keystoneauth1 BuildRequires: python-keystonemiddleware BuildRequires: python-microversion-parse BuildRequires: python-novaclient BuildRequires: python-oslo-db BuildRequires: python-oslo-messaging BuildRequires: python-oslo-middleware BuildRequires: python-oslo-policy BuildRequires: python-oslo-service BuildRequires: python-oslo-versionedobjects BuildRequires: python-oslotest BuildRequires: python-subunit BuildRequires: python-reno BuildRequires: python-requests-mock BuildRequires: python-setuptools BuildRequires: python-taskflow BuildRequires: python-testrepository BuildRequires: python-testresources BuildRequires: python-testscenarios BuildRequires: python-testtools Requires: python-masakari = %{version}-%{release} BuildArch: noarch %if 0%{?suse_version} BuildRequires: systemd-rpm-macros %else BuildRequires: systemd %endif %description Masakari is a service providing high availability for VMs in OpenStack. System package - %{name} Python package - python-%{sname} %package doc Summary: Documentation for OpenStack Masakari Service BuildRequires: openstack-tempest BuildRequires: python-wsme BuildRequires: python-jsonschema BuildRequires: python-networkx BuildRequires: python-oslo-sphinx BuildRequires: python-paramiko BuildRequires: python-pecan BuildRequires: python-pep8 BuildRequires: python-sphinxcontrib-httpdomain BuildRequires: python-sphinxcontrib-pecanwsme BuildRequires: python-yaql %description doc Masakari is a service providing high availability for VMs in OpenStack. This package contains the documentation. %package -n python-%{sname} Summary: Masakari Python libraries Requires: python-babel Requires: python-iso8601 Requires: python-jsonschema Requires: python-keystoneauth1 Requires: python-keystonemiddleware Requires: python-microversion-parse Requires: python-novaclient Requires: python-oslo-config Requires: python-oslo-db Requires: python-oslo-i18n Requires: python-oslo-log Requires: python-oslo-messaging Requires: python-oslo-middleware Requires: python-oslo-policy Requires: python-oslo-service Requires: python-oslo-utils Requires: python-oslo-versionedobjects Requires: python-pbr Requires: python-six Requires: python-stevedore Requires: python-taskflow %description -n python-%{sname} Masakari is a service providing high availability for VMs in OpenStack. This package contains the Python libraries. %package api Summary: OpenStack Masakari API service Requires: %{name} = %{version} %description api OpenStack REST API to the Masakari api. This package contains the REST API. %package engine Summary: OpenStack Masakari Engine service Requires: %{name} = %{version} %description engine OpenStack Masakari Engine service. This package contains the masakari engine, which is one of core services of masakari. %prep %autosetup -n %{sname}-6.0.0.0b3.dev1 %py_req_cleanup %build %{py2_build} export PYTHONPATH="." # from tox.ini's testenv:genconfig oslo-config-generator --config-file etc/masakari/masakari-config-generator.conf %{__python2} setup.py build_sphinx # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install %{py2_install} mkdir -p %{buildroot}%{_sysconfdir}/masakari/ mkdir -p %{buildroot}%{_localstatedir}/log/masakari #systemd unitfiles install -p -D -m 644 %SOURCE1 %{buildroot}%{_unitdir}/openstack-masakari-api.service install -p -D -m 644 %SOURCE2 %{buildroot}%{_unitdir}/openstack-masakari-engine.service install -p -D -m 644 %SOURCE3 %{buildroot}/%{_tmpfilesdir}/masakari.conf install -p -D -m 640 etc/masakari/masakari.conf.sample %{buildroot}%{_sysconfdir}/masakari/masakari.conf install -p -D -m 640 etc/masakari/api-paste.ini %{buildroot}%{_sysconfdir}/masakari/api-paste.ini install -p -D -m 640 etc/masakari/policy.json %{buildroot}%{_sysconfdir}/masakari/policy.json chmod +x %{buildroot}%{_bindir}/masakari* # remove usr/etc rm -rf %{buildroot}%{_prefix}%{_sysconfdir}/ %pre %openstack_pre_user_group_create masakari masakari %post %tmpfiles_create %{_tmpfilesdir}/masakari.conf %check testr init testr list-tests > list testr run --load-list=list %post api %systemd_post openstack-masakari-api.service %preun api %systemd_preun openstack-masakari-api.service %postun api %systemd_postun_with_restart openstack-masakari-api.service %post engine %systemd_post openstack-masakari-engine.service %preun engine %systemd_preun openstack-masakari-engine.service %postun engine %systemd_postun_with_restart openstack-masakari-engine.service %files %license LICENSE %dir %{_sysconfdir}/masakari %config(noreplace) %attr(0640, root, masakari) %{_sysconfdir}/masakari/* %dir %attr(750, masakari, masakari) %{_localstatedir}/log/masakari %_tmpfilesdir/masakari.conf %files api %{_bindir}/masakari-api %{_bindir}/masakari-manage %{_bindir}/masakari-wsgi %{_unitdir}/openstack-masakari-api.service %files engine %{_bindir}/masakari-engine %{_unitdir}/openstack-masakari-engine.service %files doc %license LICENSE %doc doc/build/html %files -n python-%{sname} %{python2_sitelib}/%{sname}* %changelog