[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Postpone the evaluation of macro to installation
- From: Liguo Song <liguo song vanderbilt edu>
- To: rpm-list redhat com
- Subject: Re: Postpone the evaluation of macro to installation
- Date: Tue, 4 Nov 2003 23:18:36 -0600 (CST)
On Tue, 4 Nov 2003, Liguo Song wrote:
> Hi, folks,
>
> I am trying to build a package for a ruby wrapper. The files will be installed
> to directories depend on the version of the ruby package and the current host
> OS, which is the way ruby wants. For example, directory would be
> /usr/lib/ruby/1.8/i686-linux-gnu/ for ruby-1.8 on RH8.0 and i686, but it will be
> /usr/lib/ruby/1.6/i386-linux/ for ruby-1.6 on RH7.0 and i386.
>
> I figure out the way to determine these directories by invoking ruby and defined
> the results as macros. But all these macros are evaluated at the compile time.
> So, the directories will not work if the ruby versions are different on the
> building host and the installing host.
>
> I can put my files into a directory independent of the ruby version, and put
> links to them from the right places in the post install phase. But, the macros
> are all evaluated when I compile the src package, so the direcotries won't work
> for the installing host.
>
> My question is whether there is a way to postpone the evaluation of the macros
> to the installation time? If so, how to achieve this?
>
> Thanks in advance for any input.
>
>
> Liguo (Leo)
>
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list
>
It is a bad habit to reply to oneself. But since no one answered me,
I'd like to share what I found with experiments.
The shell script will be evaluated at the specified phase, such as
%prep, %install, %post, %postun, etc. So, the solution is either
define a shell env variable by `cmd` or just put the `cmd` in the part
you need it.
Hope someone else can share some more elegant solutions.
Thanks.
Liguo (Leo)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]