File openstack-nova.spec of Package openstack-nova

#
# spec file for package openstack-nova
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011 B1 Systems GmbH, Vohburg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%define component nova
%define groupname %{component}
%define username %{component}
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif

%define version_unconverted 13.1.5.dev1

Name:           openstack-%{component}
Version:        13.1.5~a0~dev1
Release:        0
Summary:        OpenStack Compute (Nova)
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/nova
Source:         http://tarballs.openstack.org/nova/nova-stable-mitaka.tar.gz
Source1:        %{name}.init
Source2:        %{name}.logrotate
Source4:        openstack-nova-manage.sh
Source6:        openstack-nova-vncproxy.init
Source9:        org.openstack.nova.compute.pkla
%if 0%{?suse_version} > 1230
Source10:       %name.conf
BuildRequires:  systemd
%endif
Source11:       openstack-nova-novncproxy.init
Source12:       nova-sudoers
Source13:       openstack-nova-polkit.rules
Source14:       openstack-nova.modules
Source15:       openstack-nova.modprobe
Source16:       openstack-nova-serialproxy.init
Source99:       rpmlintrc
# https://bugs.launchpad.net/nova/+bug/1202199
# https://review.openstack.org/#/c/37477/
Patch7:         0001-Always-set-model-netfront-for-xen-over-libvirt.patch
Patch8:         0001-Handle-alternative-UEFI-boot-loader-locations-on-SLE.patch
Patch9:         0001-Fix-nova-delete-with-EFI-booted-VMs.patch
# PATCH-FIX-UPSTREAM 0001-Consider-domain-when-truncating-hostnames.patch https://review.openstack.org/#/c/356561/
Patch10:        0001-Consider-domain-when-truncating-hostnames.patch
# https://bugs.launchpad.net/nova/+bug/1614063
# Backport from Master: https://review.openstack.org/#/c/356558
Patch11:        migrate-uri.patch
Patch12:        0001-Specify-the-default-cdrom-type-scsi-for-AARCH64.patch
BuildRequires:  crudini
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  openstack-suse-sudo
BuildRequires:  python-Paste
BuildRequires:  python-PasteDeploy
BuildRequires:  python-Routes
BuildRequires:  python-barbicanclient
BuildRequires:  python-base
BuildRequires:  python-boto
BuildRequires:  python-castellan
BuildRequires:  python-cinderclient
BuildRequires:  python-cryptography >= 1.0
BuildRequires:  python-glanceclient
BuildRequires:  python-keystoneauth1
BuildRequires:  python-keystoneclient
BuildRequires:  python-keystonemiddleware
BuildRequires:  python-neutronclient
BuildRequires:  python-os-brick
BuildRequires:  python-os-win
BuildRequires:  python-oslo.cache
BuildRequires:  python-oslo.concurrency
BuildRequires:  python-oslo.config >= 1.2.0
BuildRequires:  python-oslo.db
BuildRequires:  python-oslo.i18n
BuildRequires:  python-oslo.log
BuildRequires:  python-oslo.messaging
BuildRequires:  python-oslo.policy >= 0.5.0
BuildRequires:  python-oslo.reports
BuildRequires:  python-oslo.versionedobjects
BuildRequires:  python-oslo.vmware
BuildRequires:  python-paramiko
BuildRequires:  python-pbr >= 0.6
BuildRequires:  python-pycrypto
BuildRequires:  python-rfc3986
BuildRequires:  python-websockify
# Documentation requirements:
BuildRequires:  python-Babel >= 1.3
BuildRequires:  python-Sphinx >= 1.1.2
BuildRequires:  python-WebOb
BuildRequires:  python-eventlet
BuildRequires:  python-oslosphinx
BuildRequires:  python-sphinxcontrib-seqdiag
%if 0%{?suse_version} > 1110
# to make orphaned-file-tests happy
BuildRequires:  polkit-default-privs
Requires:       polkit-default-privs
%endif
Requires:       /usr/bin/truncate
Requires:       logrotate
Requires:       openstack-suse-sudo
Requires:       python >= 2.6.8
Requires:       python-nova = %{version}
Requires:       python-oslo.config >= 3.7.0
#Requires:      vblade-persist
Requires(post): sysconfig
%if 0%{?suse_version} > 1110
Requires(pre):  pwdutils
%else
Requires(pre):  shadow-utils
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif
Requires(pre):  %insserv_prereq %fillup_prereq

