Using python 2.6, I'm attempting to build an RPM for a python C extension module.
The setup.py
that I'm using contains something like:
from distutils.core import setup, Extension
foo_ext = Extension('foo',
sources=['foo.c', '../src/common.c'],
include_dirs=['../includes'])
setup(... , ext_modules=[foo_ext])
If I run python setup.py build
from /devel/foo
for example, it compiles and builds without any errors, and gcc
is called with the correct paths, i.e.:
gcc ... -I/devel/includes ...
When I use python setup.py bdist_rpm
instead, then the relative paths used above are converted to absolute paths relative to the RPM build dir, this results in gcc
trying to compile using:
gcc ... -I/devel/foo/build/bdist.linux-x86_64/rpm/BUILD/includes ...
Compilation then fails as a required .h
file is not found in the include path.
Any suggestions or workarounds to this?