818ff8
%global __python3 /usr/bin/python3.11
818ff8
%global python3_pkgversion 3.11
818ff8
799a8c
# We need this because we are no longer noarch, since our bundled deps might
799a8c
# conceivably need to compile arch-specific things. But we currently have no
799a8c
# useful debuginfo stuff.
799a8c
%global debug_package %{nil}
799a8c
799a8c
# Disable shebang munging for specific paths.  These files are data files.
799a8c
# ansible-test munges the shebangs itself.
799a8c
%global __brp_mangle_shebangs_exclude_from_file %{SOURCE1}
799a8c
799a8c
# RHEL and Fedora add -s to the shebang line.  We do *not* use -s -E -S or -I
799a8c
# with ansible because it has many optional features which users need to
799a8c
# install libraries on their own to use.  For instance, paramiko for the
799a8c
# network connection plugins or winrm to talk to windows hosts.
799a8c
# Set this to nil to remove -s
799a8c
%define py_shbang_opts %{nil}
799a8c
%define py2_shbang_opts %{nil}
799a8c
%define py3_shbang_opts %{nil}
799a8c
818ff8
%define vendor_path %{buildroot}%{python3_sitelib}/ansible/_vendor/
818ff8
%define vendor_pip %{__python3} -m pip install --no-deps -v --no-build-isolation --no-binary :all: -t %{vendor_path}
799a8c
799a8c
# These control which bundled dep versions we pin against
64cfa8
%global jinja2_version 3.1.2
64cfa8
%global markupsafe_version 2.1.0
799a8c
%global packaging_version 20.4
799a8c
%global pyparsing_version 2.4.7
818ff8
%global resolvelib_version 0.5.4
799a8c
799a8c
799a8c
Name: ansible-core
799a8c
Summary: SSH-based configuration management, deployment, and task execution system
818ff8
Version: 2.14.2
818ff8
Release: 4%{?dist}
799a8c
799a8c
Group: Development/Libraries
799a8c
License: GPLv3+
818ff8
Source0: https://files.pythonhosted.org/packages/source/a/ansible-core/ansible-core-%{version}.tar.gz
799a8c
Source1: ansible-test-data-files.txt
799a8c
799a8c
# And bundled deps
818ff8
Source2: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{jinja2_version}.tar.gz
818ff8
Source3: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{markupsafe_version}.tar.gz
818ff8
Source4: https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{packaging_version}.tar.gz
818ff8
Source5: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{pyparsing_version}.tar.gz
818ff8
Source6: https://files.pythonhosted.org/packages/source/r/resolvelib/resolvelib-%{resolvelib_version}.tar.gz
799a8c
818ff8
Patch0: remove-bundled-deps-from-requirements.patch
799a8c
799a8c
URL: http://ansible.com
799a8c
799a8c
# We obsolete old ansible, and any version of ansible-base.
799a8c
Obsoletes: ansible < 2.10.0
818ff8
Obsoletes: ansible-base < 2.11.0
799a8c
799a8c
# ... and provide 'ansible' so that old packages still work without updated
799a8c
# spec files.
b33e92
# Provides: ansible
799a8c
799a8c
# Bundled provides that are sprinkled throughout the codebase.
799a8c
Provides: bundled(python-backports-ssl_match_hostname) = 3.7.0.1
64cfa8
Provides: bundled(python-distro) = 1.6.0
799a8c
Provides: bundled(python-selectors2) = 1.1.1
64cfa8
Provides: bundled(python-six) = 1.16.0
799a8c
799a8c
# Things we explicitly bundle via src rpm, and put in ansible._vendor
64cfa8
Provides: bundled(python-jinja2) = %{jinja2_version}
64cfa8
Provides: bundled(python-markupsafe) = %{markupsafe_version}
799a8c
Provides: bundled(python-packaging) = %{packaging_version}
799a8c
Provides: bundled(python-pyparsing) = %{pyparsing_version}
818ff8
Provides: bundled(python-resolvelib) = %{resolvelib_version}
818ff8
818ff8
BuildRequires: python%{python3_pkgversion}-devel
818ff8
BuildRequires: python%{python3_pkgversion}-pip
818ff8
BuildRequires: python%{python3_pkgversion}-pyyaml
818ff8
BuildRequires: python%{python3_pkgversion}-rpm-macros
818ff8
BuildRequires: python%{python3_pkgversion}-setuptools
818ff8
BuildRequires: python%{python3_pkgversion}-wheel
64cfa8
BuildRequires: make git-core gcc
799a8c
64cfa8
Requires: git-core
818ff8
Requires: python%{python3_pkgversion}-PyYAML >= 5.1
818ff8
Requires: python%{python3_pkgversion}-cryptography
818ff8
Requires: python%{python3_pkgversion}-six
799a8c
Requires: sshpass
799a8c
799a8c
%description
799a8c
Ansible is a radically simple model-driven configuration management,
799a8c
multi-node deployment, and remote task execution system. Ansible works
799a8c
over SSH and does not require any software or daemons to be installed
799a8c
on remote nodes. Extension modules can be written in any language and
799a8c
are transferred to managed machines automatically.
799a8c
799a8c
%package -n ansible-test
799a8c
Summary: Tool for testing ansible plugin and module code
799a8c
Requires: %{name} = %{version}-%{release}
799a8c
799a8c
%description -n ansible-test
799a8c
Ansible is a radically simple model-driven configuration management,
799a8c
multi-node deployment, and remote task execution system. Ansible works
799a8c
over SSH and does not require any software or daemons to be installed
799a8c
on remote nodes. Extension modules can be written in any language and
799a8c
are transferred to managed machines automatically.
799a8c
799a8c
This package installs the ansible-test command for testing modules and plugins
799a8c
developed for ansible.
799a8c
799a8c
%prep
818ff8
%setup -q -b2 -b3 -b4 -b5 -b6 -n ansible-core-%{version}
818ff8
%patch0 -p1
818ff8
818ff8
# Fix all Python shebangs recursively in ansible-test
818ff8
%{py3_shebang_fix} test/lib/ansible_test
799a8c
799a8c
%build
818ff8
%{py3_build}
799a8c
799a8c
%install
818ff8
%{py3_install}
799a8c
799a8c
# Handle bundled deps:
799a8c
%{vendor_pip} \
818ff8
  ../Jinja2-%{jinja2_version}/ \
