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
c4427d
%global commitId c1bb0c6ab89a344bdcc07ef66887c310e661e3a6
c4427d
%global python39_sitelib /usr/lib/python3.9/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
c4427d
%define vendor_path %{buildroot}%{python39_sitelib}/ansible/_vendor/
c4427d
%define vendor_pip /usr/bin/python3.9 -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
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
%global straightplugin_version 1.4.1
c5d710
c5d710
c5d710
Name: ansible-core
c5d710
Summary: SSH-based configuration management, deployment, and task execution system
c4427d
Version: 2.13.3
c4427d
Release: 1%{?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
c4427d
Source2: jinja2-b08cd4bc64bb980df86ed2876978ae5735572280.tar.gz
c4427d
Source3: markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f.tar.gz
c4427d
Source4: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz
c4427d
Source5: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz
c4427d
Source6: resolvelib-d935f9fd07246d9641436c7a8e6ae39423374e28.tar.gz
c5d710
c5d710
# Deps to build man pages
c4427d
Source7: straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz
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
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}
c5d710
Provides: bundled(python-straightplugin) = %{straightplugin_version}
c5d710
c4427d
BuildRequires: python3-docutils
c4427d
BuildRequires: python39-devel
c4427d
BuildRequires: python39-pip
c4427d
BuildRequires: python39-pyyaml
c4427d
BuildRequires: python39-rpm-macros
c4427d
BuildRequires: python39-setuptools
c4427d
BuildRequires: python39-wheel
c4427d
BuildRequires: make git-core gcc
c4427d
c4427d
Requires: git-core
c4427d
Requires: python39
c4427d
Requires: python39-PyYAML >= 5.1
c4427d
Requires: python39-cryptography
c4427d
Requires: python39-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
c4427d
%setup -q -T -b 2 -n jinja2-b08cd4bc64bb980df86ed2876978ae5735572280
c4427d
%setup -q -T -b 3 -n markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f
c4427d
%setup -q -T -b 4 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831
c4427d
%setup -q -T -b 5 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605
c4427d
%setup -q -T -b 6 -n resolvelib-d935f9fd07246d9641436c7a8e6ae39423374e28
c4427d
%setup -q -T -b 7 -n straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed
c5d710
%setup -q -n ansible-%{commitId}
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
c4427d
pathfix3.9.py -pni "%{__python3} %{py3_shbang_opts}" test/lib/ansible_test
c5d710
c5d710
%build
c4427d
/usr/bin/python3.9 setup.py build
c5d710
c5d710
%install
c4427d
/usr/bin/python3.9 setup.py install --root %{buildroot}
c5d710
c5d710
# Handle bundled deps:
c5d710
%{vendor_pip} \
c4427d
  ../jinja2-b08cd4bc64bb980df86ed2876978ae5735572280/ \
c4427d
  ../markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f/ \
c4427d
  ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/ \
c5d710
  ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ \
c4427d
  ../resolvelib-d935f9fd07246d9641436c7a8e6ae39423374e28
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
c4427d
c4427d
mkdir /tmp/_vendor
c4427d
/usr/bin/python3.9 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation
c4427d
c4427d
# Remove plugins not needed, they bring in more dependencies
c4427d
find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} +
c4427d
c4427d
PYTHON=python3.9 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs
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
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/
c4427d
%{python39_sitelib}/ansible*
c4427d
%exclude %{python39_sitelib}/ansible_test
c4427d
%exclude %{python39_sitelib}/ansible/_vendor/markupsafe/_speedups.c
c5d710
c5d710
%files -n ansible-test
c5d710
%{_bindir}/ansible-test
c4427d
%{python39_sitelib}/ansible_test
c5d710
c5d710
%changelog
c4427d
* Wed 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