I would like to get some help regarding spec file and specifically the %pre section.
What I would like to do is, in the %pre section I want to be able to refer and use to a .sh file.
I got this idea from the following link rpmbuild: using script files contained in the package in %pre script
In the link above keep the focus on the fact that in the preamble section of the spec file, a source .sh file is declared.
Source0:xyz.sh .... ....
The %pre section then uses the xyz.sh file
%pre -f xyz.sh
I tried the above approach but I am not able to get this to work.
So the question
where to place the script, in this example xyz.sh
and how does it become available to the %pre section since the %pre is called even before any files that are a part of the rpm is copied to the target machine.