818ff8
  ../MarkupSafe-%{markupsafe_version}/ \
818ff8
  ../packaging-%{packaging_version}/ \
818ff8
  ../pyparsing-%{pyparsing_version}/ \
818ff8
  ../resolvelib-%{resolvelib_version}
799a8c
799a8c
# Create system directories that Ansible defines as default locations in
799a8c
# ansible/config/base.yml
799a8c
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
799a8c
%{_datadir}/ansible/plugins/doc_fragments
799a8c
%{_datadir}/ansible/plugins/action
799a8c
%{_datadir}/ansible/plugins/become
799a8c
%{_datadir}/ansible/plugins/cache
799a8c
%{_datadir}/ansible/plugins/callback
799a8c
%{_datadir}/ansible/plugins/cliconf
799a8c
%{_datadir}/ansible/plugins/connection
799a8c
%{_datadir}/ansible/plugins/filter
799a8c
%{_datadir}/ansible/plugins/httpapi
799a8c
%{_datadir}/ansible/plugins/inventory
799a8c
%{_datadir}/ansible/plugins/lookup
799a8c
%{_datadir}/ansible/plugins/modules
799a8c
%{_datadir}/ansible/plugins/module_utils
799a8c
%{_datadir}/ansible/plugins/netconf
799a8c
%{_datadir}/ansible/roles
799a8c
%{_datadir}/ansible/plugins/strategy
799a8c
%{_datadir}/ansible/plugins/terminal
799a8c
%{_datadir}/ansible/plugins/test
799a8c
%{_datadir}/ansible/plugins/vars'
799a8c
799a8c
UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml | tr ':' '\n' | grep '/usr/share/ansible')
799a8c
799a8c
if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
799a8c
	echo "The upstream Ansible datadir locations have changed.  Spec file needs to be updated"
