Run for loop over %files directive in the .spec file

rpmspecfile

I am writing a spec file which creates multiple packages. Can I use a for loop over %files directive with different names, like this:

for name in {package1, package2, package3} ; do
  %files -n $name
  %attr(644, root, root) /etc/systemd/system/$name.service
done

Best Answer

In long words due to minimal post length restriction: No.

Spec files are not any form of scripting language.

Related Topic