JavaScript is required to for searching.
跳过导航链接
退出打印视图
应用程序包开发者指南     Oracle Solaris 10 1/13 Information Library (简体中文)
search filter icon
search icon

文档信息

前言

1.  设计软件包

2.  生成软件包

3.  增强软件包的功能(任务)

4.  验证和转换软件包

5.  软件包创建案例研究

请求来自管理员的输入

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

request 脚本

在安装时创建文件并在删除期间保存文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

space 文件

i.admin 类操作脚本

r.cfgdata 删除脚本

定义软件包兼容性和相关性

技术

方法

案例研究文件

pkginfo 文件

copyright 文件

compver 文件

depend 文件

使用标准类和类操作脚本修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

i.inittab 安装类操作脚本

r.inittab 删除类操作脚本

inittab 文件

使用 sed 类和 postinstall 脚本修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

sed 类操作脚本 (/etc/inittab)

postinstall 脚本

使用 build 类修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

生成文件

在安装期间修改 crontab 文件

技术

方法

案例研究文件

pkginfo 命令

prototype 文件

i.cron 安装类操作脚本

r.cron 删除类操作脚本

crontab 文件 #1

crontab 文件 #2

使用过程脚本安装和删除驱动程序

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

request 脚本

postinstall 脚本

preremove 脚本

使用 sed 类和过程脚本安装驱动程序

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

sed 类操作脚本 (/etc/devlink.tab)

postinstall 安装脚本

preremove 删除脚本

copyright 文件

6.  创建软件包的高级技术

词汇表

索引

请求来自管理员的输入

在此案例研究中,软件包有三种类型的对象。管理员可以选择安装哪一种对象类型,并选择对象在安装计算机上的位置。

技术

此案例研究展示以下技术:

方法

要在此案例研究中设置选择性安装,您必须完成以下任务:

案例研究文件

pkginfo 文件

PKG=ncmp
NAME=NCMP Utilities
CATEGORY=application, tools
BASEDIR=/
ARCH=SPARC
VERSION=RELEASE 1.0, Issue 1.0
CLASSES=""
NCMPBIN=/bin
NCMPMAN=/usr/man
EMACS=/usr/emacs

prototype 文件

i pkginfo
i request
x bin $NCMPBIN 0755 root other
f bin $NCMPBIN/dired=/usr/ncmp/bin/dired 0755 root other
f bin $NCMPBIN/less=/usr/ncmp/bin/less 0755 root other
f bin $NCMPBIN/ttype=/usr/ncmp/bin/ttype 0755 root other
f emacs $NCMPBIN/emacs=/usr/ncmp/bin/emacs 0755 root other
x emacs $EMACS 0755 root other
f emacs $EMACS/ansii=/usr/ncmp/lib/emacs/macros/ansii 0644 root other
f emacs $EMACS/box=/usr/ncmp/lib/emacs/macros/box 0644 root other
f emacs $EMACS/crypt=/usr/ncmp/lib/emacs/macros/crypt 0644 root other
f emacs $EMACS/draw=/usr/ncmp/lib/emacs/macros/draw 0644 root other
f emacs $EMACS/mail=/usr/ncmp/lib/emacs/macros/mail 0644 root other
f emacs $NCMPMAN/man1/emacs.1=/usr/ncmp/man/man1/emacs.1 0644 root other
d man $NCMPMAN 0755 root other
d man $NCMPMAN/man1 0755 root other
f man $NCMPMAN/man1/dired.1=/usr/ncmp/man/man1/dired.1 0644 root other
f man $NCMPMAN/man1/ttype.1=/usr/ncmp/man/man1/ttype.1 0644 root other
f man $NCMPMAN/man1/less.1=/usr/ncmp/man/man1/less.1 0644 inixmr other

request 脚本

trap 'exit 3' 15
# determine if and where general executables should be placed
ans=`ckyorn -d y \
-p "Should executables included in this package be installed"
` || exit $?
if [ "$ans" = y ]
then
   CLASSES="$CLASSES bin"
   NCMPBIN=`ckpath -d /usr/ncmp/bin -aoy \
   -p "Where should executables be installed"
   ` || exit $?
fi
# determine if emacs editor should be installed, and if it should
# where should the associated macros be placed
ans=`ckyorn -d y \
-p "Should emacs editor included in this package be installed"
` || exit $?
if [ "$ans" = y ]
then
   CLASSES="$CLASSES emacs"
   EMACS=`ckpath -d /usr/ncmp/lib/emacs -aoy \
   -p "Where should emacs macros be installed"
   ` || exit $?
fi

请注意,request 脚本可以在不在文件系统上留下任何文件的情况下退出。对于 2.5 和兼容版本之前的 Oracle Solaris 版本上的安装(其中没有 checkinstall 脚本可用),可以运行 request 脚本来以任何所需的方式对文件系统进行测试以确保安装成功。当 request 脚本以代码 1 退出时,安装将完全退出。

这些示例文件显示了使用参数化路径建立多个基目录。然而,首选的方法涉及使用由 pkgadd 命令管理并验证的 BASEDIR 参数。每当使用多个基目录时,在同一个平台上安装多个版本和体系结构时应格外小心。