[Distutils] [Enthought-dev] Building Fedora RPMs

Stanley A. Klein sklein at cpcug.org
Tue Oct 23 21:11:58 CEST 2007


On Tue, October 23, 2007 11:58 am, Dave Peterson wrote:
> Phillip J. Eby wrote:
>> At 10:37 AM 10/23/2007 -0400, Stanley A. Klein wrote:
>>> On Mon, 2007-10-22 at 18:15 -0500, Dave Peterson wrote:
>>> > Stanley A. Klein wrote:
>>>
>>> > > Other failures included:
>>> > >
>>> > > endo - unpackaged pyc and pyo files (looks like a setup.py issue)
>>> > >
>>> >
>>> > I get rpms built for this just fine.  Are you sure you have no local
>>> changes?
>>> >
>>>
>>> The problem with this one may be a setuptools issue.
>>>
>>> The failure in doing the bdist_rpm is on a file endo.py, which is
>>> identified to setuptools in the setup.py as a script.  The file is
>>> originally in enthought/endo/scripts.  The pyc and pyo files get built
>>> there properly because of the [install] optimize=1 option in setup.cfg.
>>> However, the INSTALLED_FILES also lists a /usr/bin/endo.py without
>>> the pyc
>>> and pyo files.  The Fedora rpm system causes those optimization files
>>> to
>>> be built unbeknownst to setuptools, which then causes the installed but
>>> unpackaged files error.
>>>
>>> I tried declaring the pyc and pyo files in the script statement, but at
>>> that point they don't exist and I got an error to that effect.
>>>
>>> There is probably a workaround, like commenting out the scripts
>>> statement in the setup.py and providing rpm a post-install script to
>>> copy
>>> endo.* into /usr/bin.  However, it would create separate setup.py files
>>> for rpm and non-rpm packaging.
>>
>> Better still, take off the '.py' on the 'endo' script, and/or use
>> setuptools' script generation support.
>>
> I'll take a stab at switching it to use the setuptools script support.


>From what Phillip says, all it might require is changing the name from
endo.py to endo in both enthought/endo/scripts and the script statement in
the setup.py file.  The file already has a #!/usr/bin/python as its first
line, so I think it can run as a command without producing the .pyo and
.pyc files in /usr/bin that bother SE-Linux.

I tried to do that and build the package, but I ran into problems of svn
and setuptools remembering what was there before and I got worse errors.
:-(  I've had problems like that before.


Stan Klein


-- 




More information about the Distutils-SIG mailing list