From d1ababd8b253d4793ff482955a86a91c7ba12d76 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sat, 19 Nov 2022 14:15:57 -0600 Subject: [PATCH] build_ignore unnecessary files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > Packagers should exclude [unnecessary] files, which SHOULD be done by > patching the collection’s galaxy.yml to add these files to the > build_ignore configuration. These files SHOULD NOT be removed with rm. -- https://docs.fedoraproject.org/en-US/packaging-guidelines/Ansible_collections/#_unnecessary_files This change should be upstreamed. --- 0001-build_ignore-unnecessary-files.patch | 37 +++++++++++++++++++++++ ansible-pcp.spec | 6 ++-- 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 0001-build_ignore-unnecessary-files.patch diff --git a/0001-build_ignore-unnecessary-files.patch b/0001-build_ignore-unnecessary-files.patch new file mode 100644 index 0000000..741f114 --- /dev/null +++ b/0001-build_ignore-unnecessary-files.patch @@ -0,0 +1,37 @@ +From b89ff30a83b3e38369d6d4f4854855d492f1b31a Mon Sep 17 00:00:00 2001 +From: Maxwell G +Date: Sat, 19 Nov 2022 14:11:20 -0600 +Subject: [PATCH] build_ignore unnecessary files +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +> Packagers should exclude [unnecessary] files, which SHOULD be done by +> patching the collection’s galaxy.yml to add these files to the +> build_ignore configuration. These files SHOULD NOT be removed with rm. + +-- https://docs.fedoraproject.org/en-US/packaging-guidelines/Ansible_collections/#_unnecessary_files +--- + galaxy.yml | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/galaxy.yml b/galaxy.yml +index 1651456..1226558 100644 +--- a/galaxy.yml ++++ b/galaxy.yml +@@ -31,5 +31,12 @@ tags: + - grafana + - redis + - pcp ++build_ignore: ++ - .github ++ - .gitignore ++ - .ansible-lint ++ - "*.yml" ++ - ".*.yaml" ++ - tests + + dependencies: {} +-- +2.38.1 + diff --git a/ansible-pcp.spec b/ansible-pcp.spec index f8917ea..604e55e 100644 --- a/ansible-pcp.spec +++ b/ansible-pcp.spec @@ -5,6 +5,7 @@ Summary: Ansible Metric collection for Performance Co-Pilot License: MIT URL: https://github.com/performancecopilot/ansible-pcp Source: https://github.com/performancecopilot/ansible-pcp/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0: 0001-build_ignore-unnecessary-files.patch BuildArch: noarch %if 0%{?rhel} @@ -87,13 +88,10 @@ values (and metadata) to ElasticSearch for the indexing and querying of performance data. %prep -%autosetup -mv .yamllint.yml yamllint.yml -mv .yamllint_defaults.yml yamllint_defaults.yml +%autosetup -p1 %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' \