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 have a python script that I want to package for Debian. I use a debian/install file where I wrote

auto_dice.py /usr/bin/

Linitan then complains about the .py extension (script-with-language-extension).

I then changed it to

auto_dice.py /usr/bin/autodice.py

which causes an error because it interpreted autodice.py as a directory.

How can I do the rename there? I do not want to rename my python script in the sources.

share|improve this question
add comment

2 Answers 2

up vote 9 down vote accepted

You cannot rename files using dh_install (via the debian/install). You will need to rename it during the debian/rules "build" target before you get to the dh_install invocation.

share|improve this answer
    
so it will be build: \\ mv auto_dice.py autodice? –  queueoverflow Apr 5 '11 at 21:38
    
likely the mv would happen in the target directory rather than the build directory, but yeah, you'd have to add the move before calling dh_install. –  Kees Cook Apr 7 '11 at 1:39
    
For a bug report requesting this feature, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=245554 –  Bernhard Reiter Mar 21 '12 at 19:39
    
@Kees Cook: if you rename it in the target directory - would apt-get still be able to remove the file after package removal/upgrading? –  zerkms May 27 '13 at 22:34
add comment

From Debian bug 245554 already mentioned:

this can already be easily solved if you use dh >= 9 and dh-exec. Just make your .install file executable, add #!/usr/bin/dh-exec to the top, and you can use "source => dest", like this:

#!/usr/bin/dh-exec
debian/default.conf => /etc/my-package/start.conf
share|improve this answer
add comment

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.