我正在尝试配置一个 debian 包以在安装时执行一些操作(更具体地说,我想使用 设置一些应用程序首选项gconftool-2
)只需要执行一次。我以前从未使用过 debian 软件包,我不确定是否有“安装时执行此操作”属性。任何帮助表示赞赏。
问问题
69 次
2 回答
1
您正在寻找configure
脚本,或者可能是post-install
脚本。您可能应该阅读其中的包装教程。
于 2012-02-01T06:05:21.360 回答
0
在 Debian 文件夹中,您创建一个postinst
shell 脚本并从该脚本执行您的修改。如果您有不同的工具来修改首选项,请从您的脚本中调用该工具。
#!/bin/sh -e
#DEBHELPER#
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$1" = "configure" ]
then
# Do your work here
# (the following gconftool-2 example is not valid, but it gives an idea)
gconftool-2 mouse swap-buttons
fi
非常重要:该#DEBHELPER#
模式将根据需要由 debian 脚本替换。将它包含在您的脚本中非常重要。尽管您之前可能有一些代码,但通常预计它会首先出现,但很少看到这种情况。
于 2018-08-14T16:14:08.320 回答