Re: Expanding a Macro during install ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2/15/06, Lakshmi V <lakshmi.granger@xxxxxxxxx> wrote:
Hi all

I have got a macro in my spec file

%{!?myloc: %{expand: %%define myloc loc1}}

I am using this in my %install section

mkdir -p $RPM_BUILD_ROOT/scratch/%{myloc}
cp /scratch/tmp/readme.txt $RPM_BUILD_ROOT/scratch/%{myloc}/read_me.txt
chmod 777 $RPM_BUILD_ROOT/scratch/%{myloc}/read_me.txt

Now while buiding if I give
rpmbuild -ba myspec.spec --define 'myloc loc2'
it replaces the myloc correctly and the rpm is built with /scratch/loc2/read_me.txt entries, but when I want to do the same thing during install, it doesnt respond to the --define part at all. Will the --define not work with rpm -ivh ? because the rpm is already built with the myloc substituted with loc2 ?

Yes, that's exactly why.  The %install section is processed during the build phase and the resulting rpms (except for the .src.rpm) have no access to it.

Is there any workaround ?

I'm not sure what the recomended procedure is but you could just define an environment variable and access it in a %post script.

~Tom
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux