Bug 504857 - curl .spec file portability addition at 7.19.5-1
curl .spec file portability addition at 7.19.5-1
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: curl (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Kamil Dudka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-09 14:50 EDT by R P Herrold
Modified: 2009-07-16 03:32 EDT (History)
3 users (show)

See Also:
Fixed In Version: curl-7.19.5-2.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-10 09:25:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description R P Herrold 2009-06-09 14:50:06 EDT
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.
Comment 1 Jindrich Novy 2009-06-10 07:14:34 EDT
Yup, agreed.

It will fail on older systems with older rpm installed (without defined __isa_bits). Please apply the proposed change.
Comment 2 Kamil Dudka 2009-06-10 09:25:57 EDT
Thanks both of you. Built as curl-7.19.5-2.fc12. Builds for F-11 and F-10 will follow.
Comment 3 Fedora Update System 2009-06-10 09:32:38 EDT
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
Comment 4 Fedora Update System 2009-06-10 09:32:43 EDT
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
Comment 5 Paul Howarth 2009-06-15 07:19:36 EDT
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')}
Comment 6 Kamil Dudka 2009-06-15 07:42:09 EDT
Thanks for advice. I'll try it on next build.
Comment 7 Paul Howarth 2009-06-15 07:56:05 EDT
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
Comment 8 Kamil Dudka 2009-06-15 08:11:02 EDT
Yes, it makes sense to me.
Comment 9 R P Herrold 2009-06-15 12:59:15 EDT
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
Comment 10 Kamil Dudka 2009-06-24 09:46:41 EDT
Well, I've only excluded the content of curlbuild.h to separate file and built it as curl-7.19.5-3.fc12.
Comment 11 Paul Howarth 2009-06-24 09:58:14 EDT
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.
Comment 12 Kamil Dudka 2009-06-24 10:21:32 EDT
Oops, fixed in curl-7.19.5-4.fc12. Thanks for pointing this out!
Comment 13 Fedora Update System 2009-07-16 03:21:57 EDT
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.
Comment 14 Fedora Update System 2009-07-16 03:32:01 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.