On 02/13/2014 01:13 AM, Dominique Leuenberger a.k.a. Dimstar wrote:
...
The 'suse version' on a rolling release can't be properly used for any such patch I'm afraid... either the patch is 'smart' enough or the condition to apply the patch should be done 'smarter' (based on the actual 'kernel version' you care for vs the suse_version).
Something like this should work: if zypper vcmp $(rpm -q --qf %{version} kernel-devel) 3.13 | grep 'newer' ; then %patch5 -p1 fi
Dominique
Thanks for the suggestion. It turns out that kernel-devel is not present on older releases, so I used the kernel-syms RPM version number, since kernel-syms is already required for the build. And I used macros instead of shell commands directly. I *did* have to add "zypper" to the "BuildRequires:" list. (Too bad there isn't a better way to compare version numbers than load the whole zypper package.) Here are the diffs. I would appreciate an ACK if they look okay, before I push them to Factory:
@@ -20,6 +20,7 @@ BuildRequires: kernel-syms BuildRequires: module-init-tools BuildRequires: openssl-devel +BuildRequires: zypper Url: http://iscsitarget.sourceforge.net PreReq: %fillup_prereq %insserv_prereq /bin/cat /bin/rm Version: 1.4.20.3 @@ -67,9 +68,10 @@ %if 0%{?suse_version} > 1230 %patch4 %endif -%if 0%{?suse_version} > 1310 -%patch5 -p1 %endif +%define kernel_ver %(rpm -q --qf '%%{version}' kernel-syms) +%if %(zypper --terse vcmp %{kernel_ver} 3.13) >= 0 +%patch5 -p1 %endif echo "iscsi_trgt.ko yes" > kernel/Module.supported
Here's a link to the build request, if you would prefer to comment there: https://build.opensuse.org/request/show/222818 -- Lee Duncan SUSE Labs -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org