使用您喜爱的文本编辑器创建名为 checkinstall 的文件。
完成时保存所做更改并退出编辑器。
完成以下任务之一。
如果您要创建其他安装脚本,请跳至下一任务:如何编写过程脚本。
如果您未创建 prototype 文件,请完成如何使用 pkgproto 命令创建 prototype 文件过程。跳至步骤 5。
如果您已经创建了 prototype 文件,请编辑该文件,并为刚刚创建的安装脚本添加一个条目。
生成您的软件包。
如果需要,请参见如何生成软件包。
此 checkinstall 示例脚本将检查是否安装了 SUNWcadap 软件包所需的数据库软件。
# checkinstall script for SUNWcadap # # This confirms the existence of the required specU database # First find which database package has been installed. pkginfo -q SUNWspcdA # try the older one if [ $? -ne 0 ]; then pkginfo -q SUNWspcdB # now the latest if [ $? -ne 0 ]; then # oops echo "No database package can be found. Please install the" echo "SpecU database package and try this installation again." exit 3 # Suspend else DBBASE="`pkgparam SUNWsbcdB BASEDIR`/db" # new DB software fi else DBBASE="`pkgparam SUNWspcdA BASEDIR`/db" # old DB software fi # Now look for the database file we will need for this installation if [ $DBBASE/specUlatte ]; then exit 0 # all OK else echo "No database file can be found. Please create the database" echo "using your installed specU software and try this" echo "installation again." exit 3 # Suspend fi |
在生成软件包之后,请安装该软件包以确认它已正确安装并验证其完整性。第 4 章介绍了这些任务,并提供了有关如何将经过验证的软件包转换为分发介质的逐步说明。