On Thu, 2007-08-02 at 12:11 -0400, Stanley A. Klein wrote:
Robert Kern wrote:
>Stanley A. Klein wrote:
>> Robert Kern wrote:
>> Stanley A. Klein wrote:
>>
>>>> I tried to do something to fix the numpy distutils bdist_rpm.py (by
>>>> trying to follow what was done in install.py) but it didn't work and I
>>>> got an error message I didn't understand.
>>
>>> I'd like to help, but if you don't copy the exact error message here, I
>> can't.
>>
>> OK, here is my revised numpy/distutils/commands/bdist_rpm.py (trying --
>> obviously not well -- to follow what was done in
>> numpy/distutils/commands/install.py:
>>
>> import os
>> import sys
>>
>> if 'setuptools' in sys.modules:
>>     import setuptools.command.bdist_rpm as old_bdist_rpm
>>     class bdist_rpm(old_bdist_rpm):
>>         pass
>>
>> else:
>>     from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm
>
>Note the difference between these two lines. You imported a module, not the
>class inside it. Try this instead:
>
>if 'setuptools' in sys.modules:
>    from setuptools.command.bdist_rpm import bdist_rpm as old_bdist_rpm
>else:
>    from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm
>

Thanks.

I tried it and it ran.

I'm still having problems getting things to work, but as you can see from
my previous email I've closed in on the issues, that now appear to involve
the packaging of documentation, tests, and examples, and the handling of
the namespace package __init__.py.

Right now, I think my problems involve svn, relating to my moving the
tests and examples to a different directory but somehow (probably because
setuptools looks at svn information) having files I moved out of the
enthought.kiva directory still in the build and creating problems, or
files not in the current version expected for the build and found missing.

I didn't follow proper svn procedure in moving files out, and I think that
is coming back to bite me, although what I did seemed to work with another
component.  My best bet at this point is to re-checkout the
enthought.branches directory and do it right from an svn viewpoint.



I may have spoken too soon about it working.  I'm now getting a completely incomprehensible error during the build step.  If I independently run "python setup.py build" it works.  If I run "python setup.py bdist_rpm" it creates an rpm spec file with substantially the same statement for the build and I get the traceback below.  If I make the build statement exactly the same by specifying --no-rpm-opt-flags the behavior doesn't change.  The traceback is (picking up in the output):

------------
  adding 'enthought/kiva/agg/freetype2/src/sfnt/sfnt.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/smooth/smooth.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/truetype/truetype.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/type1/type1.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/type42/type42.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/winfonts/winfnt.c' to sources.
  adding 'enthought/kiva/agg/freetype2/src/gzip/ftgzip.c' to sources.
building library "agg24_src" sources
building library "kiva_src" sources
building extension "enthought.kiva.agg._agg" sources
Traceback (most recent call last):
  File "setup.py", line 117, in ?
    version = '2.0b1',
  File "/usr/lib/python2.4/site-packages/numpy/distutils/core.py", line 174, in setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py", line 87, in run
    self.build_sources()
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py", line 106, in build_sources
    self.build_extension_sources(ext)
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py", line 216, in build_extension_sources
    sources = self.swig_sources(sources, ext)
  File "/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py", line 564, in swig_sources
    raise ValueError("%r missing" % (target_file,))
ValueError: 'agg_wrap.c' missing
error: Bad exit status from /var/tmp/rpm-tmp.37529 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.37529 (%build)
error: command 'rpmbuild' failed with exit status 1
-----------------------------

The problem is that when the build is done under the rpmbuild spec build script which is the same as the statement used for an ordinary build statement, somehow it wants to look for a file agg_wrap.c.  There is no file agg_wrap.c.  There *is* a file agg_wrap.cpp, that it properly finds and uses when running "python setup.py build".

I've looked at the numpy distutils code and can't imagine what would cause such a weird problem.

Any suggestions?


Stan Klein