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

Re: Macros get expanded in comments..



I posted this to redhat-devel-list:

%define initrddir %([ -d /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d/init.d)

To make it do what you want:

%define initrddir %([ -d /etc/init.d -a ! -L /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d/init.d)

Cheers,

Matt

On Sun, Sep 24, 2000 at 06:10:29PM -0400, Jim Knoble wrote:
> Circa 2000-Sep-24 16:54:51 -0400 dixit Mike A. Harris:
> 
> : In english, what I'm _really_ wanting to do is:
> : 
> : if( build_os <= Red Hat 6.2 )
> : 	%define this	that
> : else
> : 	%define this	somethingelse
> : fi
> 
> (I'm assuming this relates to the thread with subject "%_initscript?".)
> 
> Come to think of it, though, what you probably *really* want to do is
> something like this:
> 
>   if (/etc/init.d exists and is not a symlink)
>     %define _initdir /etc/init.d
>   else
>     %define _initdir /etc/rc.d/init.d
>   endif
> 
> and
> 
>   if (/etc/rc1.d exists and is not a symlink)
>     %define _rcdir /etc
>   else
>     %define _rcdir /etc/rc.d
>   endif
> 
> This makes your specfile not depend on what release the build system
> thinks it is, but rather what the actual characteristics are, much like
> autoconf.  Hence, if you're building on a hybrid system, (such as
> Mandrake ;), it still works.
> 
> Cheers.
> 
> -- 
> jim knoble | jmknoble@jmknoble.cx | http://www.jmknoble.cx/
> 
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/rpm-list





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