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