[opensuse-packaging] Tumbleweed build problem for a package I support
I support the hardware / iscsitarget package, and recently the Tumbleweed builds started failing. The patching for my spec file looks like this: ------------------------>8---------------------- %prep %setup -q -n %name-%version-svn %if 0%{?suse_version} > 1220 %patch1 -p1 %patch2 -p1 %patch3 -p1 %if 0%{?suse_version} > 1230 %patch4 %endif %if 0%{?suse_version} > 1310 %patch5 -p1 %endif %endif ------------------------>8---------------------- I traced down the Tumbleweed build errors to the fact that patch 5 is not being applied but should be. This seems to imply (to me) that the suse_version for tumbleweed has recently changed, or that the kernel that Tumbleweed uses has changed, since this patch is only needed for kernel 3.13 or higher. All other platforms are compiling as expected. Any ideas? -- Lee Duncan SUSE Labs -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Quoting Lee Duncan
%if 0%{?suse_version} > 1310 %patch5 -p1 %endif
I traced down the Tumbleweed build errors to the fact that patch 5 is not being applied but should be.
This seems to imply (to me) that the suse_version for tumbleweed has recently changed, or that the kernel that Tumbleweed uses has changed, since this patch is only needed for kernel 3.13 or higher.
All other platforms are compiling as expected.
Hi, I'm sure the kernel changed.. the version of TumbleWeed is set to 1310 (actually, TW does not specify one, so it inherits the one from from the 'base repository', currently being openSUSE 13.1. 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 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Quoting "Dominique Leuenberger a.k.a. Dimstar"
Quoting Lee Duncan
: %if 0%{?suse_version} > 1310 %patch5 -p1 %endif
I traced down the Tumbleweed build errors to the fact that patch 5 is not being applied but should be.
This seems to imply (to me) that the suse_version for tumbleweed has recently changed, or that the kernel that Tumbleweed uses has changed, since this patch is only needed for kernel 3.13 or higher.
All other platforms are compiling as expected.
Hi,
I'm sure the kernel changed.. the version of TumbleWeed is set to 1310 (actually, TW does not specify one, so it inherits the one from from the 'base repository', currently being openSUSE 13.1.
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
One small correction here: as this will be running in scope of RPM, you'll have to change %{version} to %%{version} (or it will compare against your 'package version') Dominique -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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
participants (2)
-
Dominique Leuenberger a.k.a. Dimstar
-
Lee Duncan