Bug 123598 - distutils bdist_rpm problem
distutils bdist_rpm problem
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mihai Ibanescu
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-19 11:43 EDT by Jeremy Sanders
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-09 14:00:00 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 Jeremy Sanders 2004-05-19 11:43:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040207 Firefox/0.8

Description of problem:
Trying to build an rpm for the numarray package

http://www.stsci.edu/resources/software_hardware/numarray

[testuser@xpc15 ~/numarray-0.9]$ python setup.py bdist_rpm
...
Wrote:
/home/testuser/numarray-0.9/build/bdist.linux-i686/rpm/SRPMS/numarray-0.9-1.src.rpm
Wrote:
/home/testuser/numarray-0.9/build/bdist.linux-i686/rpm/RPMS/i386/numarray-0.9-1.i386.rpm
Wrote:
/home/testuser/numarray-0.9/build/bdist.linux-i686/rpm/RPMS/i386/numarray-debuginfo-0.9-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.17559
+ umask 022
+ cd /home/testuser/numarray-0.9/build/bdist.linux-i686/rpm/BUILD
+ cd numarray-0.9
+ rm -rf /var/tmp/numarray-buildroot
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.17559
+ umask 022
+ cd /home/testuser/numarray-0.9/build/bdist.linux-i686/rpm/BUILD
+ rm -rf numarray-0.9
+ exit 0
moving build/bdist.linux-i686/rpm/SRPMS/numarray-0.9-1.src.rpm -> dist
Traceback (most recent call last):
  File "setup.py", line 153, in ?
    main()
  File "setup.py", line 144, in main
    setup(**p)
  File
"/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/core.py",
line 149, in setup
  File
"/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/dist.py",
line 907, in run_commands
  File
"/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/dist.py",
line 927, in run_command
  File
"/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/command/bdist_rpm.py",
line 316, in run
AssertionError: unexpected number of RPM files found:
['build/bdist.linux-i686/rpm/RPMS/i386/numarray-0.9-1.i386.rpm',
'build/bdist.linux-i686/rpm/RPMS/i386/numarray-debuginfo-0.9-1.i386.rpm']


It looks like python distutils fails as there's a generated debuginfo
file. Distutils should be fixed to know about the intended number of rpms.


Version-Release number of selected component (if applicable):
python-2.3.3-6

How reproducible:
Always

Steps to Reproduce:
1. Download numarray tar.gz
2. Run python setup.py bdist_rpm
3.
    

Additional info:


I think it would be great if numarray was in Fedora!
Comment 1 Mihai Ibanescu 2004-05-20 17:46:27 EDT
Have you reported this bug upstream? It is not a packaging bug, is it?
Comment 2 Jeremy Sanders 2004-05-21 04:39:58 EDT
I thought it might have been because of the extra debuginfo files.
I'll report it upstream now if you think not.
Comment 3 Jeremy Sanders 2004-05-21 04:44:13 EDT
Okay, I've found a python bug corresponding to this bug. There's a
patch to fix the problem, but the bug claims redhat/fedora developers
chose not to include the patch.

See
 http://sourceforge.net/tracker/index.php?func=detail&aid=957381&group_id=5470&atid=105470
Comment 4 Mihai Ibanescu 2004-05-24 10:02:18 EDT
Ah, cool. Thanks, I'll include the bug in the next python build.
Comment 5 Mihai Ibanescu 2004-06-04 11:17:00 EDT
The patch is horrible IMHO. distutils should be fixed to allow for
more than one rpm to be built out of one spec file, not worked around
the specific debuginfo problem.
Comment 6 David Nečas 2004-06-05 07:49:08 EDT
I must confess I haven't studied the patch, however:

Distutils writes the spec file itself, writes it to build one binary
rpm, so it reasonably expects one binary rpm is created.  It is
redhat-rpm-config what does something unexpected.  If rpmbuild creates
some random extra rpms, how can distutils know what happened, what
they are good for and what to do with them?  And there is no generic
method of preventing that.  Special-casing for known extra rpms it
knows what to do with is not so bad idea then.
Comment 7 Mihai Ibanescu 2004-06-07 10:20:39 EDT
You are right that distutils creates the spec file (although I wish it
offered a way to accept a custom spec file). But the -debuginfo thing
is totally driven by rpm macros. rpm macros are very powerful and very
confusing too.

Anyway, I have a patch that I will submit upstream that hopefully
addresses the big FIXME in distutils/command/bdist_rpm.py (and will
put it in rawhide for public consideration).
Comment 8 Mihai Ibanescu 2004-06-07 11:15:47 EDT
Patched rpms are available at:

ftp://people.redhat.com/misa/python/

(until the rawhide build becomes available)

Please give them a try and let me know if they work for you.
Comment 9 David Nečas 2004-06-09 13:48:04 EDT
They seem to fix it for me.
Comment 10 Mihai Ibanescu 2004-06-09 14:00:00 EDT
Excellent. The patch was accepted upstream too.
Comment 11 Jeff MacDonald 2004-08-10 11:01:52 EDT
does python-2.3.3-6 contain the patch? I went to the above url to
download the patched version, but it has been removed. 
Comment 12 Mihai Ibanescu 2004-08-10 11:14:53 EDT
Not sure, I would say use python 2.3.4 from rawhide or FC3 test 1.

http://download.fedora.redhat.com/pub/fedora/linux/core/test/2.90/i386/os/Fedora/RPMS/

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