在安装 Debian 软件包期间重命名文件

Mar*_*ing 16 python packaging debian

我有一个要为 Debian 打包的 python 脚本。我在我写的地方使用了 debian/install 文件

auto_dice.py /usr/bin/
Run Code Online (Sandbox Code Playgroud)

Linitan 然后抱怨 .py 扩展名 (script-with-language-extension)。

然后我把它改成

auto_dice.py /usr/bin/autodice.py
Run Code Online (Sandbox Code Playgroud)

这会导致错误,因为它被解释autodice.py为目录。

我怎样才能在那里重命名?我不想在源代码中重命名我的 python 脚本。

Kee*_*ook 13

您不能使用dh_install(通过debian/install)重命名文件。debian/rulesdh_install调用之前,您需要在“构建”目标期间重命名它。


小智 13

来自Debian 错误 245554已经提到:

如果您使用 dh >= 9 和 dh-exec,这已经很容易解决了。只需使您的 .install 文件可执行,将 #!/usr/bin/dh-exec 添加到顶部,您就可以使用“source => dest”,如下所示:

#!/usr/bin/dh-exec
debian/default.conf => /etc/my-package/start.conf
Run Code Online (Sandbox Code Playgroud)