You can use the directive '-f'for %filesto get a list of files that will be included in the file. This way you can generate files to be included at the end of the section.%install
...
%install
...
find %{buildroot} -regex '.*a$' > file-lists
%files -f file-lists
...
source
share