I am using distutils to create an rpm from my project. I have this directory tree:
project/
my_module/
data/file.dat
my
It looks like you have to add a py_modules
option, e.g.:
setup(...,
ext_modules=[Extension('_foo', ['foo.i'],
swig_opts=['-modern', '-I../include'])],
py_modules=['foo'],
)
Using rpm to Install System Scripts in Linux, you'll have to modify your spec file. The %files
section tells rpm
where to put the files, which you can move or link to in %post
, but such can be defined in setup.py
using:
options = {'bdist_rpm':{'post_install':'post_install', 'post_uninstall':'post_uninstall'}},
Running Python scripts in Bash can be done with the usual first line as #!/usr/bin/python
and executable bit on the file using chmod +x filename
.