<!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 Tue, 2007-07-31 at 18:05 -0400, Phillip J. Eby wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="1">--><FONT COLOR="#000000">At 05:16 PM 7/31/2007 -0400, Stanley A. Klein wrote:</FONT>
<FONT COLOR="#000000">>Robert Kern wrote:</FONT>
<FONT COLOR="#000000">>Stanley A. Klein wrote:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> >> I tried to do something to fix the numpy distutils bdist_rpm.py (by</FONT>
<FONT COLOR="#000000">> >> trying to follow what was done in install.py) but it didn't work and I</FONT>
<FONT COLOR="#000000">> >> got an error message I didn't understand.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> >I'd like to help, but if you don't copy the exact error message here, I</FONT>
<FONT COLOR="#000000">>can't.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>OK, here is my revised numpy/distutils/commands/bdist_rpm.py (trying --</FONT>
<FONT COLOR="#000000">>obviously not well -- to follow what was done in</FONT>
<FONT COLOR="#000000">>numpy/distutils/commands/install.py:</FONT>
<FONT COLOR="#000000">Please see my earlier message about "setup.py install --root </FONT>
<FONT COLOR="#000000">--record" and try that -- it will give us the information to know </FONT>
<FONT COLOR="#000000">whether there's even a problem with numpy's bdist_rpm, or if it's in </FONT>
<FONT COLOR="#000000">numpy's install_lib or build_ext commands. There's no point in </FONT>
<FONT COLOR="#000000">changing the commands around before that.</FONT>
</PRE>
</BLOCKQUOTE>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I ran it and think I have figured out what is happening.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I first ran the build, using "python setup.py build" rather than the "env CFLAGS="$RPM_OPT_FLAGS" python setup.py build" that appears in the rpm spec file built by bdist_rpm. I don't know what difference that makes. The build looked OK.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I then created a buildroot directory and ran "python setup.py install --root=build/buildroot --record=INSTALLED_FILES". The install looked OK as well. It included the .so files and also built the .pyo and .pyc files for the .py files that are used during kiva execution and resulted from the [install] optimize=1 in setup.cfg. I saved the buildroot directory and INSTALLED_FILES.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I then cleared the build directory and ran "python setup.py bdist_rpm". It gave me the unpackaged files error as before. I looked at exactly what files were unpackaged. They turned out to include two kinds of files: (1) some .pyc and .pyo files for .py files in example and test directories, and (2) a pair of .pyc and .pyo files for the __init__.py at the top level of the enthought directory that contains the statement for proper processing of namespace packages. I'm sure these .pyc and .pyo files are coming from brp-python-bytecompile that Fedora rpmbuild runs without requiring __init__.py files in the directories it processes.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->The workaround for the example and test directories is to remove them from the package. Under the Unix File Hierarchy Standard, they don't belong in /usr/lib/python/site-packages but in /usr/share/packagename+ or /usr/share/doc/packagename+ (where the "+" indicates adding version information). I had to do this with another enthought component, and for that I put them in a directory intended for building a package to install them in the right location per the FHS.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I don't know what to do about the .pyc and .pyo files for the __init__.py. It looks like what might be happening is that the rpm spec file is being built by a combination of the distutils and numpy distutils functions (which differ from setuptools in the scripts they put in the spec file, including the env statement build difference shown above and omitting " --single-version-externally-managed" from the install options). Then it looks like the build might be executed by the numpy distutils but the install is being done by setuptools. The install (both what I executed alone and when done by bdist_rpm) includes the egg-info directory and the nspkg.pth file. BTW, differencing the bdist_rpm INSTALLED_FILES and my earlier test INSTALLED_FILES showed the only difference being the naming of the files in the egg-info and nspkg.pth files.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->I think this clarifies what is happening, although I'm not sure how to fix the issue with the __init__.py file.<BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">--><BR>
<!--+GtkHTML:<DATA class="ClueFlow" key="orig" value="0">-->Many thanks for insisting that I run the test you suggested. I hope this helps make the issues clear.<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>
</BODY>
</HTML>