Blame SPECS/ansible-core.spec

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