November 13th, 2003, 04:48 PM
Create Installer for Python code
Hi, I would like to Create an Installer for my Python code, I want to create something like makefile or install.sh to install it, what I need to do?, and how can I make RPM for my code?
Thanks a lot.
November 14th, 2003, 09:50 AM
As far as I've known, make files are to compile code (generally keep up to date compilation of multi-file code). Python is interpreted, not complied.
November 14th, 2003, 10:19 AM
You usually install python files by using distutils.
November 14th, 2003, 06:30 PM
Or, if you want to just stick your app somewhere like /usr/share/yourapp, you can create a simple install shell script like so:
That's a cannabalised version of my install script for QuickRip.
# Install script for YourApp
echo Checking for dependencies...
if [ $PYTHON ]; then
echo "python found at: $PYTHON"
echo "python not found!"
python -c "from qt import qVersion, PYQT_VERSION"
if [ $PYQT -eq 0 ]; then
echo "PyQt found."
#(sip found at: $PYQT)"
echo "PyQt not found!"
echo Changing to root to install files
su -c "mkdir -p /usr/share/yourapp && cp *.py README LICENSE /usr/share/yourapp && chmod a+x /usr/share/yourapp/yourapp.py && ln -sf /usr/share/yourapp/yourapp.py /usr/bin/yourapp && cp yourapp.1.gz /usr/man/man1"
echo Here you can put some post-install hints
echo to pass on any necessary instructions, like
echo the name of the binary to run