Blame SPECS/ansible-core.spec

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
%global commitId 6c75cf5c83da044d1fd69bc444ce4de50d728d09
c5d710
%global python38_sitelib /usr/lib/python3.8/site-packages/
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
c5d710
%define vendor_path %{buildroot}%{python38_sitelib}/ansible/_vendor/
c5d710
%define vendor_pip /usr/bin/python3.8 -m pip install --no-deps -v --no-use-pep517 --no-binary :all: -t %{vendor_path}
c5d710
c5d710
# These control which bundled dep versions we pin against
c5d710
%global packaging_version 20.4
c5d710
%global pyparsing_version 2.4.7
c5d710
%global straightplugin_version 1.4.1
c5d710
c5d710
c5d710
Name: ansible-core
c5d710
Summary: SSH-based configuration management, deployment, and task execution system
c5d710
Version: 2.12.2
04d592
Release: 4%{?dist}
c5d710
ExcludeArch: i686
c5d710
c5d710
Group: Development/Libraries
c5d710
License: GPLv3+
c5d710
Source0: ansible-%{commitId}.tar.gz
c5d710
Source1: ansible-test-data-files.txt
c5d710
c5d710
# And bundled deps
c5d710
Source2: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz
c5d710
Source3: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz
c5d710
c5d710
# Deps to build man pages
c5d710
Source5: straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz
c5d710
04d592
Patch0: 0001-Fix-final-fact-delegation-77008-77017.patch
04d592
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
c5d710
Provides: bundled(python-distro) = 1.5.0
c5d710
Provides: bundled(python-selectors2) = 1.1.1
c5d710
Provides: bundled(python-six) = 1.13.0
c5d710
c5d710
# Things we explicitly bundle via src rpm, and put in ansible._vendor
c5d710
Provides: bundled(python-packaging) = %{packaging_version}
c5d710
Provides: bundled(python-pyparsing) = %{pyparsing_version}
c5d710
Provides: bundled(python-straightplugin) = %{straightplugin_version}
c5d710
c5d710
BuildRequires: python38-devel
c5d710
# BuildRequires: python38-docutils
c5d710
BuildRequires: python38-jinja2
c5d710
BuildRequires: python38-pip
c5d710
BuildRequires: python38-pyyaml
c5d710
BuildRequires: python38-resolvelib
c5d710
BuildRequires: python38-rpm-macros
c5d710
BuildRequires: python38-setuptools
c5d710
BuildRequires: python38-wheel
c5d710
c5d710
Requires: git
c5d710
Requires: python38
c5d710
Requires: python38-jinja2
c5d710
Requires: python38-PyYAML
c5d710
Requires: python38-cryptography
c5d710
Requires: python38-resolvelib
c5d710
Requires: python38-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
c5d710
%setup -q -T -b 2 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831
c5d710
%setup -q -T -b 3 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605
c5d710
%setup -q -T -b 5 -n straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed
c5d710
%setup -q -n ansible-%{commitId}
04d592
%patch0 -p 1
c5d710
c5d710
# Fix all Python shebangs recursively in ansible-test
c5d710
# -p preserves timestamps
c5d710
# -n prevents creating ~backup files
c5d710
# -i specifies the interpreter for the shebang
c5d710
pathfix3.8.py -pni "%{__python3} %{py3_shbang_opts}" test/lib/ansible_test
c5d710
c5d710
%build
c5d710
/usr/bin/python3.8 setup.py build
c5d710
c5d710
%install
c5d710
/usr/bin/python3.8 setup.py install --root %{buildroot}
c5d710
c5d710
# Handle bundled deps:
c5d710
%{vendor_pip} \
c5d710
  ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ \
c5d710
  ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/
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/
c5d710
## Build man pages
c5d710
#
c5d710
#mkdir /tmp/_vendor
c5d710
#/usr/bin/python3.8 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation
c5d710
#
c5d710
## Remove plugins not needed, they bring in more dependencies
c5d710
#find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} +
c5d710
#
c5d710
#PYTHON=python3.8 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs
c5d710
#cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
c5d710
#
c5d710
#cp -pr docs/docsite/rst .
c5d710
cp -p lib/ansible_core.egg-info/PKG-INFO .
c5d710
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
c5d710
# TODO(pabelanger): uncomment once we move back to tagged releases
c5d710
# %doc changelogs/CHANGELOG-v2.*.rst
c5d710
#%doc %{_mandir}/man1/ansible*
c5d710
%{_datadir}/ansible/
c5d710
%{python38_sitelib}/ansible*
c5d710
%exclude %{python38_sitelib}/ansible_test
c5d710
c5d710
%files -n ansible-test
c5d710
%{_bindir}/ansible-test
c5d710
%{python38_sitelib}/ansible_test
c5d710
c5d710
%changelog
04d592
* Tue Jul 19 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-4
04d592
- fix facts delegation loop overwrite (rhbz#2109263)
04d592
c5d710
* Thu Mar 10 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-3.1
c5d710
- Rebuilt for rhel-8.6
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