Blame SPECS/ansible-pcp.spec

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