[prev in list] [next in list] [prev in thread] [next in thread] 

List:       suse-kde
Subject:    Re: [opensuse-kde] kde-obs-generator: how to install files
From:       "David Jarvie" <lists () astrojar ! org ! uk>
Date:       2010-08-04 16:05:11
Message-ID: c09b315a3180c104dfc3411e032f5c38.squirrel () www ! sensical ! net
[Download RAW message or body]

On Mon, August 2, 2010 12:30 pm, Lubos Lunak wrote:
> On Sunday 01 of August 2010, David Jarvie wrote:
>> There
>> are some files which need to be installed for systems which provide KDE
>> 4.2, but not for KDE 4.3 or later. I've tried a couple of methods in the
>> .spec file to specify this, but the build failed each time. How can I
>> specify this condition?
>
>  There doesn't seem to be a pre-made check for this, but you can do e.g.
>
> %files ...
> ...
> %if %(rpm -q --qf "%{VERSION}" kdelibs4 | awk -F . '{ printf
> "%d%02d%02d",$1,
> $2,$3 }') >= 040200
> ...
> %endif
> ...

This doesn't work after all. Putting it into the %files section results in
a parse error in the spec file (it complains that it can't parse "%(..."
). So instead I tried

if [ %(rpm -q --qf "%{VERSION}" kdelibs4 | awk -F . '{ printf
"%d%02d%02d",$1,$2,$3 }') -ge 040200 ]; then
...
fi

This parses successfully, but at the end of the build each whitespace
delimited token in the 'if' statement is assumed to be a file name,
resulting in errors such as

    File must begin with "/": $(rpm

So I'm back to square one - I can't find a syntax that enables files to be
included conditionally in the %files section.

-- 
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm

-- 
To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-kde+help@opensuse.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic