Description of problem: The .spec file contains a unguarded comparision, on: __isabits which fails to 'nil' on the LHS of a conditional and so generates a obscure macro error, in portability situations Propose workaround is to 'guard' it with a '0' Version-Release number of selected component (if applicable): curl-7.19.5-1.fc12.src.rpm How reproducible: rpmbuild -va curl.spec Here is the patch: [herrold@centos-5 curl]$ diff -u curl.spec-ORIG curl.spec --- curl.spec-ORIG 2009-06-09 14:32:13.000000000 -0400 +++ curl.spec 2009-06-09 14:32:39.000000000 -0400 @@ -90,7 +90,7 @@ %define _curlbuild32_h curlbuild-32.h %define _curlbuild64_h curlbuild-64.h -%if %{__isa_bits} == 64 +%if 0%{?__isa_bits} == 64 %define _curlbuild_h %{_curlbuild64_h} %else %define _curlbuild_h %{_curlbuild32_h} [herrold@centos-5 curl]$ Additional info: Please ask if more information is needed.
Yup, agreed. It will fail on older systems with older rpm installed (without defined __isa_bits). Please apply the proposed change.
Thanks both of you. Built as curl-7.19.5-2.fc12. Builds for F-11 and F-10 will follow.
curl-7.19.4-9.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/curl-7.19.4-9.fc11
curl-7.19.4-6.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/curl-7.19.4-6.fc10
Alternative approach that supports 64-bit builds on older systems: define __isa_bits if it isn't defined already: # Define %{__isa_bits} for old releases %{!?__isa_bits: %global __isa_bits %((echo '#include <bits/wordsize.h>'; echo __WORDSIZE) | %{__cpp} - | %{__grep} -Ex '32|64')}
Thanks for advice. I'll try it on next build.
Similarly, a slightly neater solution to the multi-arch header problem is to include this curlbuild.h file as Source1: #include <bits/wordsize.h> #if __WORDSIZE == 32 #include "curlbuild-32.h" #elif __WORDSIZE == 64 #include "curlbuild-64.h" #else #error "Unknown word size" #endif and then the spec file snippet for dealing with it reduces down to: # Make libcurl-devel multilib-clean (#488922) %if %{__isa_bits} == 64 mv $RPM_BUILD_ROOT%{_includedir}/curl/curlbuild{,-64}.h %else mv $RPM_BUILD_ROOT%{_includedir}/curl/curlbuild{,-32}.h %endif install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/curl
Yes, it makes sense to me.
Paul, Kamil The problem with the solution from comments 5 on is that it puts the load in the wrong place -- A non-compatible rpmrc macro change has been made, not publiced well, and is in place in the owning package. To drill in special purpose code here (and is all other like affected packages) is to hide the poor (non back-compat) changes in that offending package. Please don't use special purpose code to fix what needs a direct fix elsewhere. -- Russ herrold
Well, I've only excluded the content of curlbuild.h to separate file and built it as curl-7.19.5-3.fc12.
That's not going to work too well since the separate curlbuild.h file contains RPM macros that won't get expanded now that it's not a here document.
Oops, fixed in curl-7.19.5-4.fc12. Thanks for pointing this out!
curl-7.19.4-6.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
curl-7.19.4-9.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.