%description
OpenStack Nova provides a cloud computing fabric controller,
supporting a wide variety of virtualization technologies,
including KVM, Xen, LXC, VMware, and more. In addition to
its native API, it includes compatibility with the commonly
encountered Amazon EC2 and S3 APIs.

%package -n python-nova
Summary:        OpenStack Compute (Nova) - Python module
Group:          Development/Languages/Python
Conflicts:      pyxml < 0.8.5
Requires:       python >= 2.6.8
Requires:       python-Babel >= 1.3
Requires:       python-Jinja2 >= 2.8
Requires:       python-Paste
Requires:       python-PasteDeploy >= 1.5.0
Requires:       python-PrettyTable >= 0.7
Requires:       python-Routes >= 1.12.3
Requires:       python-SQLAlchemy >= 1.0.10
Requires:       python-SQLAlchemy >= 1.0.10
Requires:       python-WebOb >= 1.2.3
Requires:       python-alembic >= 0.8.0
Requires:       python-barbicanclient >= 3.3.0
Requires:       python-boto >= 2.32.1
Requires:       python-castellan >= 0.3.1
Requires:       python-cinderclient >= 1.3.1
Requires:       python-cryptography >= 1.0
Requires:       python-decorator >= 3.4.0
Requires:       python-eventlet >= 0.18.2
Requires:       python-glanceclient >= 2.0.0
Requires:       python-greenlet >= 0.3.2
Requires:       python-iso8601 >= 0.1.9
Requires:       python-jsonschema >= 2.0.0
Requires:       python-keystoneauth1 >= 2.1.0
Requires:       python-keystonemiddleware >= 4.0.0
Requires:       python-lxml >= 2.3
Requires:       python-netaddr >= 0.7.12
Requires:       python-netifaces >= 0.10.4
Requires:       python-neutronclient >= 2.6.0
Requires:       python-os-brick >= 1.0.0
Requires:       python-os-win >= 0.2.3
Requires:       python-oslo.cache >= 1.5.0
Requires:       python-oslo.concurrency >= 3.7.1
Requires:       python-oslo.context >= 0.2.0
Requires:       python-oslo.db >= 4.1.0
Requires:       python-oslo.i18n >= 2.1.0
Requires:       python-oslo.log >= 1.14.0
Requires:       python-oslo.messaging >= 4.0.0
Requires:       python-oslo.middleware >= 3.0.0
Requires:       python-oslo.policy >= 0.5.0
Requires:       python-oslo.reports >= 0.6.0
Requires:       python-oslo.rootwrap >= 2.0.0
Requires:       python-oslo.serialization >= 1.10.0
Requires:       python-oslo.service >= 1.0.0
Requires:       python-oslo.utils >= 3.5.0
Requires:       python-oslo.versionedobjects >= 1.5.0
Requires:       python-oslo.vmware >= 1.16.0
Requires:       python-paramiko >= 1.16.0
Requires:       python-pbr >= 1.6
Requires:       python-psutil >= 1.1.1
Requires:       python-rfc3986 >= 0.2.0
Requires:       python-six >= 1.9.0
Requires:       python-sqlalchemy-migrate >= 0.9.6
Requires:       python-stevedore >= 1.5.0
Requires:       python-websockify >= 0.6.1

%description -n python-nova
This package contains the core Python module of OpenStack Nova.

%package api
Summary:        OpenStack Compute (Nova) - API
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       openstack-neutron-server
Requires:       openstack-nova-conductor = %{version}

%description api
This package contains the OpenStack Nova API.

%package conductor
Summary:        OpenStack Compute (Nova) - Conductor
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description conductor
This package contains the conductor of OpenStack Nova

%package cells
Summary:        OpenStack Compute (Nova) - Cells
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description cells
This package contains the Cells support of OpenStack Nova


%package cert
Summary:        OpenStack Compute (Nova) - Certificate Manager
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description cert
This package contains the certificate manager of OpenStack Nova.

%package console
Summary:        Openstack Compute (Nova) - Console Access
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description console
This package contains the console access service for OpenStack Nova.

%package consoleauth
Summary:        Openstack Compute (Nova) - Console Authentification Service
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description consoleauth
This package contains the console authentification service for OpenStack Nova.

