[opensuse-packaging] Check for KDE SC version inside SPEC files
Hello list, I am searching for a way to determine the KDE SC version of the build system inside a SPEC file. In the past I used this way: http://bit.ly/eABmJb But this does not work anymore in recent openSUSE releases or with recent versions of KDE SC - I do not know the real reason. Is there a better way to check for the used version? Good would be a macro like suse_version, that can be used in conditionals. Best regards Buschmann
Am Freitag, 14. Januar 2011 schrieb Matthias Fehring:
Hello list,
I am searching for a way to determine the KDE SC version of the build system inside a SPEC file.
In the past I used this way: http://bit.ly/eABmJb
But this does not work anymore in recent openSUSE releases or with recent versions of KDE SC - I do not know the real reason.
Is there a better way to check for the used version?
Good would be a macro like suse_version, that can be used in conditionals.
How about %_kde_platform_version ? Greetings, Stephan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Freitag, 14. Januar 2011, 17:27:26 schrieb Stephan Kulow:
Am Freitag, 14. Januar 2011 schrieb Matthias Fehring:
Hello list,
I am searching for a way to determine the KDE SC version of the build system inside a SPEC file.
In the past I used this way: http://bit.ly/eABmJb
But this does not work anymore in recent openSUSE releases or with recent versions of KDE SC - I do not know the real reason.
Is there a better way to check for the used version?
Good would be a macro like suse_version, that can be used in conditionals.
How about %_kde_platform_version ?
Greetings, Stephan
In my last attempts (one year or so ago) that has not worked - maybe because of the dots? But I will try it again. :) Best Greetings Matthias
On 14/01/11 18:01, Matthias Fehring wrote:
Am Freitag, 14. Januar 2011, 17:27:26 schrieb Stephan Kulow:
Am Freitag, 14. Januar 2011 schrieb Matthias Fehring:
Hello list,
I am searching for a way to determine the KDE SC version of the build system inside a SPEC file.
In the past I used this way: http://bit.ly/eABmJb
But this does not work anymore in recent openSUSE releases or with recent versions of KDE SC - I do not know the real reason.
Is there a better way to check for the used version?
Good would be a macro like suse_version, that can be used in conditionals.
How about %_kde_platform_version ?
Greetings, Stephan
In my last attempts (one year or so ago) that has not worked - maybe because of the dots?
But I will try it again. :)
Best Greetings Matthias
The original macro failed just because the output from kde4-config changed format slightly with the KDE rebranding. I've been using this one in my spec files for a while %define kde4_version %(/usr/bin/kde4-config --version | sed -r '/KDE.*:/! { d }; { s/KDE.*: (([0-9]+)\\.([0-9]+)\\.([0-9]+)) .*/\\2\\3\\4/g }') Works on all KDE versions I've seen. Regards, Tejas -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Freitag, 14. Januar 2011, 19:18:32 schrieb Tejas Guruswamy:
The original macro failed just because the output from kde4-config changed format slightly with the KDE rebranding.
I've been using this one in my spec files for a while
%define kde4_version %(/usr/bin/kde4-config --version | sed -r '/KDE.*:/! { d }; { s/KDE.*: (([0-9]+)\\.([0-9]+)\\.([0-9]+)) .*/\\2\\3\\4/g }')
Works on all KDE versions I've seen.
Regards, Tejas
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 P.S. Sorry Tejas for the personal post... :)
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 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
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 -- Das Gesetz hat zum Schneckengang verdorben, was Adlerflug geworden wäre. (Friedrich Schiller - Die Räuber) Und der Buschfunk spielt gerade "Strandhagg Pt. III" von "KromleK".
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
Am Samstag, 15. Januar 2011, 16:58:06 schrieb Dave Plater:
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
Ah, ok, thanke you for the hint. :) -- Das Gesetz hat zum Schneckengang verdorben, was Adlerflug geworden wäre. (Friedrich Schiller - Die Räuber) Und der Buschfunk spielt gerade "Creepy" von "Lagwagon".
participants (4)
-
Dave Plater
-
Matthias Fehring
-
Stephan Kulow
-
Tejas Guruswamy