Blame SPECS/ansible-core.spec

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