openstack-nova/openstack-nova.spec

742 lines
25 KiB
RPMSpec
Raw Normal View History

2021-01-15 15:51:06 +08:00
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global with_doc 0
2021-07-23 16:30:03 +08:00
%global common_desc \
OpenStack Compute (codename Nova) is open source software designed to \
provision and manage large networks of virtual machines, creating a \
redundant and scalable cloud computing platform. It gives you the \
software, control panels, and APIs required to orchestrate a cloud, \
including running instances, managing networks, and controlling access \
through users and projects. OpenStack Compute strives to be both \
hardware and hypervisor agnostic, currently supporting a variety of \
standard hardware configurations and seven major hypervisors.
2021-01-15 15:51:06 +08:00
Name: openstack-nova
2021-07-23 16:30:03 +08:00
# Liberty semver reset
# https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z
2021-11-05 02:26:19 +00:00
Version: 20.6.1
2021-11-23 07:41:02 +00:00
Release: 3
2021-01-15 15:51:06 +08:00
Summary: OpenStack Compute (nova)
2021-07-23 16:30:03 +08:00
License: ASL 2.0
2021-01-15 15:51:06 +08:00
URL: http://openstack.org/projects/compute/
Source0: https://tarballs.openstack.org/nova/nova-%{upstream_version}.tar.gz
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Source1: nova-dist.conf
Source6: nova.logrotate
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Source10: openstack-nova-api.service
Source12: openstack-nova-compute.service
Source15: openstack-nova-scheduler.service
Source25: openstack-nova-metadata-api.service
Source26: openstack-nova-conductor.service
Source28: openstack-nova-spicehtml5proxy.service
Source29: openstack-nova-novncproxy.service
Source31: openstack-nova-serialproxy.service
Source32: openstack-nova-os-compute-api.service
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Source22: nova-ifc-template
Source24: nova-sudoers
Source30: openstack-nova-novncproxy.sysconfig
Source34: policy.json
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Source35: nova_migration-sudoers
Source36: nova-ssh-config
Source37: nova-migration-wrapper
Source38: nova_migration_identity
Source39: nova_migration_authorized_keys
Source40: nova_migration-rootwrap.conf
Source41: nova_migration-rootwrap_cold_migration
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
BuildArch: noarch
BuildRequires: openstack-macros
BuildRequires: intltool
BuildRequires: python3-devel
2021-07-23 16:30:03 +08:00
BuildRequires: git-core
2021-01-15 15:51:06 +08:00
BuildRequires: python3-oslo-cache
BuildRequires: python3-os-traits
BuildRequires: python3-setuptools
BuildRequires: python3-netaddr
BuildRequires: python3-pbr
BuildRequires: python3-six
BuildRequires: python3-oslo-i18n
2021-11-05 02:26:19 +00:00
BuildRequires: python3-cryptography
2021-01-15 15:51:06 +08:00
BuildRequires: python3-oslo-policy
2021-07-23 16:30:03 +08:00
# Required for unit tests
2021-01-15 15:51:06 +08:00
BuildRequires: python3-barbicanclient
BuildRequires: python3-ddt
BuildRequires: python3-ironicclient
2021-07-23 16:30:03 +08:00
# BuildRequires: python3-mox3
2021-01-15 15:51:06 +08:00
BuildRequires: python3-os-testr
BuildRequires: python3-os-vif
BuildRequires: python3-oslo-rootwrap
BuildRequires: python3-oslotest
BuildRequires: python3-osprofiler
BuildRequires: python3-subunit
BuildRequires: python3-testrepository
BuildRequires: python3-testresources
BuildRequires: python3-testscenarios
BuildRequires: python3-tooz
BuildRequires: python3-oslo-vmware
BuildRequires: python3-cursive
BuildRequires: python3-os-service-types
BuildRequires: python3-os-resource-classes
BuildRequires: python3-requests-mock
BuildRequires: /usr/bin/pathfix.py
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-compute = %{version}-%{release}
Requires: openstack-nova-scheduler = %{version}-%{release}
Requires: openstack-nova-api = %{version}-%{release}
Requires: openstack-nova-conductor = %{version}-%{release}
Requires: openstack-nova-novncproxy = %{version}-%{release}
Requires: openstack-nova-migration = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%description
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
%package common
Summary: Components common to all OpenStack Nova services
2021-07-23 16:30:03 +08:00
Obsoletes: openstack-nova-cert <= 16.0.0-1
# nova-cells has been retired in train
Obsoletes: openstack-nova-cells < 20.0.0
Requires: python3-nova = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%{?systemd_ordering}
Requires(pre): shadow-utils
BuildRequires: systemd
2021-07-23 16:30:03 +08:00
# Required to build nova.conf.sample
2021-11-05 02:26:19 +00:00
BuildRequires: python3-castellan
2021-01-15 15:51:06 +08:00
BuildRequires: python3-glanceclient
BuildRequires: python3-keystonemiddleware
2021-11-05 02:26:19 +00:00
BuildRequires: python3-microversion-parse
2021-01-15 15:51:06 +08:00
BuildRequires: python3-os-brick
BuildRequires: python3-oslo-db
BuildRequires: python3-oslo-reports
BuildRequires: python3-oslo-service
BuildRequires: python3-oslo-versionedobjects
BuildRequires: python3-paramiko
2021-07-23 16:30:03 +08:00
# Required to compile translation files
2021-01-15 15:51:06 +08:00
BuildRequires: python3-babel
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
BuildRequires: python3-lxml
2021-11-05 02:26:19 +00:00
BuildRequires: python3-websockify
2021-01-15 15:51:06 +08:00
2021-07-23 16:30:03 +08:00
# remove old service subpackage
Obsoletes: %{name}-objectstore
2021-01-15 15:51:06 +08:00
%description common
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains scripts, config and dependencies shared
between all the OpenStack nova services.
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%package compute
Summary: OpenStack Nova Virtual Machine control service
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-01-15 15:51:06 +08:00
Requires: curl
Requires: iscsi-initiator-utils
Requires: iptables
Requires: iptables-services
Requires: ipmitool
Requires: /usr/bin/virsh
Requires: openssh-clients
Requires: rsync
Requires: lvm2
2021-11-05 02:26:19 +00:00
Requires: python3-cinderclient
2021-01-15 15:51:06 +08:00
Requires: genisoimage
2021-07-23 16:30:03 +08:00
2021-11-05 02:26:19 +00:00
Requires(pre): qemu
Requires(pre): qemu-block-rbd
Requires(pre): qemu-block-ssh
Requires(pre): python3-libvirt
Requires(pre): libvirt-daemon-driver-nodedev
Requires(pre): libvirt-daemon-driver-nwfilter
Requires(pre): libvirt-daemon-driver-secret
Requires(pre): libvirt-daemon-driver-qemu
Requires(pre): libvirt-daemon-driver-storage-core
2021-01-15 15:51:06 +08:00
Requires: sg3_utils
Requires: sysfsutils
Requires: libosinfo
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Requires: python3-libguestfs
Requires: python3-libvirt
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%description compute
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the Nova service for controlling Virtual Machines.
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%package scheduler
Summary: OpenStack Nova VM distribution service
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%description scheduler
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the service for scheduling where
to run Virtual Machines in the cloud.
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%package api
Summary: OpenStack Nova API services
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-11-05 02:26:19 +00:00
Requires: python3-cinderclient
2021-01-15 15:51:06 +08:00
%description api
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the Nova services providing programmatic access.
%package conductor
Summary: OpenStack Nova Conductor services
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%description conductor
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the Nova services providing database access for
the compute service
%package novncproxy
Summary: OpenStack Nova noVNC proxy service
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-01-15 15:51:06 +08:00
Requires: novnc
2021-11-05 02:26:19 +00:00
Requires: python3-websockify
2021-01-15 15:51:06 +08:00
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%description novncproxy
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the Nova noVNC Proxy service that can proxy
VNC traffic over browser websockets connections.
%package spicehtml5proxy
Summary: OpenStack Nova Spice HTML5 console access service
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-11-05 02:26:19 +00:00
Requires: python3-websockify
2021-01-15 15:51:06 +08:00
%description spicehtml5proxy
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the Nova services providing the
spice HTML5 console access service to Virtual Machines.
%package serialproxy
Summary: OpenStack Nova serial console access service
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-common = %{version}-%{release}
2021-11-05 02:26:19 +00:00
Requires: python3-websockify
2021-01-15 15:51:06 +08:00
%description serialproxy
2021-07-23 16:30:03 +08:00
%{common_desc}
This package contains the Nova services providing the \
2021-01-15 15:51:06 +08:00
serial console access service to Virtual Machines.
%package migration
Summary: OpenStack Nova Migration
2021-07-23 16:30:03 +08:00
Requires: openstack-nova-compute = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%description migration
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains scripts and config to support VM migration in Nova.
%package -n python3-nova
Summary: Nova Python libraries
%{?python_provide:%python_provide python3-nova}
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
Requires: openssl
2021-07-23 16:30:03 +08:00
# Require openssh for ssh-keygen
2021-01-15 15:51:06 +08:00
Requires: openssh
Requires: sudo
2021-07-23 16:30:03 +08:00
2021-11-05 02:26:19 +00:00
Requires: python3-paramiko
Requires: python3-eventlet
Requires: python3-iso8601
Requires: python3-netaddr
2021-01-15 15:51:06 +08:00
Requires: python3-boto
2021-11-05 02:26:19 +00:00
Requires: python3-stevedore
Requires: python3-sqlalchemy
Requires: python3-alembic
Requires: python3-routes
Requires: python3-webob
Requires: python3-castellan
Requires: python3-cryptography
Requires: python3-cursive
2021-08-24 09:40:48 +00:00
Requires: python3-glanceclient
2021-11-05 02:26:19 +00:00
Requires: python3-greenlet
Requires: python3-keystonemiddleware
Requires: python3-keystoneauth1
Requires: python3-jinja2
Requires: python3-jsonschema
Requires: python3-microversion-parse
Requires: python3-neutronclient
Requires: python3-novaclient
Requires: python3-openstacksdk
Requires: python3-os-brick
Requires: python3-os-resource-classes
Requires: python3-os-traits
Requires: python3-oslo-cache
Requires: python3-oslo-concurrency
Requires: python3-oslo-config
Requires: python3-oslo-context
Requires: python3-oslo-db
Requires: python3-oslo-i18n
Requires: python3-oslo-log
Requires: python3-oslo-messaging
Requires: python3-oslo-middleware
Requires: python3-oslo-policy
Requires: python3-oslo-privsep
Requires: python3-oslo-reports
Requires: python3-oslo-rootwrap
Requires: python3-oslo-serialization
Requires: python3-oslo-service
Requires: python3-oslo-upgradecheck
Requires: python3-oslo-utils
Requires: python3-oslo-versionedobjects
Requires: python3-os-vif
Requires: python3-oslo-vmware
Requires: python3-pbr
Requires: python3-prettytable
Requires: python3-psutil
Requires: python3-requests
Requires: python3-rfc3986
Requires: python3-taskflow
Requires: python3-tooz
Requires: python3-os-service-types
Requires: python3-dateutil
Requires: python3-futurist
Requires: python3-decorator
Requires: python3-lxml
2021-01-15 15:51:06 +08:00
Requires: python3-ldap
Requires: python3-memcached
2021-08-24 09:40:48 +00:00
Requires: python3-sqlalchemy-migrate
2021-11-05 02:26:19 +00:00
Requires: python3-paste
Requires: python3-paste-deploy
Requires: python3-netifaces
Requires: python3-retrying
Requires: python3-yaml
2021-11-23 07:41:02 +00:00
Requires: python3-monotonic
2021-01-15 15:51:06 +08:00
%description -n python3-nova
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the nova Python library.
%package -n python3-nova-tests
Summary: Nova tests
%{?python_provide:%python_provide python3-nova-tests}
2021-07-23 16:30:03 +08:00
Requires: openstack-nova = %{version}-%{release}
2021-01-15 15:51:06 +08:00
%description -n python3-nova-tests
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains the nova Python library.
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Compute
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
BuildRequires: graphviz
2021-07-23 16:30:03 +08:00
# Required by build_sphinx for man and doc building
2021-01-15 15:51:06 +08:00
BuildRequires: python3-openstackdocstheme
BuildRequires: python3-sphinxcontrib-actdiag
BuildRequires: python3-sphinxcontrib-seqdiag
2021-07-23 16:30:03 +08:00
# Required to build module documents
2021-01-15 15:51:06 +08:00
BuildRequires: python3-boto
BuildRequires: python3-eventlet
BuildRequires: python3-barbicanclient
BuildRequires: python3-cinderclient
BuildRequires: python3-keystoneclient
BuildRequires: python3-neutronclient
BuildRequires: python3-os-win
BuildRequires: python3-oslo-config
BuildRequires: python3-oslo-log
BuildRequires: python3-oslo-messaging
BuildRequires: python3-oslo-utils
2021-11-05 02:26:19 +00:00
BuildRequires: python3-rfc3986
2021-01-15 15:51:06 +08:00
BuildRequires: python3-routes
BuildRequires: python3-sphinx
BuildRequires: python3-sphinxcontrib-actdiag
BuildRequires: python3-sphinxcontrib-seqdiag
BuildRequires: python3-sqlalchemy
BuildRequires: python3-webob
BuildRequires: python3-iso8601
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
BuildRequires: python3-redis
BuildRequires: python3-zmq
2021-02-20 12:09:32 +08:00
BuildRequires: python3-sqlalchemy-migrate
2021-01-15 15:51:06 +08:00
%description doc
2021-07-23 16:30:03 +08:00
%{common_desc}
2021-01-15 15:51:06 +08:00
This package contains documentation files for nova.
%endif
%prep
%autosetup -n nova-%{upstream_version} -p1
2021-01-15 15:51:06 +08:00
find . \( -name .gitignore -o -name .placeholder \) -delete
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
find nova -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
2021-07-23 16:30:03 +08:00
# Remove the requirements file so that pbr hooks don't add it
# to distutils requiers_dist config
2021-01-15 15:51:06 +08:00
%py_req_cleanup
%build
PYTHONPATH=. oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
2021-07-23 16:30:03 +08:00
# Generate a sample policy.yaml file for documentation purposes only
2021-01-15 15:51:06 +08:00
PYTHONPATH=. oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf
%{py3_build}
2021-07-23 16:30:03 +08:00
# Generate i18n files
# (amoralej) we can remove '-D nova' once https://review.openstack.org/#/c/439500/ is merged
2021-01-15 15:51:06 +08:00
%{__python3} setup.py compile_catalog -d build/lib/nova/locale -D nova
2021-07-23 16:30:03 +08:00
# Avoid http://bugzilla.redhat.com/1059815. Remove when that is closed
2021-01-15 15:51:06 +08:00
sed -i 's|group/name|group;name|; s|\[DEFAULT\]/|DEFAULT;|' etc/nova/nova.conf.sample
2021-07-23 16:30:03 +08:00
# Programmatically update defaults in sample config
# which is installed at /etc/nova/nova.conf
# First we ensure all values are commented in appropriate format.
# Since icehouse, there was an uncommented keystone_authtoken section
# at the end of the file which mimics but also conflicted with our
# distro editing that had been done for many releases.
2021-01-15 15:51:06 +08:00
sed -i '/^[^#[]/{s/^/#/; s/ //g}; /^#[^ ]/s/ = /=/' etc/nova/nova.conf.sample
2021-07-23 16:30:03 +08:00
# TODO: Make this more robust
# Note it only edits the first occurrence, so assumes a section ordering in sample
# and also doesn't support multi-valued variables like dhcpbridge_flagfile.
2021-01-15 15:51:06 +08:00
while read name eq value; do
test "$name" && test "$value" || continue
sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/nova/nova.conf.sample
done < %{SOURCE1}
%install
%{py3_install}
export PYTHONPATH=.
%if 0%{?with_doc}
sphinx-build -b html doc/source doc/build/html
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
%if 0%{?with_doc}
sphinx-build -b man doc/source doc/build/man
mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
%endif
2021-07-23 16:30:03 +08:00
# Setup directories
2021-01-15 15:51:06 +08:00
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/buckets
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/instances
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/keys
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/networks
install -d -m 755 %{buildroot}%{_sharedstatedir}/nova/tmp
install -d -m 750 %{buildroot}%{_localstatedir}/log/nova
install -d -m 700 %{buildroot}%{_sharedstatedir}/nova/.ssh
2021-07-23 16:30:03 +08:00
# Install config files
2021-01-15 15:51:06 +08:00
install -d -m 755 %{buildroot}%{_sysconfdir}/nova
install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datarootdir}/nova/nova-dist.conf
install -p -D -m 640 etc/nova/nova.conf.sample %{buildroot}%{_sysconfdir}/nova/nova.conf
install -p -D -m 640 etc/nova/rootwrap.conf %{buildroot}%{_sysconfdir}/nova/rootwrap.conf
install -p -D -m 640 etc/nova/api-paste.ini %{buildroot}%{_sysconfdir}/nova/api-paste.ini
install -d -m 755 %{buildroot}%{_sysconfdir}/nova/migration
install -p -D -m 600 %{SOURCE38} %{buildroot}%{_sysconfdir}/nova/migration/identity
install -p -D -m 644 %{SOURCE39} %{buildroot}%{_sysconfdir}/nova/migration/authorized_keys
install -p -D -m 640 %{SOURCE40} %{buildroot}%{_sysconfdir}/nova/migration/rootwrap.conf
install -d -m 755 %{buildroot}%{_sysconfdir}/nova/migration/rootwrap.d
install -p -D -m 640 %{SOURCE41} %{buildroot}%{_sysconfdir}/nova/migration/rootwrap.d/cold_migration.filters
2021-07-23 16:30:03 +08:00
# Install empty policy.json file to cover rpm updates with untouched policy files.
2021-01-15 15:51:06 +08:00
install -p -D -m 640 %{SOURCE34} %{buildroot}%{_sysconfdir}/nova/policy.json
2021-07-23 16:30:03 +08:00
# Install version info file
2021-01-15 15:51:06 +08:00
cat > %{buildroot}%{_sysconfdir}/nova/release <<EOF
[Nova]
product = OpenStack Compute
package = %{release}
EOF
2021-07-23 16:30:03 +08:00
# Install initscripts for Nova services
2021-01-15 15:51:06 +08:00
install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/openstack-nova-api.service
install -p -D -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/openstack-nova-compute.service
install -p -D -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/openstack-nova-scheduler.service
install -p -D -m 644 %{SOURCE25} %{buildroot}%{_unitdir}/openstack-nova-metadata-api.service
install -p -D -m 644 %{SOURCE26} %{buildroot}%{_unitdir}/openstack-nova-conductor.service
install -p -D -m 644 %{SOURCE28} %{buildroot}%{_unitdir}/openstack-nova-spicehtml5proxy.service
install -p -D -m 644 %{SOURCE29} %{buildroot}%{_unitdir}/openstack-nova-novncproxy.service
install -p -D -m 644 %{SOURCE31} %{buildroot}%{_unitdir}/openstack-nova-serialproxy.service
install -p -D -m 644 %{SOURCE32} %{buildroot}%{_unitdir}/openstack-nova-os-compute-api.service
2021-07-23 16:30:03 +08:00
# (amoralej) we need to keep this until https://review.opendev.org/686816 is merged
2021-01-15 15:51:06 +08:00
rm -f %{buildroot}%{_bindir}/nova-network
2021-07-23 16:30:03 +08:00
# Install sudoers
2021-01-15 15:51:06 +08:00
install -p -D -m 440 %{SOURCE24} %{buildroot}%{_sysconfdir}/sudoers.d/nova
install -p -D -m 440 %{SOURCE35} %{buildroot}%{_sysconfdir}/sudoers.d/nova_migration
2021-07-23 16:30:03 +08:00
# Install nova ssh client config for migration
2021-01-15 15:51:06 +08:00
install -p -D -m 600 %{SOURCE36} %{buildroot}%{_sharedstatedir}/nova/.ssh/config
2021-07-23 16:30:03 +08:00
# Install nova migration ssh wrapper command
2021-01-15 15:51:06 +08:00
install -p -D -m 755 %{SOURCE37} %{buildroot}%{_bindir}/nova-migration-wrapper
2021-07-23 16:30:03 +08:00
# Fix shebangs for Python 3-only distros
2021-01-15 15:51:06 +08:00
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{_bindir}/nova-migration-wrapper
2021-07-23 16:30:03 +08:00
# Install logrotate
2021-01-15 15:51:06 +08:00
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-nova
2021-07-23 16:30:03 +08:00
# Install pid directory
2021-01-15 15:51:06 +08:00
install -d -m 755 %{buildroot}%{_localstatedir}/run/nova
2021-07-23 16:30:03 +08:00
# Install template files
2021-01-15 15:51:06 +08:00
install -p -D -m 644 %{SOURCE22} %{buildroot}%{_datarootdir}/nova/interfaces.template
2021-07-23 16:30:03 +08:00
# Install rootwrap files in /usr/share/nova/rootwrap
2021-01-15 15:51:06 +08:00
mkdir -p %{buildroot}%{_datarootdir}/nova/rootwrap/
install -p -D -m 644 etc/nova/rootwrap.d/* %{buildroot}%{_datarootdir}/nova/rootwrap/
2021-07-23 16:30:03 +08:00
# Install novncproxy service options template
2021-01-15 15:51:06 +08:00
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 0644 %{SOURCE30} %{buildroot}%{_sysconfdir}/sysconfig/openstack-nova-novncproxy
2021-07-23 16:30:03 +08:00
# Install i18n .mo files (.po and .pot are not required)
2021-01-15 15:51:06 +08:00
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python3_sitelib}/nova/locale/*/LC_*/nova*po
rm -f %{buildroot}%{python3_sitelib}/nova/locale/*pot
mv %{buildroot}%{python3_sitelib}/nova/locale %{buildroot}%{_datadir}/locale
2021-07-23 16:30:03 +08:00
# Find language files
2021-01-15 15:51:06 +08:00
%find_lang nova --all-name
2021-07-23 16:30:03 +08:00
# Remove unneeded in production stuff
2021-01-15 15:51:06 +08:00
rm -f %{buildroot}%{_bindir}/nova-debug
rm -fr %{buildroot}%{python3_sitelib}/run_tests.*
rm -f %{buildroot}%{_bindir}/nova-combined
rm -f %{buildroot}/usr/share/doc/nova/README*
2021-07-23 16:30:03 +08:00
# Remove duplicated configuration files deployed at /usr/etc
2021-01-15 15:51:06 +08:00
rm -rf %{buildroot}%{_prefix}/etc/nova
2021-07-23 16:30:03 +08:00
# FIXME(jpena): unit tests are taking too long in the current DLRN infra
# Until we have a better architecture, let's not run them when under DLRN
2021-01-15 15:51:06 +08:00
%if 0%{!?dlrn}
%check
2021-07-23 16:30:03 +08:00
# create a fake os_xenapi with just enough to load the unit tests
2021-01-15 15:51:06 +08:00
mkdir -p os_xenapi
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
touch os_xenapi/__init__.py
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
cat > os_xenapi/client.py <<EOF
class session:
def XenAPISession():
pass
XenAPI = None
exception = None
EOF
2021-07-23 16:30:03 +08:00
# Limit the number of concurrent workers to 2
2021-01-15 15:51:06 +08:00
OS_TEST_PATH=./nova/tests/unit ostestr -c 2 --black-regex 'xenapi|test_compute_xen'
rm -rf os_xenapi
%endif
%pre common
getent group nova >/dev/null || groupadd -r nova --gid 162
if ! getent passwd nova >/dev/null; then
useradd -u 162 -r -g nova -G nova,nobody -d %{_sharedstatedir}/nova -s /sbin/nologin -c "OpenStack Nova Daemons" nova
fi
exit 0
%pre compute
usermod -a -G qemu nova
usermod -a -G libvirt nova
%pre migration
getent group nova_migration >/dev/null || groupadd -r nova_migration
getent passwd nova_migration >/dev/null || \
useradd -r -g nova_migration -d / -s /bin/bash -c "OpenStack Nova Migration" nova_migration
exit 0
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%post compute
%systemd_post %{name}-compute.service
%post scheduler
%systemd_post %{name}-scheduler.service
%post api
%systemd_post %{name}-api.service %{name}-metadata-api.service %{name}-os-compute-api.service
%post conductor
%systemd_post %{name}-conductor.service
%post novncproxy
%systemd_post %{name}-novncproxy.service
%post spicehtml5proxy
%systemd_post %{name}-spicehtml5proxy.service
%post serialproxy
%systemd_post %{name}-serialproxy.service
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%preun compute
%systemd_preun %{name}-compute.service
%preun scheduler
%systemd_preun %{name}-scheduler.service
%preun api
%systemd_preun %{name}-api.service %{name}-metadata-api.service %{name}-os-compute-api.service
%preun conductor
%systemd_preun %{name}-conductor.service
%preun novncproxy
%systemd_preun %{name}-novncproxy.service
%preun spicehtml5proxy
%systemd_preun %{name}-spicehtml5proxy.service
%preun serialproxy
%systemd_preun %{name}-serialproxy.service
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%postun compute
%systemd_postun_with_restart %{name}-compute.service
%postun scheduler
%systemd_postun_with_restart %{name}-scheduler.service
%postun api
%systemd_postun_with_restart %{name}-api.service %{name}-metadata-api.service %{name}-os-compute-api.service
%postun conductor
%systemd_postun_with_restart %{name}-conductor.service
%postun novncproxy
%systemd_postun_with_restart %{name}-novncproxy.service
%postun spicehtml5proxy
%systemd_postun_with_restart %{name}-spicehtml5proxy.service
%postun serialproxy
%systemd_postun_with_restart %{name}-serialproxy.service
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%files
2021-07-23 16:30:03 +08:00
2021-01-15 15:51:06 +08:00
%files common -f nova.lang
%license LICENSE
%doc etc/nova/policy.yaml.sample
%dir %{_datarootdir}/nova
%attr(-, root, nova) %{_datarootdir}/nova/nova-dist.conf
%{_datarootdir}/nova/interfaces.template
%dir %{_sysconfdir}/nova
%{_sysconfdir}/nova/release
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/nova.conf
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/api-paste.ini
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/rootwrap.conf
%config(noreplace) %attr(-, root, nova) %{_sysconfdir}/nova/policy.json
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-nova
%config(noreplace) %{_sysconfdir}/sudoers.d/nova
%dir %attr(0750, nova, root) %{_localstatedir}/log/nova
%dir %attr(0755, nova, root) %{_localstatedir}/run/nova
%{_bindir}/nova-manage
%{_bindir}/nova-policy
%{_bindir}/nova-rootwrap
%{_bindir}/nova-rootwrap-daemon
%{_bindir}/nova-status
2021-11-05 02:26:19 +00:00
%{_bindir}/nova-console
%{_bindir}/nova-dhcpbridge
%{_bindir}/nova-xvpvncproxy
2021-01-15 15:51:06 +08:00
%if 0%{?with_doc}
%{_mandir}/man1/nova*.1.gz
%endif
%defattr(-, nova, nova, -)
%dir %{_sharedstatedir}/nova
%dir %{_sharedstatedir}/nova/buckets
%dir %{_sharedstatedir}/nova/instances
%dir %{_sharedstatedir}/nova/keys
%dir %{_sharedstatedir}/nova/networks
%dir %{_sharedstatedir}/nova/tmp
%files compute
%{_bindir}/nova-compute
%{_unitdir}/openstack-nova-compute.service
%{_datarootdir}/nova/rootwrap/compute.filters
2021-11-05 02:26:19 +00:00
%{_datarootdir}/nova/rootwrap/network.filters
2021-01-15 15:51:06 +08:00
%files scheduler
%{_bindir}/nova-scheduler
%{_unitdir}/openstack-nova-scheduler.service
%files api
%{_bindir}/nova-api*
%{_bindir}/nova-metadata-wsgi
%{_unitdir}/openstack-nova-*api.service
2021-11-05 02:26:19 +00:00
%{_datarootdir}/nova/rootwrap/api-metadata.filters
2021-01-15 15:51:06 +08:00
%files conductor
%{_bindir}/nova-conductor
%{_unitdir}/openstack-nova-conductor.service
%files novncproxy
%{_bindir}/nova-novncproxy
%{_unitdir}/openstack-nova-novncproxy.service
%config(noreplace) %{_sysconfdir}/sysconfig/openstack-nova-novncproxy
%files spicehtml5proxy
%{_bindir}/nova-spicehtml5proxy
%{_unitdir}/openstack-nova-spicehtml5proxy.service
%files serialproxy
%{_bindir}/nova-serialproxy
%{_unitdir}/openstack-nova-serialproxy.service
%files migration
%{_bindir}/nova-migration-wrapper
%config(noreplace) %{_sysconfdir}/sudoers.d/nova_migration
%dir %attr(0700, nova, nova) %{_sharedstatedir}/nova/.ssh
%attr(0600, nova, nova) %{_sharedstatedir}/nova/.ssh/config
%dir %{_sysconfdir}/nova/migration
%config(noreplace) %attr(0640, root, nova_migration) %{_sysconfdir}/nova/migration/authorized_keys
%config(noreplace) %attr(0600, nova, nova) %{_sysconfdir}/nova/migration/identity
%config(noreplace) %attr(0640, root, root) %{_sysconfdir}/nova/migration/rootwrap.conf
%dir %{_sysconfdir}/nova/migration/rootwrap.d
%config(noreplace) %attr(0640, root, root) %{_sysconfdir}/nova/migration/rootwrap.d/cold_migration.filters
%files -n python3-nova
%license LICENSE
%{python3_sitelib}/nova
%{python3_sitelib}/nova-*.egg-info
%exclude %{python3_sitelib}/nova/tests
%files -n python3-nova-tests
%license LICENSE
%{python3_sitelib}/nova/tests
%if 0%{?with_doc}
%files doc
%license LICENSE
%doc doc/build/html
%endif
%changelog
2021-11-23 07:41:02 +00:00
* Tue Nov 23 2021 zhangy1317 <zhangy1317@foxmail.com> - 20.6.1-3
- Fix install issue
* Fri Nov 19 2021 huangtianhua <huangtianhua@huawei.com> - 20.6.1-2
- 20.6.1 doesn't require python-dataclasses, removes it.
2021-11-05 02:26:19 +00:00
* Fri Nov 05 2021 wangxiyuan <wangxiyuan1007@gmail.com> - 20.6.1-1
- Support OpenStack Train release
2021-07-23 16:30:03 +08:00