Name: ndmspc-ansible Version: 0.0.7 Release: 1%{?dist} Summary: NDMSPC ansible Group: System Environment/Libraries License: LGPL v3+ Source0: %{name}-%{version}.tar.gz %if (0%{?rhel} >= 9) BuildRequires: ansible-core, curl Requires: ansible-core %else BuildRequires: ansible, curl Requires: ansible %endif %if (0%{?rhel} == 7) %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %else Requires: ansible-collection-community-general %endif %global debug_package %{nil} %description NDMSPC ansible %prep %setup -q %build ansible-galaxy role install -r requirements.yml -p build %if (0%{?rhel} == 7) ansible-galaxy collection install -r requirements.yml -p build_collection %endif %install %{__rm} -rf %{buildroot} %{__mkdir} -p %{buildroot}%{_sysconfdir}/ansible/roles/ %{__cp} -a build/* %{buildroot}%{_sysconfdir}/ansible/roles/ %{__mkdir} -p %{buildroot}%{_bindir}/ %{__cp} -a scripts/ansible-ndmspc %{buildroot}%{_bindir}/ %if (0%{?rhel} == 7) %{__mkdir} -p %{buildroot}%{_datadir}/ansible/collections/ %{__cp} -a build_collection/* %{buildroot}%{_datadir}/ansible/collections/ %endif %files %{_bindir}/* %{_sysconfdir}/ansible/roles/ %if (0%{?rhel} == 7) %{_datadir}/ansible/collections/ansible_collections %endif %changelog