How to use regex in an RPM SPEC file?

regex, rpm, specifications

Solution

You can use `'-f'` directive for `%files` to get list of files to be included from a file. That way you can generate the files to be included at the end of `%install` section

...
%install
...

find %{buildroot} -regex '.*a$' > file-lists

%files -f file-lists
...

Problem

I'd like to list the files to be included in my package using a regular expression or the output of find. How can I do that? TIA

Original source