%package compute
Summary:        OpenStack Compute (Nova) - Compute
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       bridge-utils
%if 0%{?suse_version} >= 1315
Requires:       genisoimage
Requires:       libvirt-python >= 1.2.5
%endif
Requires:       dosfstools
Requires:       genisoimage
Requires:       openssh
Requires:       rsync
Requires:       tunctl
%if 0%{?suse_version} < 1220
Requires(post): PolicyKit
%endif

%description compute
This package contains the compute part of OpenStack.

%package network
Summary:        OpenStack Compute (Nova) - Network
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       dnsmasq
%if 0%{?suse_version} > 1230
Requires:       dnsmasq-utils
%endif
Requires:       iptables

%description network
This package contains the network services for OpenStack.

%package novncproxy
Summary:        OpenStack Compute (Nova) - Websocket Proxy
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       novnc

%description novncproxy
This package contains the novnc-proxy service for OpenStack.

%package serialproxy
Summary:        OpenStack Compute (Nova) - Serial Proxy
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       novnc

%description serialproxy
This package contains the serialproxy service for OpenStack.

%package scheduler
Summary:        OpenStack Compute (Nova) - Scheduler
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description scheduler
This package contains the scheduler for OpenStack.

%package vncproxy
Summary:        OpenStack Compute (Nova) - VNC Proxy
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description vncproxy
This package contains the vnc-proxy service for OpenStack.

%package -n openstack-xen-plugins
Summary:        OpenStack Compute (Nova) - XenAPI support
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}

%description -n openstack-xen-plugins
This package contains the XenAPI support for OpenStack.

%package test
Summary:        OpenStack Compute (Nova) - Testsuite
Group:          System/Management
# prereq for creating the right openstack-nova user/group
PreReq:         %{name} = %{version}
Requires:       curl
Requires:       openstack-xen-plugins = %{version}
Requires:       python-cinderclient >= 1.3.1
%if 0%{?suse_version} >= 1315
Requires:       libvirt-python >= 1.2.5
%endif
Requires:       python-fixtures >= 1.3.1
Requires:       python-ironicclient >= 1.1.0
Requires:       python-mock >= 1.2
Requires:       python-mox3 >= 0.7.0
Requires:       python-os-testr >= 0.4.1
Requires:       python-oslotest >= 1.10.0
Requires:       python-psycopg2 >= 2.5
Requires:       python-python-subunit >= 0.0.18
Requires:       python-requests-mock >= 0.7.0
Requires:       python-tempest-lib >= 0.14.0
Requires:       python-testrepository >= 0.0.18
Requires:       python-testresources >= 0.2.4
Requires:       python-testtools >= 1.4.0

%description test
The OpenStack Nova testsuite. It is used to verify the functionality of
OpenStack Nova and its components.

%prep
%setup -q -n %{component}-%{version_unconverted}
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p0
%patch12 -p1
%openstack_cleanup_prep

%build
python setup.py build
python setup.py build_sphinx -q -b man
PYTHONPATH=. oslo-config-generator --config-file=etc/nova/nova-config-generator.conf

%install
python setup.py install --root %{buildroot} --prefix %{_prefix}

### directories
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/images
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/instances
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/keys
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/networks
install -d -m 755 %{buildroot}%{_localstatedir}/lib/nova/tmp
install -d -m 750 %{buildroot}%{_localstatedir}/log/nova
install -d -m 700 %{buildroot}%{_rundir}/nova
install -d -m 700 %{buildroot}%{_localstatedir}/cache/nova
%if 0%{?suse_version} > 1230
install -D -m 644 %{SOURCE10} %{buildroot}/%_tmpfilesdir/%name.conf
%endif

### configuration files
install -p -D -m 640 etc/nova/nova.conf.sample %{buildroot}%{_sysconfdir}/nova/nova.conf
install -p -D -m 640 etc/nova/api-paste.ini etc/nova/policy.json %{buildroot}%{_sysconfdir}/nova/
install -p -D -m 644 etc/nova/rootwrap.conf %{buildroot}%{_sysconfdir}/nova/
install -p -D -m 644 etc/nova/release.sample %{buildroot}%{_sysconfdir}/nova/release
sed -i -e "s,vendor = .*,vendor = %{distribution}," \
       -e "s,product = .*,product = OpenStack Nova," \
       -e "s,package = .*,package = %{version}," %{buildroot}%{_sysconfdir}/nova/release

