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
660e21
%global commitId a1683d3dab164afdfe1bedc8dab296564b7a47e5
6f8f29
%global python38_sitelib /usr/lib/python3.8/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
6f8f29
%define vendor_path %{buildroot}%{python38_sitelib}/ansible/_vendor/
6f8f29
%define vendor_pip /usr/bin/python3.8 -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
6f8f29
%global packaging_version 20.4
6f8f29
%global pyparsing_version 2.4.7
6f8f29
%global straightplugin_version 1.4.1
6f8f29
6f8f29
6f8f29
Name: ansible-core
6f8f29
Summary: SSH-based configuration management, deployment, and task execution system
660e21
Version: 2.12.6
b5d1d1
Release: 3%{?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
6f8f29
Source2: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz
6f8f29
Source3: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz
6f8f29
6f8f29
# Deps to build man pages
6f8f29
Source5: 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
6f8f29
Provides: bundled(python-distro) = 1.5.0
6f8f29
Provides: bundled(python-selectors2) = 1.1.1
6f8f29
Provides: bundled(python-six) = 1.13.0
6f8f29
6f8f29
# Things we explicitly bundle via src rpm, and put in ansible._vendor
6f8f29
Provides: bundled(python-packaging) = %{packaging_version}
6f8f29
Provides: bundled(python-pyparsing) = %{pyparsing_version}
6f8f29
Provides: bundled(python-straightplugin) = %{straightplugin_version}
6f8f29
b5d1d1
BuildRequires: python3-docutils
6f8f29
BuildRequires: python38-devel
6f8f29
BuildRequires: python38-jinja2
6f8f29
BuildRequires: python38-pip
6f8f29
BuildRequires: python38-pyyaml
6f8f29
BuildRequires: python38-resolvelib
6f8f29
BuildRequires: python38-rpm-macros
6f8f29
BuildRequires: python38-setuptools
6f8f29
BuildRequires: python38-wheel
b5d1d1
BuildRequires: make git-core
6f8f29
06892c
Requires: git-core
6f8f29
Requires: python38
6f8f29
Requires: python38-jinja2
6f8f29
Requires: python38-PyYAML
6f8f29
Requires: python38-cryptography
6f8f29
Requires: python38-resolvelib
6f8f29
Requires: python38-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
6f8f29
%setup -q -T -b 2 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831
6f8f29
%setup -q -T -b 3 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605
6f8f29
%setup -q -T -b 5 -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
6f8f29
pathfix3.8.py -pni "%{__python3} %{py3_shbang_opts}" test/lib/ansible_test
6f8f29
6f8f29
%build
6f8f29
/usr/bin/python3.8 setup.py build
6f8f29
6f8f29
%install
6f8f29
/usr/bin/python3.8 setup.py install --root %{buildroot}
6f8f29
6f8f29
# Handle bundled deps:
6f8f29
%{vendor_pip} \
6f8f29
  ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ \
6f8f29
  ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/
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
b5d1d1
/usr/bin/python3.8 -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
b5d1d1
PYTHON=python3.8 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/
6f8f29
%{python38_sitelib}/ansible*
6f8f29
%exclude %{python38_sitelib}/ansible_test
6f8f29
6f8f29
%files -n ansible-test
6f8f29
%{_bindir}/ansible-test
6f8f29
%{python38_sitelib}/ansible_test
6f8f29
6f8f29
%changelog
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