#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Somewhere over the Rainbow
    Posts
    128
    Rep Power
    11

    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    133
    Rep Power
    12
    You usually install python files by using distutils.
  6. #4
  7. Wacky hack
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2001
    Location
    London, England
    Posts
    513
    Rep Power
    14
    Or, if you want to just stick your app somewhere like /usr/share/yourapp, you can create a simple install shell script like so:

    Code:
    #!/bin/sh
    # Install script for YourApp
    
    echo Checking for dependencies...
    
    PYTHON=`which python`
    if [ $PYTHON ]; then
    	echo "python found at: $PYTHON"
    else
    	echo "python not found!"
    	exit 1
    fi
    
    python -c "from qt import qVersion, PYQT_VERSION"
    PYQT=$?
    if [ $PYQT -eq 0 ]; then
    	echo "PyQt found."
        #(sip found at: $PYQT)"
    else
    	echo "PyQt not found!"
    	exit 1
    fi
    
    echo
    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
    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
    That's a cannabalised version of my install script for QuickRip.

IMN logo majestic logo threadwatch logo seochat tools logo