RPM package, conditional adding files in "%files" section

Hello,
Is it possible to specify a list of files to be included in an RPM package (section "% files") according to some condtions. For example, if a particular condition is true, do not include the file "X". If not include it.
Thank you for your help.
Regards

You are looking for conditionals in the spec file:

10.6.2.�Using conditional blocks

You may have to define some macros depending on what you need but reading the docs on conditionals and also defining macros in the spec file is a good place to start. :slight_smile: