Mailinglist Archive: opensuse-kde (258 mails)
| < Previous | Next > |
Re: [opensuse-kde] kde-obs-generator: how to install files conditionally on the KDE version
- From: "David Jarvie" <lists@xxxxxxxxxxxxxxx>
- Date: Tue, 3 Aug 2010 12:55:34 +0100
- Message-id: <5c35098aa0f5395cadead6a995fac52f.squirrel@xxxxxxxxxxxxxxxx>
On Mon, August 2, 2010 12:30 pm, Lubos Lunak wrote:
This test only works for OpenSUSE - other distros use other names for the
kdelibs package. But actually (I forgot to say this) I wasn't wanting to
know how to find the KDE version - I did it using kde4-config.
My problem was how to put conditional code in the %install section. Your
syntax does seem to work, but only if the %if ... %endif is at the end of
the %install section. If it's in the middle, the rest of the %install
statements seem either to be ignored or to be treated as if they were part
of the %if ... %endif (I'm not sure which yet). This could pose problems
if two or more independent conditions needed to be used for different
groups of install statements.
--
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm
--
To unsubscribe, e-mail: opensuse-kde+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kde+help@xxxxxxxxxxxx
On Sunday 01 of August 2010, David Jarvie wrote:
I'm using the KDE OpenSUSE build service to build my KDE application.
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 test only works for OpenSUSE - other distros use other names for the
kdelibs package. But actually (I forgot to say this) I wasn't wanting to
know how to find the KDE version - I did it using kde4-config.
My problem was how to put conditional code in the %install section. Your
syntax does seem to work, but only if the %if ... %endif is at the end of
the %install section. If it's in the middle, the rest of the %install
statements seem either to be ignored or to be treated as if they were part
of the %if ... %endif (I'm not sure which yet). This could pose problems
if two or more independent conditions needed to be used for different
groups of install statements.
--
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm
--
To unsubscribe, e-mail: opensuse-kde+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kde+help@xxxxxxxxxxxx
| < Previous | Next > |