Ok, I have found a solution. Maybe it is not really nice, but I post it.
KDEVERSION=$(kde4-config --version | grep -o "KDE: [0-9]\.[0-9]\.[0-9]." | sed 's!KDE: !!' | sed 's! !0!' | sed 's!\.!!g')
if test $KDEVERSION -ge 4160 ; then
%suse_update_desktop_file -n $RPM_BUILD_ROOT/usr/share/kde4/services/plasma-applet-yasp_temp.desktop
fi
But this does not work for the files list, so I added two lists as sources and then copy the matching one for using in %files -f files.list
if test $KDEVERSION -ge 4160 ; then
cp %{S:2} ../files.list ; else
cp %{S:1} ../files.list
fi
%files -f files.list
%defattr(-,root,root)
All this code is from the spec file of plasmoid-yasp in KDE:KDE4:Community.
Currently this does not work anymore with openSUSE 11.3 and newer. Does anyone know another was to determine the used version of KDE SC? Best way IMHO would be a constant like suse_version in the macros for KDE4. Something like kdesc_version, which could be used like the suse_version macro.