2021-02-02 16:39:33 +08:00
|
|
|
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
|
2021-11-05 03:09:33 +00:00
|
|
|
%global with_doc 0
|
2021-08-11 17:39:47 +08:00
|
|
|
|
|
|
|
|
%global common_desc \
|
|
|
|
|
OpenStack Placement provides an HTTP service for managing, selecting, and \
|
|
|
|
|
claiming providers of classes of inventory representing available resources \
|
|
|
|
|
in a cloud.
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
Name: openstack-placement
|
2021-11-05 03:09:33 +00:00
|
|
|
Version: 2.0.1
|
|
|
|
|
Release: 1
|
2021-02-02 16:39:33 +08:00
|
|
|
Summary: OpenStack Placement
|
|
|
|
|
License: ASL 2.0
|
2021-08-11 17:39:47 +08:00
|
|
|
URL: http://git.openstack.org/cgit/openstack/placement/
|
|
|
|
|
Source0: https://tarballs.openstack.org/placement/%{name}-%{upstream_version}.tar.gz
|
|
|
|
|
Source1: placement-dist.conf
|
|
|
|
|
Source2: placement.logrotate
|
|
|
|
|
Source3: placement-api.conf
|
|
|
|
|
Source4: policy.json
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
BuildRequires: openstack-macros
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: intltool
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: git-core
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-os-traits
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
|
BuildRequires: python3-pbr
|
|
|
|
|
BuildRequires: python3-six
|
|
|
|
|
BuildRequires: python3-oslo-policy
|
|
|
|
|
BuildRequires: python3-ddt
|
|
|
|
|
BuildRequires: python3-oslo-rootwrap
|
|
|
|
|
BuildRequires: python3-oslo-log
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-oslo-concurrency
|
|
|
|
|
BuildRequires: python3-oslo-config
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: python3-oslo-context
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-oslo-db
|
|
|
|
|
BuildRequires: python3-oslo-middleware
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: python3-oslo-serialization
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-oslo-policy
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: python3-oslo-upgradecheck
|
|
|
|
|
BuildRequires: python3-oslo-utils
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-oslotest
|
2021-08-11 17:39:47 +08:00
|
|
|
BuildRequires: python3-osprofiler
|
|
|
|
|
BuildRequires: python3-subunit
|
|
|
|
|
BuildRequires: python3-tooz
|
|
|
|
|
BuildRequires: python3-oslo-vmware
|
|
|
|
|
BuildRequires: python3-cursive
|
|
|
|
|
BuildRequires: python3-os-service-types
|
|
|
|
|
BuildRequires: python3-os-resource-classes
|
|
|
|
|
BuildRequires: python3-microversion-parse
|
|
|
|
|
BuildRequires: python3-jsonschema
|
|
|
|
|
BuildRequires: python3-sqlalchemy
|
|
|
|
|
BuildRequires: python3-routes
|
|
|
|
|
BuildRequires: python3-webob
|
|
|
|
|
BuildRequires: python3-keystonemiddleware
|
|
|
|
|
BuildRequires: python3-requests
|
2021-02-02 16:39:33 +08:00
|
|
|
BuildRequires: python3-stestr
|
2021-08-11 17:39:47 +08:00
|
|
|
Requires: openstack-placement-api
|
|
|
|
|
%description
|
|
|
|
|
%{common_desc}
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
%package common
|
|
|
|
|
Summary: Components common to all OpenStack Placement services
|
|
|
|
|
Requires: python3-placement = %{version}-%{release}
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
%description common
|
|
|
|
|
%{common_desc}
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
This package contains scripts, config and dependencies shared
|
|
|
|
|
between all the OpenStack Placement services.
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
%package api
|
2021-08-11 17:39:47 +08:00
|
|
|
Summary: OpenStack Placement API service
|
|
|
|
|
|
|
|
|
|
Requires: openstack-placement-common = %{version}-%{release}
|
|
|
|
|
Requires: httpd
|
2021-02-02 16:39:33 +08:00
|
|
|
Requires: python3-mod_wsgi
|
|
|
|
|
|
|
|
|
|
%description api
|
2021-08-11 17:39:47 +08:00
|
|
|
%{common_desc}
|
|
|
|
|
|
|
|
|
|
This package contains the Placement service, which will initially
|
|
|
|
|
allow for the management of resource providers.
|
|
|
|
|
|
|
|
|
|
%package -n python3-placement
|
|
|
|
|
Summary: Placement Python libraries
|
|
|
|
|
%{?python_provide:%python_provide python3-placement}
|
|
|
|
|
|
2021-11-05 03:09:33 +00:00
|
|
|
Requires: python3-sqlalchemy
|
|
|
|
|
Requires: python3-routes
|
|
|
|
|
Requires: python3-webob
|
|
|
|
|
Requires: python3-keystonemiddleware
|
|
|
|
|
Requires: python3-jsonschema
|
|
|
|
|
Requires: python3-microversion-parse
|
|
|
|
|
Requires: python3-os-traits
|
|
|
|
|
Requires: python3-os-resource-classes
|
|
|
|
|
Requires: python3-oslo-concurrency
|
|
|
|
|
Requires: python3-oslo-config
|
|
|
|
|
Requires: python3-oslo-context
|
|
|
|
|
Requires: python3-oslo-db
|
|
|
|
|
Requires: python3-oslo-log
|
|
|
|
|
Requires: python3-oslo-middleware
|
|
|
|
|
Requires: python3-oslo-serialization
|
|
|
|
|
Requires: python3-oslo-upgradecheck
|
|
|
|
|
Requires: python3-oslo-utils
|
|
|
|
|
Requires: python3-oslo-policy
|
|
|
|
|
Requires: python3-pbr
|
|
|
|
|
Requires: python3-requests
|
2021-08-11 17:39:47 +08:00
|
|
|
|
|
|
|
|
%description -n python3-placement
|
|
|
|
|
%{common_desc}
|
|
|
|
|
|
|
|
|
|
This package contains the Placement Python library.
|
|
|
|
|
|
|
|
|
|
%package -n python3-placement-tests
|
|
|
|
|
Summary: Placement tests
|
|
|
|
|
%{?python_provide:%python_provide python3-placement-tests}
|
|
|
|
|
Requires: openstack-placement-common = %{version}-%{release}
|
2021-11-05 03:09:33 +00:00
|
|
|
Requires: python3-hacking
|
|
|
|
|
Requires: python3-coverage
|
|
|
|
|
Requires: python3-fixtures
|
|
|
|
|
Requires: python3-mock
|
|
|
|
|
Requires: python3-PyMySQL
|
|
|
|
|
Requires: python3-oslotest
|
|
|
|
|
Requires: python3-stestr
|
|
|
|
|
Requires: python3-testtools
|
|
|
|
|
Requires: python3-gabbi
|
|
|
|
|
Requires: python3-wsgi_intercept
|
2021-08-11 17:39:47 +08:00
|
|
|
|
|
|
|
|
%description -n python3-placement-tests
|
|
|
|
|
%{common_desc}
|
|
|
|
|
|
|
|
|
|
This package contains the Placement Python library tests.
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_doc}
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for OpenStack Placement
|
|
|
|
|
|
|
|
|
|
BuildRequires: graphviz
|
|
|
|
|
BuildRequires: python3-openstackdocstheme
|
|
|
|
|
BuildRequires: python3-oslo-config
|
|
|
|
|
BuildRequires: python3-oslo-log
|
|
|
|
|
BuildRequires: python3-oslo-messaging
|
|
|
|
|
BuildRequires: python3-oslo-utils
|
|
|
|
|
BuildRequires: python3-routes
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
BuildRequires: python3-sphinxcontrib-actdiag
|
|
|
|
|
BuildRequires: python3-sphinxcontrib-seqdiag
|
|
|
|
|
BuildRequires: python3-sphinx-feature-classification
|
|
|
|
|
BuildRequires: python3-sqlalchemy
|
|
|
|
|
BuildRequires: python3-webob
|
|
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
|
%{common_desc}
|
|
|
|
|
|
|
|
|
|
This package contains documentation files for Placement.
|
|
|
|
|
%endif
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
%prep
|
2021-08-11 17:39:47 +08:00
|
|
|
# "-S git" is necessary to run build
|
|
|
|
|
%autosetup -n openstack-placement-%{upstream_version} -S git
|
|
|
|
|
|
|
|
|
|
find . \( -name .gitignore -o -name .placeholder \) -delete
|
|
|
|
|
|
|
|
|
|
find placement -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
|
|
|
|
|
|
2021-02-02 16:39:33 +08:00
|
|
|
%py_req_cleanup
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
PYTHONPATH=. oslo-config-generator --config-file=etc/placement/config-generator.conf
|
|
|
|
|
PYTHONPATH=. oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf
|
|
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
%{py3_build}
|
|
|
|
|
|
2021-02-02 16:39:33 +08:00
|
|
|
%install
|
2021-08-11 17:39:47 +08:00
|
|
|
%{py3_install}
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
export PYTHONPATH=.
|
|
|
|
|
%if 0%{?with_doc}
|
|
|
|
|
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
|
|
|
|
|
rm -rf doc/build/html/.{doctrees,buildinfo}
|
|
|
|
|
%endif
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
install -d -m 750 %{buildroot}%{_localstatedir}/log/placement
|
|
|
|
|
|
|
|
|
|
install -d -m 755 %{buildroot}%{_sysconfdir}/placement
|
|
|
|
|
install -p -D -m 640 etc/placement/placement.conf.sample %{buildroot}%{_sysconfdir}/placement/placement.conf
|
|
|
|
|
install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datarootdir}/placement/placement-dist.conf
|
|
|
|
|
install -p -D -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/00-placement-api.conf
|
|
|
|
|
install -p -D -m 640 %{SOURCE4} %{buildroot}%{_sysconfdir}/placement/policy.json
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-placement
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
install -d -m 755 %{buildroot}%{_datarootdir}/placement
|
|
|
|
|
install -p -D -m 755 tools/mysql-migrate-db.sh %{buildroot}%{_datarootdir}/placement/mysql-migrate-db.sh
|
|
|
|
|
install -p -D -m 755 tools/postgresql-migrate-db.sh %{buildroot}%{_datarootdir}/placement/postgresql-migrate-db.sh
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
%check
|
|
|
|
|
export PYTHON=%{__python3}
|
|
|
|
|
OS_TEST_PATH=./placement/tests/unit stestr run
|
2021-02-02 16:39:33 +08:00
|
|
|
|
2021-08-11 17:39:47 +08:00
|
|
|
%pre common
|
|
|
|
|
getent group placement >/dev/null || groupadd -r placement
|
|
|
|
|
getent passwd placement >/dev/null || \
|
|
|
|
|
useradd -r -g placement -d / -s /bin/bash -c "OpenStack Placement" placement
|
|
|
|
|
exit 0
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
%files
|
2021-08-11 17:39:47 +08:00
|
|
|
%files common
|
2021-02-02 16:39:33 +08:00
|
|
|
%license LICENSE
|
2021-08-11 17:39:47 +08:00
|
|
|
%doc etc/placement/policy.yaml.sample
|
2021-02-02 16:39:33 +08:00
|
|
|
%{_bindir}/placement-manage
|
|
|
|
|
%{_bindir}/placement-status
|
2021-08-11 17:39:47 +08:00
|
|
|
%dir %{_datarootdir}/placement
|
|
|
|
|
%attr(-, root, placement) %{_datarootdir}/placement/placement-dist.conf
|
|
|
|
|
%{_datarootdir}/placement/mysql-migrate-db.sh
|
|
|
|
|
%{_datarootdir}/placement/postgresql-migrate-db.sh
|
|
|
|
|
%dir %{_sysconfdir}/placement
|
|
|
|
|
%config(noreplace) %attr(-, root, placement) %{_sysconfdir}/placement/placement.conf
|
|
|
|
|
%config(noreplace) %attr(-, root, placement) %{_sysconfdir}/placement/policy.json
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-placement
|
|
|
|
|
%dir %attr(0750, placement, root) %{_localstatedir}/log/placement
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
%files api
|
|
|
|
|
%license LICENSE
|
2021-08-11 17:39:47 +08:00
|
|
|
%config(noreplace) %{_sysconfdir}/httpd/conf.d/00-placement-api.conf
|
2021-02-02 16:39:33 +08:00
|
|
|
%{_bindir}/placement-api
|
2021-08-11 17:39:47 +08:00
|
|
|
|
|
|
|
|
%files -n python3-placement
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{python3_sitelib}/placement
|
|
|
|
|
%{python3_sitelib}/placement_db_tools
|
|
|
|
|
%{python3_sitelib}/openstack_placement-*.egg-info
|
|
|
|
|
%exclude %{python3_sitelib}/placement/tests
|
|
|
|
|
|
|
|
|
|
%files -n python3-placement-tests
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{python3_sitelib}/placement/tests
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_doc}
|
|
|
|
|
%files doc
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%doc doc/build/html
|
|
|
|
|
%endif
|
2021-02-02 16:39:33 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2021-11-05 03:09:33 +00:00
|
|
|
* Fri Nov 05 2021 wangxiyuan <wangxiyuan1007@gmail.com> - 2.0.1-1
|
|
|
|
|
- Support OpenStack Train release
|
2021-08-11 17:39:47 +08:00
|
|
|
|