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=krazy
NAME=KrAzY Applications
CATEGORY=applications
BASEDIR=/opt
ARCH=SPARC
VERSION=Version 1
CLASSES=none cfgdata admin

prototype ファイル

i pkginfo
i request
i i.admin
i r.cfgdata
d none bin 555 root sys
f none bin/process1 555 root other
f none bin/process2 555 root other
f none bin/process3 555 root other
f admin bin/config 500 root sys
d admin cfg 555 root sys
f admin cfg/datafile1 444 root sys
f admin cfg/datafile2 444 root sys
f admin cfg/datafile3 444 root sys
f admin cfg/datafile4 444 root sys
d cfgdata data 555 root sys

space ファイル

# extra space required by config data which is
# dynamically loaded onto the system
data 500 1

i.admin クラスアクションスクリプト

# PKGINST parameter provided by installation service
# BASEDIR parameter provided by installation service
while read src dest
do
   cp $src $dest || exit 2
done
# if this is the last time this script will be executed
# during the installation, do additional processing here.
if [ "$1" = ENDOFCLASS ]
then
# our config process will create a data file based on any changes
# made by installing files in this class; make sure the data file
# is in class `cfgdata' so special rules can apply to it during
# package removal.
   installf -c cfgdata $PKGINST $BASEDIR/data/config.data f 444 root
   sys || exit 2
   $BASEDIR/bin/config > $BASEDIR/data/config.data || exit 2
   installf -f -c cfgdata $PKGINST || exit 2
fi
exit 0

ここでは、クラスアクションスクリプトで installf が使用される珍しい例が示されています。space ファイルを使用して、対象のファイルシステム上でスペースを予約しているため、この新しいファイルは、pkgmap ファイルに含まれていない場合でも、安全に追加されます。

r.cfgdata 削除スクリプト

# the product manager for this package has suggested that
# the configuration data is so valuable that it should be
# backed up to $PKGSAV before it is removed!
while read path
do
# path names appear in reverse lexical order.
   mv $path $PKGSAV || exit 2
   rm -f $path || exit 2
done
exit 0