From 07382af91f1ebe4d2f09d8ab92445fcccfbf515f Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Oct 13 2022 02:43:35 +0000 Subject: [PATCH 1/2] Replace %{installbase} with %{ansible_roles_dir} --- diff --git a/ansible-collection-microsoft-sql.spec b/ansible-collection-microsoft-sql.spec index 0fff717..c7e04ea 100644 --- a/ansible-collection-microsoft-sql.spec +++ b/ansible-collection-microsoft-sql.spec @@ -14,7 +14,6 @@ License: MIT %global collection_rolename server %global legacy_rolename %{collection_namespace}.sql-server -%global installbase %{_datadir}/ansible/roles %global _pkglicensedir %{_licensedir}/%{name} Requires: linux-system-roles @@ -108,35 +107,35 @@ pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name popd %install -mkdir -p %{buildroot}%{installbase} +mkdir -p %{buildroot}%{ansible_roles_dir} # Copy role in legacy format and rename rolename in tests -cp -pR %{rolename} "%{buildroot}%{installbase}/%{legacy_rolename}" +cp -pR %{rolename} "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}" sed -i "s/linux-system-roles\.%{rolename}/%{legacy_rolename}/g" \ - %{buildroot}%{installbase}/%{legacy_rolename}/tests/*.yml + %{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/tests/*.yml # Copy README, COPYING, and LICENSE files to the corresponding directories mkdir -p %{buildroot}%{_pkglicensedir} mkdir -p "%{buildroot}%{_pkgdocdir}/%{legacy_rolename}" -cp -p "%{buildroot}%{installbase}/%{legacy_rolename}/README.md" \ +cp -p "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/README.md" \ "%{buildroot}%{_pkgdocdir}/%{legacy_rolename}" -cp -p "%{buildroot}%{installbase}/%{legacy_rolename}/README.html" \ +cp -p "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/README.html" \ "%{buildroot}%{_pkgdocdir}/%{legacy_rolename}" -if [ -f "%{buildroot}%{installbase}/%{legacy_rolename}/COPYING" ]; then - cp -p "%{buildroot}%{installbase}/%{legacy_rolename}/COPYING" \ +if [ -f "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/COPYING" ]; then + cp -p "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/COPYING" \ "%{buildroot}%{_pkglicensedir}/%{legacy_rolename}.COPYING" fi -if [ -f "%{buildroot}%{installbase}/%{legacy_rolename}/LICENSE" ]; then - cp -p "%{buildroot}%{installbase}/%{legacy_rolename}/LICENSE" \ +if [ -f "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/LICENSE" ]; then + cp -p "%{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/LICENSE" \ "%{buildroot}%{_pkglicensedir}/%{legacy_rolename}.LICENSE" fi # Remove dot files -rm -r %{buildroot}%{installbase}/*/.[A-Za-z]* -rm -r %{buildroot}%{installbase}/%{legacy_rolename}/tests/.[A-Za-z]* +rm -r %{buildroot}%{ansible_roles_dir}/*/.[A-Za-z]* +rm -r %{buildroot}%{ansible_roles_dir}/%{legacy_rolename}/tests/.[A-Za-z]* # Remove the molecule directory -rm -r %{buildroot}%{installbase}/*/molecule +rm -r %{buildroot}%{ansible_roles_dir}/*/molecule # Install collection pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ @@ -173,7 +172,7 @@ popd %{_pkgdocdir} %license %{_pkglicensedir} %{ansible_collection_files} -%{installbase}/%{legacy_rolename} +%{ansible_roles_dir}/%{legacy_rolename} %if %{with collection_artifact} %files collection-artifact From b80b156fd9d8a6b56c384de5d9a6271a471ff034 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Oct 13 2022 02:44:46 +0000 Subject: [PATCH 2/2] Use %ansible_collection_filelist in files --- diff --git a/ansible-collection-microsoft-sql.spec b/ansible-collection-microsoft-sql.spec index c7e04ea..5e6677c 100644 --- a/ansible-collection-microsoft-sql.spec +++ b/ansible-collection-microsoft-sql.spec @@ -168,10 +168,9 @@ fi popd %endif -%files +%files -f %{ansible_collection_filelist} %{_pkgdocdir} %license %{_pkglicensedir} -%{ansible_collection_files} %{ansible_roles_dir}/%{legacy_rolename} %if %{with collection_artifact}