473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distutils, install_data and RPM distributions

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(....., 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

I looked at the bdist_rpm create .spec file, and for install it says:
python setup.py install --root=$RPM_BUILD _ROOT --record=INSTALLE D_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...

Jul 19 '05 #1
0 1076

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: John Hunter | last post by:
I want to create a python extension module with a win32 installer. The package has several other libraries that it depends on, which I would like to bundle with the extension module. I see two ways to go 1) distribute the other dlls with my ext module as install_data. If I go this route, where should they be put? I don't want to put...
by: Johan Svedberg | last post by:
Hi! I just started playing around with Distutils and there is one thing I could use some help with. I'm wondering if there is some convenient way to access the directories where the data_files was installed? -- Johan Svedberg, johan@svedberg.pp.se, http://johan.svedberg.pp.se/
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/bhsys.py to bhsys.pyc running install_scripts
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: setup.py /bin/
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer)...
by: Fuzzyman | last post by:
Python 2.4 is built with Microsoft Visiual C++ 7. This means that it uses msvcr7.dll, which *isn't* a standard part of the windows operating system. This means that if you build a windows installer using distutils - it *requires* msvcr7.dll in order to run. This is true even if your package is a pure python package. This means that when...
by: Steven Bethard | last post by:
How do I get distutils to include my testing module in just the "sdist" distribution? My current call to setup() looks like:: distutils.core.setup( ... py_modules=, ) If change this to::
by: bwooster47 | last post by:
Not sure if it is possible to do this - I know distutils has "force" option that can be turned on/off for install_data, but is it possible to do something somewhat complicated - have a data file named YYY, need to copy it to share/script/YYY only if share/script/YYY does not already exist, otherwise, need to copy YYY to share/script/YYY.new ...
by: Jonathan Fine | last post by:
Hello I'm writing a package that has cgi-bin scripts, html files and data files (templates used by cgi scripts). I find that using distutils in the standard way does not give me enough flexibilty, even if I use a setup.cfg. For example, I want certain data files to go to markedly different locations.
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.