Background.
$ rpmbuild --version RPM version 4.3.3
I am working on a spec file that needs to process a list of files in multiple scriptlets. DRY (don't repeat youself) has me defining the list once as a macro which is expanded into the various helper scripts. Maintaining the list is a pain since I haven't seen a way to avoid putting all the files on the same line.
%define LIST \ a \ b
gives an error
%define LIST a\ b\
gives an error as well
%define LIST a %define LIST %LIST b
Fails due to a recursion error
You have to have at least some part of the value on the first line, i.e.:
%define LIST a\
b\
c
This macro definition will work. If you plan to use these as commands, i.e. something like
%define DOSOMETHING rm file1\
rm file2\
rm file3
...
%build
%DOSOMETHING
this will not work. The lines in executable sections are split into separate commands first, THEN the macros are expanded. I.e. defining the macro will work, executing it as three separate commands will not.
If you want to execute 3 separate commands, it's easier to do it like
%define DOSOMETHING rm file1; rm file2; rm file3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With