799a8c
	exit 1
799a8c
fi
799a8c
799a8c
mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
799a8c
for location in $DATADIR_LOCATIONS ; do
799a8c
	mkdir %{buildroot}"$location"
799a8c
done
799a8c
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
799a8c
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
799a8c
799a8c
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
799a8c
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
799a8c
mkdir -p %{buildroot}/%{_mandir}/man1/
799a8c
799a8c
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
799a8c
799a8c
cp -pr docs/docsite/rst .
799a8c
cp -p lib/ansible_core.egg-info/PKG-INFO .
799a8c
818ff8
strip --strip-unneeded %{vendor_path}/markupsafe/_speedups%{python3_ext_suffix}
818ff8
799a8c
%files
799a8c
%defattr(-,root,root)
799a8c
%{_bindir}/ansible*
799a8c
%exclude %{_bindir}/ansible-test
799a8c
%config(noreplace) %{_sysconfdir}/ansible/
799a8c
%doc README.rst PKG-INFO COPYING
799a8c
%doc changelogs/CHANGELOG-v2.*.rst
799a8c
%doc %{_mandir}/man1/ansible*
799a8c
%{_datadir}/ansible/
818ff8
%{python3_sitelib}/ansible*
818ff8
%exclude %{python3_sitelib}/ansible_test
818ff8
%exclude %{python3_sitelib}/ansible/_vendor/markupsafe/_speedups.c
799a8c
799a8c
%files -n ansible-test
799a8c
%{_bindir}/ansible-test
818ff8
%{python3_sitelib}/ansible_test
818ff8
799a8c
799a8c
%changelog
818ff8
* Mon Feb 13 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-4
818ff8
- rebuild with python 3.11 (rhbz#2169466)
818ff8
- remove bundled dependencies from requirements file (rhbz#2152615)
818ff8
- add bundled version of resolvelib
818ff8
- use PyPi sources
818ff8
- remove straightplugin
818ff8
- add missing obsoletes constraint
818ff8
818ff8
* Wed Feb 01 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-3
818ff8
- fix debuginfo symbols from markupsafe dependency (rhbz#2166433)
818ff8
818ff8
* Wed Feb 01 2023 Christian Adams <chadams@redhat.com> - 2.14.2-2
818ff8
- fix bogus date in changelog (rhbz#2165763)
818ff8
818ff8
* Tue Jan 31 2023 Christian Adams <chadams@redhat.com> - 2.14.2-1
818ff8
- ansible-core 2.14.2 release (rhbz#2165763)
818ff8
818ff8
* Wed Dec 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.1-1
818ff8
- ansible-core 2.14.1 release (rhbz#2151593)
818ff8
818ff8
* Tue Nov 08 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.0-1
818ff8
- ansible-core 2.14.0 release (rhbz#2141116)
818ff8
818ff8
* Mon Nov 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.6-1
818ff8
- ansible-core 2.13.6 release (rhbz#2140778)
818ff8
- fix service_facts module parsing (rhbz#2128801)
818ff8
818ff8
* Tue Oct 11 2022 James Marshall <jamarsha@redhat.com> - 2.13.5-1
818ff8
- ansible-core 2.13.5 release (rhbz#2133912)
818ff8
818ff8
* Thu Oct 06 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.4-1
818ff8
- ansible-core 2.13.4 release (rhbz#2132807)
818ff8
64cfa8
* Mon Aug 15 2022 James Marshall <jamarsha@redhat.com> - 2.13.3-1
64cfa8
- ansible-core 2.13.3 release (rhbz#2118458)
64cfa8
64cfa8
* Mon Jul 18 2022 James Marshall <jamarsha@redhat.com> - 2.13.2-1
64cfa8
- ansible-core 2.13.2 release (rhbz#2108229)
64cfa8
64cfa8
* Mon Jun 27 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-2
64cfa8
- Update bundled jinja2 version to 3.1.2 (rhbz#2101462)
64cfa8
64cfa8
* Wed Jun 22 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-1
64cfa8
- ansible-core 2.13.1 release (rhbz#2100242)
64cfa8
- add bundled version of jinja2 and markupsafe
64cfa8
64cfa8
* Mon Jun 20 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.7-1
64cfa8
- ansible-core 2.12.7 release (rhbz#2099317)
64cfa8
- remove legacy nightly configuration
64cfa8
64cfa8
* Tue May 24 2022 James Marshall <jamarsha@redhat.com> - 2.12.6-1
64cfa8
- ansible-core 2.12.6 release
64cfa8
64cfa8
* Fri May 13 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.5-2
64cfa8
- switch from git to git-core dependency (rhbz#2083386)
64cfa8
64cfa8
* Mon May 09 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.5-1
64cfa8
- ansible-core 2.12.5 release
64cfa8
64cfa8
* Wed Apr 06 2022 James Marshall <jamarsha@redhat.com> - 2.12.4-1
64cfa8
- ansible-core 2.12.4 release
64cfa8
64cfa8
* Mon Mar 14 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.3-1
64cfa8
- ansible-core 2.12.3 release
64cfa8
3f4f4a
* Tue Feb 01 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-1
3f4f4a
- ansible-core 2.12.2 release
3f4f4a
48294d
* Tue Dec 07 2021 James Marshall <jamarsha@redhat.com> - 2.12.1-1
48294d
- ansible-core 2.12.1-1
48294d
b33e92
* Mon Nov 08 2021 Dimitri Savineau <dsavinea@redhat.com> - 2.12.0-1
b33e92
- ansible-core 2.12.0-1
b33e92
b33e92
* Tue Oct 12 2021 Christian Adams <chadams@redhat.com> - 2.11.6-1
b33e92
- ansible-core 2.11.6-1, fix CVE-2021-3620, ansible-connection module
b33e92
  no long discloses sensitive info.
b33e92
b33e92
* Wed Oct 06 2021 Yanis Guenane <yguenane@redhat.com> - 2.11.5-3
b33e92
- ansible-core 2.11.5-3, add virtual provide for straightplugin
b33e92
b33e92
* Wed Sep 15 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.5-2
b33e92
- ansible-core 2.11.5-2
b33e92
b33e92
* Mon Sep 13 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.3-3
b33e92
- Bump for build
b33e92
799a8c
* Wed Jul 21 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.3-2
799a8c
- Add git dependency for ansible-galaxy CLI command.
799a8c
799a8c
* Tue Jul 20 2021 Yanis Guenane <yguenane@redhat.com> - 2.11.3-1
799a8c
- ansible-core 2.11.3-1
799a8c
799a8c
* Fri Jul 02 2021 Satoe Imaishi <simaishi@redhat.com> - 2.11.2-2
799a8c
- Add man pages
799a8c
799a8c
* Tue Jun 29 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.2-1
799a8c
- ansible-core 2.11.2 released.
799a8c
- Drop bundled version of resolvelib in favor of
799a8c
  python38-resolvelib.
799a8c
799a8c
* Wed Mar 31 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b4-1
799a8c
- ansible-core 2.11.0 beta 4
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-3
799a8c
- Try adding a Provides for old ansible.
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-2
799a8c
- Try Obsoletes instead of Conflicts.
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-1
799a8c
- ansible-core 2.11.0 beta 2
799a8c
- Conflict with old ansible and ansible-base.
799a8c
799a8c
* Thu Mar 11 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b1-1
799a8c
- ansible-core 2.11.0 beta 1
799a8c
799a8c
* Mon Nov 30 2020 Rick Elrod <relrod@redhat.com> - 2.11.0-1
799a8c
- ansible-core, beta
799a8c
799a8c
* Wed Jun 10 2020 Rick Elrod <relrod@redhat.com> - 2.10.0-1
799a8c
- ansible-base, beta