2023-03-16 15:36:26 +01:00
|
|
|
#
|
|
|
|
# spec file for package ansible-builder
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-05-16 12:17:31 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2023-03-16 15:36:26 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
|
|
|
# Leap15, SLES15
|
2023-05-16 12:17:31 +02:00
|
|
|
%if %pythons == "python310"
|
2023-03-16 15:36:26 +01:00
|
|
|
%define ansible_python python310
|
|
|
|
%define ansible_python_executable python3.10
|
|
|
|
%define ansible_python_sitelib %python310_sitelib
|
2023-05-16 12:17:31 +02:00
|
|
|
%endif
|
|
|
|
%if %pythons == "python311"
|
|
|
|
%define ansible_python python311
|
|
|
|
%define ansible_python_executable python3.11
|
|
|
|
%define ansible_python_sitelib %python311_sitelib
|
|
|
|
%endif
|
2023-03-16 15:36:26 +01:00
|
|
|
%else
|
|
|
|
# Tumbleweed
|
|
|
|
%define pythons python3
|
|
|
|
%define ansible_python python3
|
|
|
|
%define ansible_python_executable python3
|
|
|
|
%define ansible_python_sitelib %python3_sitelib
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: ansible-builder
|
2023-05-16 12:17:31 +02:00
|
|
|
Version: 3.0.0
|
2023-03-16 15:36:26 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: An Ansible execution environment builder
|
2023-03-16 15:52:12 +01:00
|
|
|
License: Apache-2.0
|
2023-03-16 15:36:26 +01:00
|
|
|
URL: https://github.com/ansible/ansible-builder
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/a/ansible-builder/ansible-builder-%{version}.tar.gz
|
|
|
|
BuildArch: noarch
|
2023-05-18 10:32:59 +02:00
|
|
|
# https://github.com/ansible/ansible-builder/blob/devel/setup.cfg#L41
|
|
|
|
BuildRequires: %{ansible_python}-base >= 3.9
|
2023-05-16 12:17:31 +02:00
|
|
|
BuildRequires: %{ansible_python}-pip
|
2023-03-16 15:36:26 +01:00
|
|
|
BuildRequires: %{ansible_python}-setuptools
|
2023-05-16 12:17:31 +02:00
|
|
|
BuildRequires: %{ansible_python}-wheel
|
|
|
|
BuildRequires: ansible-core
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
# https://github.com/ansible/ansible-builder/blob/devel/requirements.txt
|
2023-03-16 15:36:26 +01:00
|
|
|
BuildRequires: %{ansible_python}-PyYAML
|
2023-05-16 12:17:31 +02:00
|
|
|
BuildRequires: %{ansible_python}-bindep
|
|
|
|
BuildRequires: %{ansible_python}-jsonschema
|
2023-05-18 10:32:59 +02:00
|
|
|
BuildRequires: %{ansible_python}-pbr
|
2023-03-16 15:36:26 +01:00
|
|
|
BuildRequires: %{ansible_python}-requirements-parser
|
2023-05-16 12:17:31 +02:00
|
|
|
#
|
|
|
|
# Tests require podman, but also require connectivity to pull container images
|
|
|
|
# hence we do not enable this dependency
|
|
|
|
# BuildRequires: podman
|
|
|
|
#
|
|
|
|
# SECTION test requirements
|
|
|
|
# https://github.com/ansible/ansible-builder/blob/devel/test/requirements.txt
|
|
|
|
BuildRequires: %{ansible_python}-pytest
|
|
|
|
BuildRequires: %{ansible_python}-pytest-mock
|
|
|
|
BuildRequires: %{ansible_python}-pytest-xdist
|
2023-03-16 15:36:26 +01:00
|
|
|
# /SECTION
|
|
|
|
BuildRequires: fdupes
|
2023-05-16 12:17:31 +02:00
|
|
|
Requires: %{ansible_python}-PyYAML
|
|
|
|
Requires: %{ansible_python}-bindep
|
|
|
|
Requires: %{ansible_python}-jsonschema
|
|
|
|
Requires: %{ansible_python}-requirements-parser
|
|
|
|
Requires: (podman or docker)
|
2023-03-16 15:36:26 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Ansible Builder is a tool that automates the process of
|
|
|
|
building execution environments using the schemas and
|
|
|
|
tooling defined in various Ansible Collections and by
|
|
|
|
the user.
|
|
|
|
|
|
|
|
See the readthedocs page for ansible-builder at:
|
|
|
|
https://ansible-builder.readthedocs.io/en/latest/
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n ansible-builder-%{version}
|
2023-05-18 10:32:59 +02:00
|
|
|
sed -i '/return importlib.metadata.version/ s/return.*$/return "%{version}"/' src/ansible_builder/cli.py
|
2023-03-16 15:36:26 +01:00
|
|
|
|
|
|
|
%build
|
2023-05-16 12:17:31 +02:00
|
|
|
%pyproject_wheel
|
2023-03-16 15:36:26 +01:00
|
|
|
|
|
|
|
%install
|
2023-05-16 12:17:31 +02:00
|
|
|
%pyproject_install
|
|
|
|
%python_expand sed -i "1{s/env bash/bash/;}" %{buildroot}%{ansible_python_sitelib}/ansible_builder/_target_scripts/entrypoint
|
|
|
|
%python_expand head -n 1 %{buildroot}%{ansible_python_sitelib}/ansible_builder/_target_scripts/entrypoint
|
2023-03-16 15:36:26 +01:00
|
|
|
%fdupes %{buildroot}%{ansible_python_sitelib}
|
|
|
|
|
2023-05-16 12:17:31 +02:00
|
|
|
%check
|
|
|
|
# disable coverage tests
|
|
|
|
sed -i '/cov/d' pytest.ini
|
|
|
|
# disable color output
|
|
|
|
sed -i '/color/d' pytest.ini
|
|
|
|
# add %{buildroot}%{_bindir} to PATH, so the executable is found
|
|
|
|
export PATH=%{buildroot}%{_bindir}:$PATH
|
|
|
|
# checks ignored, as they require podman
|
|
|
|
# https://github.com/ansible/ansible-builder/issues/534
|
|
|
|
IGNORED_CHECKS="test_v3_pre_post_commands"
|
|
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_v3_complete"
|
|
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_ansible_check_is_skipped"
|
|
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_missing_ansible"
|
|
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_missing_runner"
|
|
|
|
%pytest -k "not (${IGNORED_CHECKS})"
|
|
|
|
|
2023-03-16 15:36:26 +01:00
|
|
|
%files
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE.md
|
|
|
|
%{_bindir}/ansible-builder
|
|
|
|
%{ansible_python_sitelib}/ansible_builder
|
|
|
|
%{ansible_python_sitelib}/ansible_builder-*-info
|
|
|
|
|
|
|
|
%changelog
|