From 332efea2bb3d00fe305018e00351707fd1a959ad Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 3 Jun 2021 14:39:43 +1000 Subject: [PATCH] Update to latest community sources --- .gitignore | 1 + ansible-pcp.spec | 43 ++++++++++++++++++++++++++++++++++++++----- sources | 2 +- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8a56c4a..893098a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /ansible-pcp-2.0.3.tar.gz /ansible-pcp-2.1.2.tar.gz +/ansible-pcp-2.1.3.tar.gz diff --git a/ansible-pcp.spec b/ansible-pcp.spec index f984b74..3af0c47 100644 --- a/ansible-pcp.spec +++ b/ansible-pcp.spec @@ -1,13 +1,15 @@ -%if 0%{?rhel} == 0 -%global collection_namespace performancecopilot -%global collection_name metrics -%else +%if 0%{?rhel} %global collection_namespace redhat %global collection_name rhel_metrics +%bcond_with ansible +%else +%global collection_namespace performancecopilot +%global collection_name metrics +%bcond_without ansible %endif Name: ansible-pcp -Version: 2.1.2 +Version: 2.1.3 Release: 1%{?dist} Summary: Ansible Metric collection for Performance Co-Pilot License: MIT @@ -15,8 +17,10 @@ URL: %{ansible_collection_url} Source: https://github.com/performancecopilot/ansible-pcp/archive/v%{version}/%{name}-%{version}.tar.gz Requires: ansible >= 2.9.10 +%if %{with ansible} BuildRequires: ansible >= 2.9.10 BuildRequires: python3-ansible-lint +%endif BuildArch: noarch %description @@ -56,7 +60,29 @@ of performance data. %prep %autosetup +mv .yamllint.yml yamllint.yml +mv .yamllint_defaults.yml yamllint_defaults.yml +%if 0%{?rhel} +rm -vr roles/repository tests/*repository* tests/*/*repository* docs/repository +%endif rm -vr .github .gitignore .ansible-lint .*.yml +sed -i \ + -e 's/^name: .*/name: %{collection_name}/g' \ + -e 's/^namespace: .*/namespace: %{collection_namespace}/g' \ + galaxy.yml +find . -name \*.yml -o -name \*.md | while read file; do + sed -i \ + -e 's/performancecopilot.metrics/%{collection_namespace}.%{collection_name}/g' \ + $file +done + +%if %{without ansible} +%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace} +# Empty command. We don't have ansible-galaxy. +%define ansible_collection_build() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz . +# Simply copy everything instead of galaxy-installing the built artifact. +%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) +%endif %build %ansible_collection_build @@ -65,7 +91,11 @@ rm -vr .github .gitignore .ansible-lint .*.yml %ansible_collection_install %check +mv yamllint.yml .yamllint.yml +mv yamllint_defaults.yml .yamllint_defaults.yml +%if %{with ansible} ansible-lint `find roles -name \*.yml` +%endif %files %doc README.md @@ -73,6 +103,9 @@ ansible-lint `find roles -name \*.yml` %{ansible_collection_files} %changelog +* Thu Jun 03 2021 Nathan Scott 2.1.3-1 +- Latest upstream release + * Fri Feb 05 2021 Nathan Scott 2.1.2-1 - Add RHEL macros to the spec alongside Fedora - Latest upstream release diff --git a/sources b/sources index 47674c2..d9c92c9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-pcp-2.1.2.tar.gz) = 0babea9669dd8aefc3fc3f334eac89f114897cf16341c208287bf8a85252caa0c196c28050caa4219925c5b858dfaf93dc2988a7348f2f96ed9069cfbdb68f44 +SHA512 (ansible-pcp-2.1.3.tar.gz) = 2ce68060bdb14a34a779741b04b015deb934e3d3186bc209e7b279c2902280a559ed63e6eb0c7779680e5c4089e8d8cf63c26f117b8b8bb57d2e2c47e43910b4