Blame SPECS/ansible-pcp.spec

e08b61
%if 0%{?rhel}
e08b61
%global collection_namespace redhat
e08b61
%global collection_name rhel_metrics
e08b61
%bcond_with ansible
e08b61
%else
e08b61
%global collection_namespace performancecopilot
e08b61
%global collection_name metrics
e08b61
%bcond_without ansible
e08b61
%endif
e08b61
e08b61
Name:             ansible-pcp
e08b61
Version:          2.2.1
e08b61
Release:          1%{?dist}
e08b61
Summary:          Ansible Metric collection for Performance Co-Pilot
e08b61
License:          MIT
e08b61
URL:              %{ansible_collection_url}
e08b61
Source:           https://github.com/performancecopilot/ansible-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
e08b61
e08b61
%if %{with ansible}
e08b61
BuildRequires:    ansible >= 2.9.10
e08b61
BuildRequires:    python3-ansible-lint
e08b61
%endif
e08b61
BuildArch:        noarch
e08b61
e08b61
%description
e08b61
A collection containing roles for Performance Co-Pilot (PCP) and related
e08b61
software such as Redis and Grafana.  The collection is made up of several
e08b61
Ansible roles, including:
e08b61
e08b61
%{collection_namespace}.%{collection_name}.pcp
e08b61
A role for core PCP capabilities, configuring live performance analysis
e08b61
with a large base set of metrics from the kernel and system services, as
e08b61
well as data recording and rule inference.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.redis
e08b61
A role for configuring a local Redis server, suitable for use with a
e08b61
Performance Co-Pilot archive repository (for single or many hosts) and
e08b61
fast, scalable querying of metrics.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.grafana
e08b61
A role for configuring a local Grafana server, providing web frontend
e08b61
visuals for Performance Co-Pilot metrics, both live and historically.
e08b61
Data sources for Vector (live), Redis (historical) and interactive
e08b61
bpftrace (eBPF) scripts can be configured by this role.  The PCP REST
e08b61
API service (from the core pcp role) should be configured in order to
e08b61
use this role.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.bpftrace
e08b61
A role that extends the core PCP role, providing metrics from bpftrace
e08b61
scripts using Linux eBPF facilities.  Configuring authentication of a
e08b61
local user capable of running bpftrace scripts via the PCP agent is a
e08b61
key task of this role.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.elasticsearch
e08b61
A role that extends the core PCP role, providing metrics from a live
e08b61
ElasticSearch instance for PCP analysis or exporting of PCP metric
e08b61
values (and metadata) to ElasticSearch for the indexing and querying
e08b61
of performance data.
e08b61
e08b61
%prep
e08b61
%autosetup
e08b61
mv .yamllint.yml yamllint.yml
e08b61
mv .yamllint_defaults.yml yamllint_defaults.yml
e08b61
%if 0%{?rhel}
e08b61
rm -vr roles/repository tests/*repository* tests/*/*repository* docs/repository
e08b61
%endif
e08b61
rm -vr .github .gitignore .ansible-lint .*.yml
e08b61
sed -i \
e08b61
    -e 's/^name: .*/name: %{collection_name}/g' \
e08b61
    -e 's/^namespace: .*/namespace: %{collection_namespace}/g' \
e08b61
    galaxy.yml
e08b61
find . -name \*.yml -o -name \*.md | while read file; do
e08b61
    sed -i \
e08b61
        -e 's/performancecopilot.metrics/%{collection_namespace}.%{collection_name}/g' \
e08b61
    $file
e08b61
done
e08b61
e08b61
%if %{without ansible}
e08b61
%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}
e08b61
# Empty command. We don't have ansible-galaxy.
e08b61
%define ansible_collection_build() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .
e08b61
# Simply copy everything instead of galaxy-installing the built artifact.
e08b61
%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}/%{collection_name}; (cd %{buildroot}%{ansible_collection_files}/%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz)
e08b61
%endif
e08b61
e08b61
%build
e08b61
%ansible_collection_build
e08b61
e08b61
%install
e08b61
%ansible_collection_install
e08b61
e08b61
%check
e08b61
mv yamllint.yml .yamllint.yml
e08b61
mv yamllint_defaults.yml .yamllint_defaults.yml
e08b61
%if %{with ansible}
e08b61
ansible-lint `find roles -name \*.yml`
e08b61
%endif
e08b61
e08b61
%files
e08b61
%doc README.md
e08b61
%license LICENSE
e08b61
%{ansible_collection_files}
e08b61
e08b61
%changelog
e08b61
* Mon Aug 30 2021 Nathan Scott <nathans@redhat.com> 2.2.1-1
e08b61
- Latest upstream release
e08b61
e08b61
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.4-2
e08b61
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
e08b61
  Related: rhbz#1991688
e08b61
e08b61
* Fri Jun 25 2021 Nathan Scott <nathans@redhat.com> 2.1.4-1
e08b61
- Latest upstream release
e08b61
e08b61
* Wed Jun 09 2021 Nathan Scott <nathans@redhat.com> 2.1.3-1
e08b61
- Initial version of RHEL-9 package (BZ 1957566)
e08b61
- Latest upstream release
e08b61
e08b61
* Fri Feb 05 2021 Nathan Scott <nathans@redhat.com> 2.1.2-1
e08b61
- Add RHEL macros to the spec alongside Fedora
e08b61
- Latest upstream release
e08b61
e08b61
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-2
e08b61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
e08b61
e08b61
* Wed Nov 11 2020 Nathan Scott <nathans@redhat.com> 2.0.3-1
e08b61
- Updated for new version with changed namespace
e08b61
- Ansible collection macros now used in the spec
e08b61
- Added ansible-lint checking in %%check section
e08b61
e08b61
* Fri Oct 23 2020 Nathan Scott <nathans@redhat.com> 1.0.0-1
e08b61
- Initial RPM spec build