Omer Dagan
Omer Dagan

Reputation: 662

getting RPM file location in the spec file

I am building an RPM file, during installation of the RPM i need to get the path of the .rpm file
echo $PWD will return - '/'
echo %(pwd) will return the path to the location of the RPM build

to explain further
lets assume that i am producing A.rpm file, when deploying on a remote system i want to put on the remote system to files

A.rpm argument.txt

in the %pre section i want to read the argument.txt file i.e. something of the sort

if [ ! -f [what to put here]/argument.txt ]; then
 do something
fi 

How can I achieve this? is there a macro which i am unaware of?

Thanks in advance for any help,

Upvotes: 0

Views: 424

Answers (1)

msuchy
msuchy

Reputation: 5427

%pre is executed before installing package. Therefore you cannot access the content of the package. You may do that in %post and then it is in normal path (its destination).

Upvotes: 2

Related Questions