<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.10.1">
</HEAD>
<BODY>
On Thu, 2007-08-02 at 12:11 -0400, Stanley A. Klein wrote: 
<BLOCKQUOTE TYPE=CITE>
<PRE>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="1">--><FONT COLOR="#000000">Robert Kern wrote:</FONT>
<FONT COLOR="#000000">&gt;Stanley A. Klein wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt; Robert Kern wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt; Stanley A. Klein wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt; I tried to do something to fix the numpy distutils bdist_rpm.py (by</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt; trying to follow what was done in install.py) but it didn't work and I</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt;&gt; got an error message I didn't understand.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;&gt; I'd like to help, but if you don't copy the exact error message here, I</FONT>
<FONT COLOR="#000000">&gt;&gt; can't.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; OK, here is my revised numpy/distutils/commands/bdist_rpm.py (trying --</FONT>
<FONT COLOR="#000000">&gt;&gt; obviously not well -- to follow what was done in</FONT>
<FONT COLOR="#000000">&gt;&gt; numpy/distutils/commands/install.py:</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; import os</FONT>
<FONT COLOR="#000000">&gt;&gt; import sys</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; if 'setuptools' in sys.modules:</FONT>
<FONT COLOR="#000000">&gt;&gt;     import setuptools.command.bdist_rpm as old_bdist_rpm</FONT>
<FONT COLOR="#000000">&gt;&gt;     class bdist_rpm(old_bdist_rpm):</FONT>
<FONT COLOR="#000000">&gt;&gt;         pass</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; else:</FONT>
<FONT COLOR="#000000">&gt;&gt;     from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;Note the difference between these two lines. You imported a module, not the</FONT>
<FONT COLOR="#000000">&gt;class inside it. Try this instead:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;if 'setuptools' in sys.modules:</FONT>
<FONT COLOR="#000000">&gt;    from setuptools.command.bdist_rpm import bdist_rpm as old_bdist_rpm</FONT>
<FONT COLOR="#000000">&gt;else:</FONT>
<FONT COLOR="#000000">&gt;    from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm</FONT>
<FONT COLOR="#000000">&gt;</FONT>

<FONT COLOR="#000000">Thanks.</FONT>

<FONT COLOR="#000000">I tried it and it ran.</FONT>

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

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

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

</PRE>
</BLOCKQUOTE>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I may have spoken too soon about it working.&nbsp; I'm now getting a completely incomprehensible error during the build step.&nbsp; If I independently run &quot;python setup.py build&quot; it works.&nbsp; If I run &quot;python setup.py bdist_rpm&quot; it creates an rpm spec file with substantially the same statement for the build and I get the traceback below.&nbsp; If I make the build statement exactly the same by specifying --no-rpm-opt-flags the behavior doesn't change.&nbsp; The traceback is (picking up in the output):<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->------------<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/sfnt/sfnt.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/smooth/smooth.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/truetype/truetype.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/type1/type1.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/type42/type42.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/winfonts/winfnt.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; adding 'enthought/kiva/agg/freetype2/src/gzip/ftgzip.c' to sources.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->building library &quot;agg24_src&quot; sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->building library &quot;kiva_src&quot; sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->building extension &quot;enthought.kiva.agg._agg&quot; sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->Traceback (most recent call last):<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;setup.py&quot;, line 117, in ?<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; version = '2.0b1',<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/site-packages/numpy/distutils/core.py&quot;, line 174, in setup<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; return old_setup(**new_attr)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/core.py&quot;, line 149, in setup<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; dist.run_commands()<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/dist.py&quot;, line 946, in run_commands<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; self.run_command(cmd)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/dist.py&quot;, line 966, in run_command<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; cmd_obj.run()<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/command/build.py&quot;, line 112, in run<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; self.run_command(cmd_name)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/cmd.py&quot;, line 333, in run_command<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; self.distribution.run_command(command)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/distutils/dist.py&quot;, line 966, in run_command<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; cmd_obj.run()<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py&quot;, line 87, in run<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; self.build_sources()<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py&quot;, line 106, in build_sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; self.build_extension_sources(ext)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py&quot;, line 216, in build_extension_sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; sources = self.swig_sources(sources, ext)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp; File &quot;/usr/lib/python2.4/site-packages/numpy/distutils/command/build_src.py&quot;, line 564, in swig_sources<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; raise ValueError(&quot;%r missing&quot; % (target_file,))<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->ValueError: 'agg_wrap.c' missing<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->error: Bad exit status from /var/tmp/rpm-tmp.37529 (%build)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->RPM build errors:<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->&nbsp;&nbsp;&nbsp; Bad exit status from /var/tmp/rpm-tmp.37529 (%build)<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->error: command 'rpmbuild' failed with exit status 1<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->-----------------------------<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->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.&nbsp; There is no file agg_wrap.c.&nbsp; There *is* a file agg_wrap.cpp, that it properly finds and uses when running &quot;python setup.py build&quot;.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I've looked at the numpy distutils code and can't imagine what would cause such a weird problem.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->Any suggestions?<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->Stan Klein<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
</BODY>
</HTML>