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

Re: %iflibcversion %ifnlibcversion



> What's needed in rpm is a well defined, portable, and reasonably complete
> set of tests and predictable name space, much like autoconf wrto config.status,
> not more arcane --  compiled into rpm --  spec file syntax IMHO.

That would be ideal, yes. This was however a fairly trival patch and someone 
might have use of it until rpm does this in a cleaner way. Thus my posting.

How do you want it? It is better if I spend my time on fixing things that will 
go in upstream rather than keeping a local repository with patches that needs 
fixing for every release of rpm.

%if (os(Linux) && 
     (version(libc) => 2.2))
..
%elseif  (os(Linux) && (version(libc) < 2.2))
..
%else
..
%endif

Is an alternative, maybe? That would make the specfile harder to parse though. 

> Here's a cheaper variant (entirely untested):
> 
> %{exapnd: %%define _libc_version %(<your test here>)}
> 
> %if %{_libc_version} = "2.2.2"	# <-- I think this works, maybe not
> ...
> %endif

Considering TOK_LOGICAL_AND is defined in expression.c it sounds like there 
are logical operators in that parser. That is nice.

The "problem" with this would be that specfiles might become cluttered. 
Testing for libc-version is not very portable, ie a lot of %ifos tags and 
%endif's would show up. In between that there would probably be quite a few 
lines trying to do what the test is supposed to do.

> The %(<your test here>) could be as simple as
> 	%(rpm -q --qf '%%{version}' glibc)
> on an rpm managed system.

Having everything rpm managed makes the above test very simple. In reality, 
all operatingsystems aren't rpm managed, unfortunately. Packaging Solaris and 
FreeBSD and whatever else is probably something most people will consider not 
worth the trouble though.

/ Peter





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