Ubuntu – Rename a file during install of a Debian package

debianpackagingpython

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.

Best Answer

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.