cp -a etc/nova/rootwrap.d/ %{buildroot}%{_sysconfdir}/nova/
# bash-completion/logrotate/etc.
install -p -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/bash_completion.d/openstack-nova-manage.sh
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

### init scripts
mkdir -p %{buildroot}%{_sbindir}
for i in api api-metadata api-os-compute cert cells compute \
        conductor console consoleauth \
        spicehtml5proxy network scheduler ; do
    tmp=$(mktemp)
    cat %{SOURCE1} | sed "s/__NAME__/$i/g" > $tmp
    if [ "x$i" = "xcompute" ] ; then
      sed -i -e "s/#\s+Should-Start:.*/& libvirtd/" $tmp
    fi
    install -D -m 755 $tmp %{buildroot}%{_initddir}/%{name}-$i
    ln -s ../..%{_initddir}/%{name}-$i %{buildroot}%{_sbindir}/rc%{name}-$i
done
# patch nova-network init script:
install -p -D -m 755 %{SOURCE6} %{buildroot}%{_initddir}/openstack-nova-vncproxy
install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initddir}/openstack-nova-novncproxy
install -p -D -m 755 %{SOURCE16} %{buildroot}%{_initddir}/openstack-nova-serialproxy
mkdir -p %{buildroot}%{_sbindir}
for i in vncproxy novncproxy serialproxy; do
    ln -s %{_initddir}/openstack-nova-$i %{buildroot}%{_sbindir}/rcopenstack-nova-$i
done

### sudoers configuration for nova-rootwrap:
install -D -m 440 %{SOURCE12} %{buildroot}%{_sysconfdir}/sudoers.d/openstack-nova

### documentation
install -d %{buildroot}%{_mandir}/man1
install -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1

### test subpackage
%openstack_test_package_install
# needed by api_samples test
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}-test/doc
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}-test/plugins/xenserver/xenapi/etc/
ln -sf /etc/xapi.d %{buildroot}%{_localstatedir}/lib/%{name}-test/plugins/xenserver/xenapi/etc/xapi.d
%fdupes %{buildroot}%{_localstatedir}/lib/%{name}-test

### Build Xen-plugins
cp -r --preserve=timestamps plugins/xenserver/xenapi/etc/ %{buildroot}

### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}

