gotmax23 / rpms / ansible-core

Forked from rpms/ansible-core 2 years ago
Clone

Blame SPECS/ansible-core.spec

799a8c
# Is this a nightly build?
799a8c
%global nightly 0
799a8c
799a8c
# We need this because we are no longer noarch, since our bundled deps might
799a8c
# conceivably need to compile arch-specific things. But we currently have no
799a8c
# useful debuginfo stuff.
799a8c
%global debug_package %{nil}
799a8c
799a8c
%if 0%{?nightly}
799a8c
%global snap %(date +'%Y%m%d')git
799a8c
%global nightly_pretag .dev0
799a8c
%endif
799a8c
799a8c
# Disable shebang munging for specific paths.  These files are data files.
799a8c
# ansible-test munges the shebangs itself.
799a8c
%global __brp_mangle_shebangs_exclude_from_file %{SOURCE1}
799a8c
b33e92
%global commitId cb779ee9bb0909dc87dc339da102f98936c1c178
799a8c
%global python39_sitelib /usr/lib/python3.9/site-packages/
799a8c
799a8c
# RHEL and Fedora add -s to the shebang line.  We do *not* use -s -E -S or -I
799a8c
# with ansible because it has many optional features which users need to
799a8c
# install libraries on their own to use.  For instance, paramiko for the
799a8c
# network connection plugins or winrm to talk to windows hosts.
799a8c
# Set this to nil to remove -s
799a8c
%define py_shbang_opts %{nil}
799a8c
%define py2_shbang_opts %{nil}
799a8c
%define py3_shbang_opts %{nil}
799a8c
799a8c
%define vendor_path %{buildroot}%{python39_sitelib}/ansible/_vendor/
799a8c
%define vendor_pip /usr/bin/python3.9 -m pip install --no-deps -v --no-use-pep517 --no-binary :all: -t %{vendor_path}
799a8c
799a8c
# These control which bundled dep versions we pin against
799a8c
%global packaging_version 20.4
799a8c
%global pyparsing_version 2.4.7
b33e92
%global straightplugin_version 1.4.1
799a8c
799a8c
799a8c
Name: ansible-core
799a8c
Summary: SSH-based configuration management, deployment, and task execution system
b33e92
Version: 2.12.0
799a8c
%if 0%{?nightly}
799a8c
Release: 0.1.%{snap}%{?dist}
799a8c
%else
b33e92
Release: 1%{?dist}
799a8c
%endif
799a8c
799a8c
Group: Development/Libraries
799a8c
License: GPLv3+
799a8c
%if 0%{?nightly}
799a8c
Source0: %{name}-%{version}%{nightly_pretag}.tar.gz
799a8c
%else
b33e92
Source0: ansible-%{commitId}.tar.gz
799a8c
%endif
799a8c
Source1: ansible-test-data-files.txt
799a8c
799a8c
# And bundled deps
799a8c
Source2: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz
799a8c
Source3: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz
799a8c
799a8c
# Deps to build man pages
799a8c
Source5: straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz
799a8c
799a8c
URL: http://ansible.com
799a8c
799a8c
# We obsolete old ansible, and any version of ansible-base.
799a8c
Obsoletes: ansible < 2.10.0
799a8c
Obsoletes: ansible-base
799a8c
799a8c
# ... and provide 'ansible' so that old packages still work without updated
799a8c
# spec files.
b33e92
# Provides: ansible
799a8c
799a8c
# Bundled provides that are sprinkled throughout the codebase.
799a8c
Provides: bundled(python-backports-ssl_match_hostname) = 3.7.0.1
799a8c
Provides: bundled(python-distro) = 1.5.0
799a8c
Provides: bundled(python-selectors2) = 1.1.1
799a8c
Provides: bundled(python-six) = 1.13.0
799a8c
799a8c
# Things we explicitly bundle via src rpm, and put in ansible._vendor
799a8c
Provides: bundled(python-packaging) = %{packaging_version}
799a8c
Provides: bundled(python-pyparsing) = %{pyparsing_version}
b33e92
Provides: bundled(python-straightplugin) = %{straightplugin_version}
799a8c
799a8c
BuildRequires: python3-devel
799a8c
BuildRequires: python3-docutils
799a8c
BuildRequires: python3-jinja2
799a8c
BuildRequires: python3-pip
799a8c
BuildRequires: python3-pyyaml
799a8c
BuildRequires: python3-resolvelib
799a8c
BuildRequires: python3-rpm-macros
799a8c
BuildRequires: python3-setuptools
799a8c
BuildRequires: python3-wheel
b33e92
BuildRequires: make git-core
799a8c
799a8c
Requires: git
799a8c
Requires: python3
799a8c
Requires: python3-jinja2
799a8c
Requires: python3-PyYAML
799a8c
Requires: python3-cryptography
799a8c
Requires: python3-resolvelib
799a8c
Requires: python3-six
799a8c
Requires: sshpass
799a8c
799a8c
%description
799a8c
Ansible is a radically simple model-driven configuration management,
799a8c
multi-node deployment, and remote task execution system. Ansible works
799a8c
over SSH and does not require any software or daemons to be installed
799a8c
on remote nodes. Extension modules can be written in any language and
799a8c
are transferred to managed machines automatically.
799a8c
799a8c
%package -n ansible-test
799a8c
Summary: Tool for testing ansible plugin and module code
799a8c
Requires: %{name} = %{version}-%{release}
799a8c
799a8c
%description -n ansible-test
799a8c
Ansible is a radically simple model-driven configuration management,
799a8c
multi-node deployment, and remote task execution system. Ansible works
799a8c
over SSH and does not require any software or daemons to be installed
799a8c
on remote nodes. Extension modules can be written in any language and
799a8c
are transferred to managed machines automatically.
799a8c
799a8c
This package installs the ansible-test command for testing modules and plugins
799a8c
developed for ansible.
799a8c
799a8c
%prep
799a8c
%setup -q -T -b 2 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831
799a8c
%setup -q -T -b 3 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605
799a8c
%setup -q -T -b 5 -n straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed
799a8c
%setup -q -n ansible-%{commitId}
799a8c
799a8c
%build
799a8c
/usr/bin/python3.9 setup.py build
799a8c
799a8c
%install
799a8c
/usr/bin/python3.9 setup.py install --root %{buildroot}
799a8c
799a8c
# Handle bundled deps:
799a8c
%{vendor_pip} \
799a8c
  ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ \
