distutils, install_data and RPM distributions

B

bwooster47

I have a simple python script that I need to create a kit for, and it
has one config file.
This is for Unix only, and very restricted use, so here's my relevant
setup.py:

setup(....., scripts=['myscript.py'],
data_files=[('/etc', ['myscript.cfg'])],...)

My problem is that when I repeatedly run "python setup.py install", it
will always overwrite the exising myscript.py, but if a
/etc/myscript.cfg file exists, it will not overwrite it.

I can use the --force option, or I can add force = 1 in [install_data]
in the setup.cfg - but that does not seem to help me with the RPM
packaging.

I looked at the bdist_rpm create .spec file, and for install it says:
python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES

Two questions:
1) Is there a way to customize the %install line created by bdist_rpm
option of the setup.py script?

2) Or, is there a way I can avoid using a setup.cfg, and put all that
info in the setup.py script itself? I would like to add a --force
option to the "data_files" line in the setup() call...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top