Bug 504857 - curl .spec file portability addition at 7.19.5-1
Summary: curl .spec file portability addition at 7.19.5-1
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: curl
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-09 18:50 UTC by R P Herrold
Modified: 2009-07-16 07:32 UTC (History)
3 users (show)

Fixed In Version: curl-7.19.5-2.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-10 13:25:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description R P Herrold 2009-06-09 18:50:06 UTC
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 11:14:34 UTC
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 13:25:57 UTC
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 13:32:38 UTC
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 13:32:43 UTC
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 11:19:36 UTC
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 11:42:09 UTC
Thanks for advice. I'll try it on next build.

Comment 7 Paul Howarth 2009-06-15 11:56:05 UTC
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 12:11:02 UTC
Yes, it makes sense to me.

Comment 9 R P Herrold 2009-06-15 16:59:15 UTC
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 13:46:41 UTC
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 13:58:14 UTC
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 14:21:32 UTC
Oops, fixed in curl-7.19.5-4.fc12. Thanks for pointing this out!

Comment 13 Fedora Update System 2009-07-16 07:21:57 UTC
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 07:32:01 UTC
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.