799a8c
  ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/
799a8c
799a8c
# Create system directories that Ansible defines as default locations in
799a8c
# ansible/config/base.yml
799a8c
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
799a8c
%{_datadir}/ansible/plugins/doc_fragments
799a8c
%{_datadir}/ansible/plugins/action
799a8c
%{_datadir}/ansible/plugins/become
799a8c
%{_datadir}/ansible/plugins/cache
799a8c
%{_datadir}/ansible/plugins/callback
799a8c
%{_datadir}/ansible/plugins/cliconf
799a8c
%{_datadir}/ansible/plugins/connection
799a8c
%{_datadir}/ansible/plugins/filter
799a8c
%{_datadir}/ansible/plugins/httpapi
799a8c
%{_datadir}/ansible/plugins/inventory
799a8c
%{_datadir}/ansible/plugins/lookup
799a8c
%{_datadir}/ansible/plugins/modules
799a8c
%{_datadir}/ansible/plugins/module_utils
799a8c
%{_datadir}/ansible/plugins/netconf
799a8c
%{_datadir}/ansible/roles
799a8c
%{_datadir}/ansible/plugins/strategy
799a8c
%{_datadir}/ansible/plugins/terminal
799a8c
%{_datadir}/ansible/plugins/test
799a8c
%{_datadir}/ansible/plugins/vars'
799a8c
799a8c
UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml | tr ':' '\n' | grep '/usr/share/ansible')
799a8c
799a8c
if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
799a8c
	echo "The upstream Ansible datadir locations have changed.  Spec file needs to be updated"
799a8c
	exit 1