%if 0%{?suse_version} > 1110 && 0%{?suse_version} < 1230
  mkdir -p %{buildroot}%{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d/
  cp -a %{SOURCE9} %{buildroot}%{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d/
%endif
%if 0%{?suse_version} >= 1230
  install -D -m 644 %{SOURCE13} %{buildroot}%{_datadir}/polkit-1/rules.d/10-openstack-nova-compute.rules
  install -D -m 644 %{SOURCE14} %{buildroot}%{_libexecdir}/modules-load.d/openstack-nova-compute.conf
%endif
install -D -m 644 %{SOURCE15} %{buildroot}%{_sysconfdir}/modprobe.d/openstack-nova-compute

### set default configuration (mostly applies to package-only setups and quickstart, i.e. not generally crowbar)
%define nova_conf %{buildroot}%{_sysconfdir}/nova/nova.conf
crudini --set %{nova_conf} DEFAULT log_dir /var/log/nova
crudini --set %{nova_conf} DEFAULT connection_type libvirt
crudini --set %{nova_conf} DEFAULT compute_driver libvirt.LibvirtDriver
crudini --set %{nova_conf} DEFAULT image_service nova.image.glance.GlanceImageService
crudini --set %{nova_conf} DEFAULT volume_api_class nova.volume.cinder.API
crudini --set %{nova_conf} DEFAULT auth_strategy keystone
crudini --set %{nova_conf} neutron auth_type password
crudini --set %{nova_conf} neutron username neutron
crudini --set %{nova_conf} neutron password '%%SERVICE_PASSWORD%%'
crudini --set %{nova_conf} neutron user_domain_id default
crudini --set %{nova_conf} neutron project_name '%%SERVICE_TENANT_NAME%%'
crudini --set %{nova_conf} neutron project_domain_id default
crudini --set %{nova_conf} DEFAULT bindir %{_bindir}
crudini --set %{nova_conf} DEFAULT state_path /var/lib/nova
crudini --set %{nova_conf} DEFAULT service_neutron_metadata_proxy True
crudini --set %{nova_conf} DEFAULT use_neutron True
crudini --set %{nova_conf} oslo_concurrency lock_path %{_rundir}/nova
crudini --set %{nova_conf} database connection sqlite:////var/lib/nova/nova.db
crudini --set %{nova_conf} api_database connection sqlite:////var/lib/nova/nova_api.db
crudini --set %{nova_conf} keystone_authtoken signing_dir /var/cache/%component/keystone-signing
crudini --set %{nova_conf} keystone_authtoken auth_type password
crudini --set %{nova_conf} keystone_authtoken username nova
crudini --set %{nova_conf} keystone_authtoken password '%%SERVICE_PASSWORD%%'
crudini --set %{nova_conf} keystone_authtoken user_domain_id default
crudini --set %{nova_conf} keystone_authtoken project_name '%%SERVICE_TENANT_NAME%%'
crudini --set %{nova_conf} keystone_authtoken project_domain_id default

%pre
# need a fixed uid/gid for being able to use shared storage over NFS
%openstack_pre_user_group_create -u 96 -g 96 -s /bin/bash %{username} %{groupname}

%pre api
%service_add_pre openstack-nova-api.service

%post api
%service_add_post openstack-nova-api.service
%{fillup_and_insserv -f openstack-nova-api}

%preun api
%stop_on_removal openstack-nova-api
%service_del_preun openstack-nova-api.service

%postun api
%restart_on_update openstack-nova-api
%insserv_cleanup
%service_del_postun openstack-nova-api.service

%pre conductor
%service_add_pre openstack-nova-conductor.service

%post conductor
%service_add_post openstack-nova-conductor.service
%{fillup_and_insserv -f openstack-nova-conductor}

%preun conductor
%stop_on_removal openstack-nova-conductor
%service_del_preun openstack-nova-conductor.service

%postun conductor
%restart_on_update openstack-nova-conductor
%insserv_cleanup
%service_del_postun openstack-nova-conductor.service

%pre console
%service_add_pre openstack-nova-console.service

%post console
%service_add_post openstack-nova-console.service
%{fillup_and_insserv -f openstack-nova-console}
%{fillup_and_insserv -f openstack-nova-spicehtml5proxy}

%preun console
%stop_on_removal openstack-nova-console
%stop_on_removal openstack-nova-spicehtml5proxy
%service_del_preun openstack-nova-console.service

%postun console
%restart_on_update openstack-nova-console
%restart_on_update openstack-nova-spicehtml5proxy
%insserv_cleanup
%service_del_postun openstack-nova-console.service

%pre consoleauth
%service_add_pre openstack-nova-consoleauth.service

%post consoleauth
%service_add_post openstack-nova-consoleauth.service
%{fillup_and_insserv -f openstack-nova-consoleauth}

%preun consoleauth
%stop_on_removal openstack-nova-consoleauth
%service_del_preun openstack-nova-consoleauth.service

%postun consoleauth
%restart_on_update openstack-nova-consoleauth
%insserv_cleanup
%service_del_postun openstack-nova-consoleauth.service

%pre cells
%service_add_pre openstack-nova-cells.service

%post cells
%service_add_post openstack-nova-cells.service

%preun cells
%stop_on_removal openstack-nova-cells
%service_del_preun openstack-nova-cells.service

%postun cells
%restart_on_update openstack-nova-cells
%insserv_cleanup
%service_del_postun openstack-nova-cells.service

%pre cert
%service_add_pre openstack-nova-cert.service

%post cert
%service_add_post openstack-nova-cert.service
%{fillup_and_insserv -f openstack-nova-cert}

%preun cert
%stop_on_removal openstack-nova-cert
%service_del_preun openstack-nova-cert.service

%postun cert
%restart_on_update openstack-nova-cert
%insserv_cleanup
%service_del_postun openstack-nova-cert.service

%pre compute
%service_add_pre openstack-nova-compute.service

%post compute
%service_add_post openstack-nova-compute.service
polkit-auth --grant org.libvirt.unix.manage --user %{username} 2>/dev/null || true
%{fillup_and_insserv -f openstack-nova-compute}

%preun compute
%stop_on_removal openstack-nova-compute
%service_del_preun openstack-nova-compute.service

%postun compute
%restart_on_update openstack-nova-compute
%insserv_cleanup
%service_del_postun openstack-nova-compute.service

%pre network
%service_add_pre openstack-nova-network.service

%post network
%service_add_post openstack-nova-network.service
%{fillup_and_insserv -f openstack-nova-network}

%preun network
%stop_on_removal openstack-nova-network
%service_del_preun openstack-nova-network.service

%postun network
%restart_on_update openstack-nova-network
%insserv_cleanup
%service_del_postun openstack-nova-network.service

%pre vncproxy
%service_add_pre openstack-nova-vncproxy.service

%post vncproxy
%service_add_post openstack-nova-vncproxy.service
%{fillup_and_insserv -f openstack-nova-vncproxy}

%preun vncproxy
%stop_on_removal openstack-nova-vncproxy
%service_del_preun openstack-nova-vncproxy.service

%postun vncproxy
%restart_on_update openstack-nova-vncproxy
%insserv_cleanup
%service_del_postun openstack-nova-vncproxy.service

%pre novncproxy
%service_add_pre openstack-nova-novncproxy.service

%post novncproxy
%service_add_post openstack-nova-novncproxy.service
%{fillup_and_insserv -f openstack-nova-novncproxy}

%preun novncproxy
%stop_on_removal openstack-nova-novncproxy
%service_del_preun openstack-nova-novncproxy.service

%postun novncproxy
%restart_on_update openstack-nova-novncproxy
%insserv_cleanup
%service_del_postun openstack-nova-novncproxy.service

%pre serialproxy
%service_add_pre openstack-nova-serialproxy.service

%post serialproxy
%service_add_post openstack-nova-serialproxy.service
%{fillup_and_insserv -f openstack-nova-serialproxy}

%preun serialproxy
%stop_on_removal openstack-nova-serialproxy
%service_del_preun openstack-nova-serialproxy.service

%postun serialproxy
%restart_on_update openstack-nova-serialproxy
%insserv_cleanup
%service_del_postun openstack-nova-serialproxy.service

%pre scheduler
%service_add_pre openstack-nova-scheduler.service

%post scheduler
%service_add_post openstack-nova-scheduler.service
%{fillup_and_insserv -f openstack-nova-scheduler}

%preun scheduler
%stop_on_removal openstack-nova-scheduler
%service_del_preun openstack-nova-scheduler.service

%postun scheduler
%restart_on_update openstack-nova-scheduler
%insserv_cleanup
%service_del_postun openstack-nova-scheduler.service

%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{_sysconfdir}/bash_completion.d/openstack-nova-manage.sh
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config %{_sysconfdir}/sudoers.d/openstack-nova
%dir %{_sysconfdir}/nova
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/cache/nova
%config(noreplace) %attr(0640, root, %{groupname}) %{_sysconfdir}/nova/api-paste.ini
%config(noreplace) %attr(0640, root, %{groupname}) %{_sysconfdir}/nova/nova.conf
%config %attr(0640, root, %{groupname}) %{_sysconfdir}/nova/policy.json
%config %{_sysconfdir}/nova/rootwrap.conf
%config %attr(0640, root, %{groupname}) %{_sysconfdir}/nova/release
%dir %{_sysconfdir}/nova/rootwrap.d
%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/lib/nova
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/log/nova
%if 0%{?suse_version} > 1230
%_tmpfilesdir/%name.conf
%else
%dir %attr(0750, %{username}, %{groupname}) %{_rundir}/%{component}
%endif
%{_bindir}/nova-all
%{_bindir}/nova-manage
%{_bindir}/nova-rootwrap
%{_bindir}/nova-rootwrap-daemon
%{_bindir}/nova-idmapshift
%{_mandir}/man1/nova-all.1%{?ext_man}
%{_mandir}/man1/nova-manage.1%{?ext_man}
%{_mandir}/man1/nova-cells.1%{?ext_man}
%{_mandir}/man1/nova-idmapshift.1%{?ext_man}
%{_mandir}/man1/nova-rootwrap.1%{?ext_man}
%dir %attr(0755, root, root) %{_localstatedir}/lib/nova/images
%dir %attr(0755, %{username}, root) %{_localstatedir}/lib/nova/instances
%dir %attr(0755, root, root) %{_localstatedir}/lib/nova/keys
%dir %attr(0755, root, root) %{_localstatedir}/lib/nova/networks
%dir %attr(0755, root, root) %{_localstatedir}/lib/nova/tmp

%files -n python-nova
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/%{component}-*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/%{component}/tests/

%files api
%defattr(-,root,root,-)
%doc LICENSE
%config %{_sysconfdir}/nova/rootwrap.d/api-metadata.filters
%{_initddir}/%{name}-api
%{_sbindir}/rc%{name}-api
%{_initddir}/%{name}-api-metadata
%{_sbindir}/rc%{name}-api-metadata
%{_initddir}/%{name}-api-os-compute
%{_sbindir}/rc%{name}-api-os-compute
%{_bindir}/nova-api
%{_bindir}/nova-api-metadata
%{_bindir}/nova-api-os-compute
%{_mandir}/man1/nova-api.1%{?ext_man}
%{_mandir}/man1/nova-api-metadata.1%{?ext_man}
%{_mandir}/man1/nova-api-os-compute.1%{?ext_man}

%files conductor
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-conductor
%{_bindir}/nova-conductor
%{_mandir}/man1/nova-conductor.1%{?ext_man}
%{_sbindir}/rc%{name}-conductor

%files cells
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/nova-cells
%{_initddir}/%{name}-cells
%{_sbindir}/rc%{name}-cells

%files cert
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-cert
%{_sbindir}/rc%{name}-cert
%{_bindir}/nova-cert
%{_mandir}/man1/nova-cert.1%{?ext_man}

%files compute
%defattr(-,root,root,-)
%doc LICENSE
%config %{_sysconfdir}/nova/rootwrap.d/compute.filters
%{_initddir}/%{name}-compute
%{_sbindir}/rc%{name}-compute
%{_bindir}/nova-compute
%{_mandir}/man1/nova-compute.1%{?ext_man}
%if 0%{?suse_version} > 1110 && 0%{?suse_version} < 1230
%{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d/org.openstack.nova.compute.pkla
%endif
%if 0%{?suse_version} >= 1230
%{_datadir}/polkit-1/rules.d/10-openstack-nova-compute.rules
%{_libexecdir}/modules-load.d/openstack-nova-compute.conf
%endif
%{_sysconfdir}/modprobe.d/openstack-nova-compute

%files console
%defattr(-,root,root,-)
%{_bindir}/nova-console
%{_initddir}/%{name}-console
%{_sbindir}/rc%{name}-console
%{_initddir}/%{name}-spicehtml5proxy
%{_sbindir}/rc%{name}-spicehtml5proxy
%{_mandir}/man1/nova-console.1%{?ext_man}
%{_bindir}/nova-spicehtml5proxy
%{_mandir}/man1/nova-spicehtml5proxy.1%{?ext_man}

%files consoleauth
%defattr(-,root,root,-)
%{_bindir}/nova-consoleauth
%{_initddir}/%{name}-consoleauth
%{_sbindir}/rc%{name}-consoleauth
%{_mandir}/man1/nova-consoleauth.1%{?ext_man}

%files network
%defattr(-,root,root,-)
%doc LICENSE
%config %{_sysconfdir}/nova/rootwrap.d/network.filters
%{_initddir}/%{name}-network
%{_sbindir}/rc%{name}-network
%{_bindir}/nova-dhcpbridge
%{_bindir}/nova-network
%{_mandir}/man1/nova-dhcpbridge.1%{?ext_man}
%{_mandir}/man1/nova-network.1%{?ext_man}

%files novncproxy
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-novncproxy
%{_sbindir}/rc%{name}-novncproxy
%{_bindir}/nova-novncproxy
%{_mandir}/man1/nova-novncproxy.1%{?ext_man}

%files serialproxy
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-serialproxy
%{_sbindir}/rc%{name}-serialproxy
%{_bindir}/nova-serialproxy
%{_mandir}/man1/nova-serialproxy.1%{?ext_man}

%files scheduler
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-scheduler
%{_sbindir}/rc%{name}-scheduler
%{_bindir}/nova-scheduler
%{_mandir}/man1/nova-scheduler.1%{?ext_man}

%files vncproxy
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-vncproxy
%{_sbindir}/rc%{name}-vncproxy
%{_bindir}/nova-xvpvncproxy
%{_mandir}/man1/nova-xvpvncproxy.1%{?ext_man}

%files -n openstack-xen-plugins
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_sysconfdir}/xapi.d
%dir %{_sysconfdir}/xapi.d/plugins/
%{_sysconfdir}/xapi.d/plugins/*

%files test
%defattr(-,root,root)
%{python_sitelib}/%{component}/tests/
%{_localstatedir}/lib/%{name}-test/

%changelog
openSUSE Build Service is sponsored by