gotmax23 / rpms / ansible-core

Forked from rpms/ansible-core 2 years ago
Clone

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
6f8f29
%global commitId 50b9f08db6b1a2e30eef1249452c0da33056015e
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
6f8f29
Version: 2.12.1
6f8f29
Release: 1%{?dist}
6f8f29
ExcludeArch: i686
6f8f29
6f8f29
Group: Development/Libraries
6f8f29
License: GPLv3+
6f8f29
Source0: ansible-core-2.12.1.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
6f8f29
# We obsolete old ansible, and any version of ansible-base.
6f8f29
Obsoletes: ansible < 2.10.0
6f8f29
Obsoletes: ansible-base
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
6f8f29
BuildRequires: python38-devel
6f8f29
# BuildRequires: python38-docutils
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
6f8f29
6f8f29
Requires: git
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
6f8f29
%setup -q -n ansible-core-2.12.1
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
6f8f29
#
6f8f29
#mkdir /tmp/_vendor
6f8f29
#/usr/bin/python3.8 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation
6f8f29
#
6f8f29
## Remove plugins not needed, they bring in more dependencies
6f8f29
#find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} +
6f8f29
#
6f8f29
#PYTHON=python3.8 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs
6f8f29
#cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
6f8f29
#
6f8f29
#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
6f8f29
# TODO(pabelanger): uncomment once we move back to tagged releases
6f8f29
# %doc changelogs/CHANGELOG-v2.*.rst
6f8f29
#%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
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