Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've created several Python applications wherefore I know how to create a DEB and how to push an application into my PPA in Launchpad. What I never found out is how to make the application startable from the terminal by just entering its name like you use to do with any other Linux application. I guess that I have to create a link to the application's shell script in /usr/bin/ but I don't know how to do this in my rules file which looks like this:

#!/usr/bin/make -f
# -*- makefile -*-

%:
    dh $@

override_dh_install:
    dh_install nota/* /usr/share/nota/
    dh_install applications/nota.desktop /usr/share/applications/
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Frist your script has to be executable so:

chmod +x script.py

Then you have to either include the script directory in the user's PATH variable (source it in the .bashrc)

PATH="$PATH:/path/to/script"

or copy/link it in a directory that already listed in PATH:

cp script.py /usr/bin/

That should do it in the make file. For the last option make has to be invoked with sudo.

share|improve this answer
    
Make sure to strip the .py though. Commands should not have extensions. –  geirha Mar 29 '12 at 20:43
    
Okay somehow I overlooked the .deb building part an just thought of a make file. I have no experience with that. My bad. Still why can't you just put ln -s /path/to/script.sh /usr/bin/commandname in your rule-file? –  con-f-use Mar 29 '12 at 21:08
    
Yes, that is what I expected. I prefer to create a link to my 'script.sh' in /usr/bin/. But I still don't know how to do it. –  Ralf Hersel Mar 29 '12 at 21:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.