On 01/15/2011 05:35 PM, Matthias Fehring wrote:
Am Samstag, 15. Januar 2011, 16:04:06 schrieb Dave Plater:
On 01/15/2011 04:11 PM, Matthias Fehring wrote:
When I try this in terminal I get the following:
KDE: 4.9.95 (4.6 RC2)
I would expect something like
4995
I am only a novice in sed... ;-)
Best Greetings Matthias
%_kde_platform_version is automatically set to the installed systems version, if you are building locally with plain rpmbuild it will reflect your systems version. I placed the following line in the %prep section of a spec file : "echo "kde platform version = %{_kde_platform_version}"" and it produces this : + echo 'kde platform version = 4.5.95' kde platform version = 4.5.95 + exit 0
If you wish to see all of the macros available on your system place this macro at the top of the spec file : %dump and then execute rpmbuild yourspec.spec and all of the macros and definitions will be dumped to the console (don't forget to remove %dump afterwards). All of these macros may not exist in the build service build system but if you search for the macro in the files in /etc/rpm and then use rpm -q --whatprovides /etc/rpm/"the macro file it's in" you can then add the macro by adding the package to your BuildRequires:.
Regards Dave P
Yes, I know. What I need is to check the KDE version of the build system to use the appropriate patch.
For example something like
%if kde4_version >= 4560 %patch1 %endif
The same is possible with the suse_version macro, that is 1130 for openSUSE 11.3.
When I try
%if %{_kde_platform_version} >= 4.5.60 %patch1 %endif
I get a parse error in expression.
Might be that my description was not clear enough - sorry for that. :)
Best Greetings Matthias
Try quotes or if that fails use normal bash scripting starting with, for instance, kpltfrmvers=%{_kde_platform_version}, you can also try using "cut" using the periods "." as field delimiters, see man cut. Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org