799a8c
fi
799a8c
799a8c
mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
799a8c
for location in $DATADIR_LOCATIONS ; do
799a8c
	mkdir %{buildroot}"$location"
799a8c
done
799a8c
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
799a8c
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
799a8c
799a8c
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
799a8c
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
799a8c
mkdir -p %{buildroot}/%{_mandir}/man1/
799a8c
# Build man pages
799a8c
799a8c
mkdir /tmp/_vendor
799a8c
/usr/bin/python3.9 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation
799a8c
799a8c
# Remove plugins not needed, they bring in more dependencies
799a8c
find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} +
799a8c
799a8c
PYTHON=python3.9 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs
799a8c
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
799a8c
799a8c
cp -pr docs/docsite/rst .
799a8c
cp -p lib/ansible_core.egg-info/PKG-INFO .
799a8c
799a8c
%files
799a8c
%defattr(-,root,root)
799a8c
%{_bindir}/ansible*
799a8c
%exclude %{_bindir}/ansible-test
799a8c
%config(noreplace) %{_sysconfdir}/ansible/
799a8c
%doc README.rst PKG-INFO COPYING
799a8c
%doc changelogs/CHANGELOG-v2.*.rst
799a8c
%doc %{_mandir}/man1/ansible*
799a8c
%{_datadir}/ansible/
799a8c
%{python39_sitelib}/ansible*
799a8c
%exclude %{python39_sitelib}/ansible_test
799a8c
799a8c
%files -n ansible-test
799a8c
%{_bindir}/ansible-test
799a8c
%{python39_sitelib}/ansible_test
799a8c
799a8c
%changelog
b33e92
* Mon Nov 08 2021 Dimitri Savineau <dsavinea@redhat.com> - 2.12.0-1
b33e92
- ansible-core 2.12.0-1
b33e92
b33e92
* Tue Oct 12 2021 Christian Adams <chadams@redhat.com> - 2.11.6-1
b33e92
- ansible-core 2.11.6-1, fix CVE-2021-3620, ansible-connection module
b33e92
  no long discloses sensitive info.
b33e92
b33e92
* Wed Oct 06 2021 Yanis Guenane <yguenane@redhat.com> - 2.11.5-3
b33e92
- ansible-core 2.11.5-3, add virtual provide for straightplugin
b33e92
b33e92
* Wed Sep 15 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.5-2
b33e92
- ansible-core 2.11.5-2
b33e92
b33e92
* Mon Sep 13 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.3-3
b33e92
- Bump for build
b33e92
799a8c
* Wed Jul 21 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.3-2
799a8c
- Add git dependency for ansible-galaxy CLI command.
799a8c
799a8c
* Tue Jul 20 2021 Yanis Guenane <yguenane@redhat.com> - 2.11.3-1
799a8c
- ansible-core 2.11.3-1
799a8c
799a8c
* Fri Jul 02 2021 Satoe Imaishi <simaishi@redhat.com> - 2.11.2-2
799a8c
- Add man pages
799a8c
799a8c
* Tue Jun 29 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.2-1
799a8c
- ansible-core 2.11.2 released.
799a8c
- Drop bundled version of resolvelib in favor of
799a8c
  python38-resolvelib.
799a8c
799a8c
* Wed Mar 31 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b4-1
799a8c
- ansible-core 2.11.0 beta 4
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-3
799a8c
- Try adding a Provides for old ansible.
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-2
799a8c
- Try Obsoletes instead of Conflicts.
799a8c
799a8c
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-1
799a8c
- ansible-core 2.11.0 beta 2
799a8c
- Conflict with old ansible and ansible-base.
799a8c
799a8c
* Thu Mar 11 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b1-1
799a8c
- ansible-core 2.11.0 beta 1
799a8c
799a8c
* Mon Nov 30 2020 Rick Elrod <relrod@redhat.com> - 2.11.0-1
799a8c
- ansible-core, beta
799a8c
799a8c
* Wed Jun 10 2020 Rick Elrod <relrod@redhat.com> - 2.10.0-1
799a8c
- ansible-base, beta