File openstack-keystone.spec of Package openstack-keystone
#
# spec file for package openstack-keystone
#
# Copyright (c) 2023 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/
#
%global with_doc 1
%if 0%{?rhel} || 0%{?fedora}
%global rdo 1
%endif
Name: openstack-keystone
Epoch: 0
Version: 22.0.1~dev8
Release: 0
Summary: OpenStack Identity Service
License: Apache-2.0
URL: https://docs.openstack.org/keystone
Source0: keystone-stable-zed.tar.gz
Source1: openstack-keystone.logrotate
Source2: openstack-keystone.sysctl
Source3: openstack-keystone.tmpfiles
Source4: openstack-keystone.defaultconf
Source5: openstack-keystone.README.config
BuildRequires: openstack-macros
BuildRequires: python39-Flask
BuildRequires: python39-Flask-RESTful
BuildRequires: python39-WebTest
BuildRequires: python39-bcrypt
BuildRequires: python39-fixtures
BuildRequires: python39-freezegun
BuildRequires: python39-jsonschema
BuildRequires: python39-keystonemiddleware
BuildRequires: python39-ldappool
BuildRequires: python39-lxml
BuildRequires: python39-oauthlib
BuildRequires: python39-oslo.cache
BuildRequires: python39-oslo.config
BuildRequires: python39-oslo.db
BuildRequires: python39-oslo.messaging
BuildRequires: python39-oslo.policy
BuildRequires: python39-oslo.upgradecheck
BuildRequires: python39-oslotest
BuildRequires: python39-osprofiler
BuildRequires: python39-passlib
BuildRequires: python39-pbr
BuildRequires: python39-pysaml2
BuildRequires: python39-requests
BuildRequires: python39-scrypt
BuildRequires: python39-sqlparse
BuildRequires: python39-stestr
BuildRequires: python39-testresources
BuildRequires: python39-testscenarios
BuildRequires: python39-testtools
BuildRequires: which
Requires: logrotate
Requires: python3-keystone = %{epoch}:%{version}-%{release}
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: libxmlsec1-openssl1
Requires(pre): pwdutils
%endif
%if 0%{?rdo}
BuildRequires: xmlsec1-openssl
Requires(pre): shadow-utils
%endif
%description
Keystone is a Python implementation of the OpenStack
(http://www.openstack.org) identity service API.
.
This package contains the keystone python libraries.
%package -n python3-keystone
Summary: Keystone Python libraries
Group: Applications/System
Requires: python-ldap
Requires: python3-keystoneclient
Requires: python39-Babel
Requires: python39-Flask
Requires: python39-Flask-RESTful
Requires: python39-PyJWT
Requires: python39-SQLAlchemy
Requires: python39-WebOb
Requires: python39-bcrypt
Requires: python39-cryptography
Requires: python39-dogpile.cache
Requires: python39-jsonschema
Requires: python39-keystonemiddleware
Requires: python39-ldappool
Requires: python39-msgpack
Requires: python39-oauthlib
Requires: python39-oslo.cache
Requires: python39-oslo.concurrency
Requires: python39-oslo.config
Requires: python39-oslo.context
Requires: python39-oslo.db
Requires: python39-oslo.i18n
Requires: python39-oslo.log
Requires: python39-oslo.messaging
Requires: python39-oslo.middleware
Requires: python39-oslo.policy
Requires: python39-oslo.serialization
Requires: python39-oslo.upgradecheck
Requires: python39-oslo.utils
Requires: python39-osprofiler
Requires: python39-passlib
Requires: python39-pbr
Requires: python39-pycadf
Requires: python39-pysaml2
Requires: python39-python-memcached
Requires: python39-pytz
Requires: python39-scrypt
Requires: python39-sqlalchemy-migrate
Requires: python39-stevedore
%description -n python3-keystone
Keystone is a Python implementation of the OpenStack
(https://docs.openstack.org/keystone/latest/) identity service API.
This package contains the Keystone Python library.
%package -n python3-keystone-tests
Summary: Keystone tests
Requires: openstack-keystone = %{epoch}:%{version}-%{release}
Provides: python-keystone-tests = %{epoch}:%{version}-%{release}
%description -n python3-keystone-tests
Keystone is a Python implementation of the OpenStack
(https://docs.openstack.org/keystone/latest/) identity service API.
This package contains the Keystone test files.
%if 0%{?with_doc}
%package doc
Summary: Documentation for OpenStack Identity Service
Group: Documentation/HTML
BuildRequires: python39-Sphinx
BuildRequires: python39-openstackdocstheme
BuildRequires: python39-sphinx-feature-classification
BuildRequires: python39-sphinxcontrib-apidoc
BuildRequires: python39-sphinxcontrib-blockdiag
BuildRequires: python39-sphinxcontrib-seqdiag
%description doc
OpenStack Keystone documentaion.
.
This package contains the documentation
%endif
%prep
%autosetup -p1 -n keystone-22.0.1.dev8
%py_req_cleanup
%if 0%{?rdo}
find . \( -name .gitignore -o -name .placeholder \) -delete
find keystone -name \*.py -exec sed -i '/\/usr\/bin\/env python/d' {} \;
# adjust paths to WSGI scripts
sed -i 's#/local/bin#/bin#' httpd/wsgi-keystone.conf
sed -i 's#apache2#httpd#' httpd/wsgi-keystone.conf
%endif
%build
%{py3_build}
# doc
%if 0%{?with_doc}
PYTHONPATH=. PBR_VERSION=22.0.1.dev8 %sphinx_build -b html doc/source doc/build/html
PYTHONPATH=. PBR_VERSION=22.0.1.dev8 %sphinx_build -b man doc/source doc/build/man
# remove the Sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
rm -rf doc/build/man/.{doctrees,buildinfo}
%endif
# config file generation
PYTHONPATH=. oslo-config-generator --config-file config-generator/keystone.conf \
--output-file etc/keystone.conf.sample
# policy file generation
oslopolicy-sample-generator --config-file config-generator/keystone-policy-generator.conf --output-file etc/keystone.policy.yaml
%install
%{py3_install}
install -d -m 755 %{buildroot}%{_sysconfdir}/keystone
install -d -m 755 %{buildroot}%{_sysconfdir}/sysctl.d
install -d -m 750 %{buildroot}%{_localstatedir}/{lib,log,cache}/keystone
install -d -m 755 %{buildroot}%{_sysconfdir}/keystone/keystone.conf.d/
# default dir for fernet tokens
install -d -m 750 %{buildroot}%{_sysconfdir}/keystone/credential-keys/
install -D -m 644 %{SOURCE3} %{buildroot}/%{_tmpfilesdir}/keystone.conf
install -p -D -m 640 etc/keystone.conf.sample %{buildroot}%{_sysconfdir}/keystone/keystone.conf
install -D -m 640 %{SOURCE4} %{buildroot}/%{_sysconfdir}/keystone/keystone.conf.d/010-keystone.conf
install -D -m 440 %{SOURCE5} %{buildroot}/%{_sysconfdir}/keystone/README.config
install -p -D -m 640 etc/logging.conf.sample %{buildroot}%{_sysconfdir}/keystone/logging.conf
install -p -D -m 640 etc/keystone.policy.yaml %{buildroot}%{_sysconfdir}/keystone/keystone.policy.yaml
install -p -D -m 640 etc/default_catalog.templates %{buildroot}%{_sysconfdir}/keystone/default_catalog.templates
install -p -D -m 640 etc/sso_callback_template.html %{buildroot}%{_sysconfdir}/keystone/sso_callback_template.html
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-keystone
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysctl.d/openstack-keystone.conf
# remove wrongly installed tree
rm -rv %{buildroot}/%{_prefix}%{_sysconfdir}/
# Install sample data script.
install -p -D -m 755 tools/sample_data.sh %{buildroot}%{_datadir}/keystone/sample_data.sh
# Install apache configuration files
install -p -D -m 644 httpd/wsgi-keystone.conf %{buildroot}%{_datadir}/keystone/
# man pages
%if 0%{?with_doc}
mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1/
%endif
%pre
%openstack_pre_user_group_create keystone keystone /sbin/nologin
exit 0
%check
# don't want to depend on hacking for package building
rm keystone/tests/unit/test_hacking_checks.py
%if 0%{?suse_version}
PYTHON=python3 stestr run --black-regex keystone.tests.unit.test_policy.GeneratePolicyFileTestCase.test_policy_generator_from_command_line
%endif
%if 0%{?rdo}
stestr-3 run --black-regex keystone.tests.unit.test_policy.GeneratePolicyFileTestCase.test_policy_generator_from_command_line
%endif
%post
%tmpfiles_create %{_tmpfilesdir}/keystone.conf
%sysctl_apply openstack-keystone.conf
%files
%license LICENSE
%doc README.rst
%{_bindir}/keystone-wsgi-admin
%{_bindir}/keystone-wsgi-public
%{_bindir}/keystone-manage
%{_bindir}/keystone-status
%_tmpfilesdir/keystone.conf
%dir %{_datadir}/keystone
%attr(0755, root, root) %{_datadir}/keystone/sample_data.sh
%attr(0644, root, keystone) %{_datadir}/keystone/wsgi-keystone.conf
%dir %attr(0750, root, keystone) %{_sysconfdir}/keystone/
%dir %attr(0750, root, keystone) %{_sysconfdir}/keystone/keystone.conf.d/
%dir %attr(0750, root, keystone) %{_sysconfdir}/keystone/credential-keys
%{_sysconfdir}/keystone/README.config
%config(noreplace) %attr(0640, root, keystone) %{_sysconfdir}/keystone/keystone.conf
%config(noreplace) %attr(0640, root, keystone) %{_sysconfdir}/keystone/keystone.conf.d/010-keystone.conf
%config(noreplace) %attr(0640, root, keystone) %{_sysconfdir}/keystone/logging.conf
%config(noreplace) %attr(0640, root, keystone) %{_sysconfdir}/keystone/default_catalog.templates
%config(noreplace) %attr(0640, keystone, keystone) %{_sysconfdir}/keystone/keystone.policy.yaml
%config(noreplace) %attr(0640, keystone, keystone) %{_sysconfdir}/keystone/sso_callback_template.html
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-keystone
%dir %attr(0750, keystone, keystone) %{_localstatedir}/lib/keystone
%dir %attr(0750, keystone, keystone) %{_localstatedir}/log/keystone
%dir %attr(0750, keystone, keystone) %{_localstatedir}/cache/keystone
%{_sysconfdir}/sysctl.d/openstack-keystone.conf
%if 0%{?with_doc}
%{_mandir}/man1/keystone-manage.1.gz
%endif
%files -n python3-keystone
%doc README.rst
%license LICENSE
%{python3_sitelib}/keystone*
%{python3_sitelib}/keystone-*.egg-info
%exclude %{python3_sitelib}/keystone/tests
%files -n python3-keystone-tests
%license LICENSE
%{python3_sitelib}/keystone/tests
%if 0%{?with_doc}
%files doc
%license LICENSE
%doc doc/build/html
%endif
%changelog