Harry Henry Gebel wrote:
On Sat, Sep 02, 2000 at 11:49:56AM +0200, M.-A. Lemburg wrote:
- bdist_rpm fails with an error in the rpm command (the source rpm is built, but it fails to build to the binary rpm for some reason -- it says, that it can't find the file ??); do I need some new rpm release for this to work ?
bdist_rpm requires RPM version 3, there was some discussion about supporting RPM 2; but it did not seem practical to me to support RPM 2 in a way that would work across different RPM based platforms. It probably would not be hard to make it produce version 2 spec files, but the packager would then have to build them outside of the Distutils.
I'm using rpm 3.0.3. FYI, I've attached a copy of the shell output to my reply to Greg.
- the bdist commands don't compile the .py files into .pyo but this is needed in order to use them with python -O
There were some attempts made to do this, but none has been satisfactory.
See my reply to Greg... this should be possible via os.system('python -O').
- how can I define the compiler settings for extension compilation (it defaults to -m486 for RPMs -- -mcpu=pentium would be more appropriate; default for standard bdist seems to be -O2 and no architecture) ?
The compiler options for RPMs are set by RPM (using CFLAGS) not by Distutils, you can change these by modifying your RPM configuration (the exact modifications depend on which version of RPM you are using.) Otherwise you can use CFLAGS to set them, I think they can be set in setup.py, but I'm not sure about that.
Hmm, I would rather not have to edit system files for RPM since this would make the setup.py file rely on the system's config files.
A distutils option would be my preferred solution. Should be simple to add: the option would just have to set os.environ['CFLAGS'] to whatever value is specified in setup.py.
setup.py can then include all the necessary logic to determine the compiler flags (e.g. by checking the default setting of the compiler classes).