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.  パッケージの作成のための高度な手法

用語集

索引

sed クラスと postinstall スクリプトを使用したファイルの変更

このケーススタディーでは、パッケージのインストール中に、インストール先マシンに存在しているファイルを変更します。ここでは、3 種類の変更方法のうちの 1 つを使用します。ほかの 2 つの方法については、「標準クラスとクラスアクションスクリプトを使用したファイルの変更」およびbuild クラスを使用したファイルの変更」を参照してください。変更する対象のファイルは、/etc/inittab です。

手法

このケーススタディーでは、次の手法の実例を示します。

アプローチ

インストール時に /etc/inittab を変更するには、sed クラスを使用して、次のタスクを完了する必要があります。

この方法でインストール中に /etc/inittab を編集する場合、欠点が 1 つあります。それは、init q コマンドを実行するだけのために、完全なスクリプト (postinstall スクリプト) を提供する必要があるという点です。

ケーススタディーのファイル

pkginfo ファイル

PKG=case4
NAME=Case Study #4
CATEGORY=applications
BASEDIR=/opt
ARCH=SPARC
VERSION=Version 1d05
CLASSES=sed

prototype ファイル

i pkginfo
i postinstall
e sed /etc/inittab ? ? ?

sed クラスアクションスクリプト (/etc/inittab)

!remove
# remove all entries from the table that are associated
# with this package, though not necessarily just
# with this package instance
/^[^:]*:[^:]*:[^:]*:[^#]*#ROBOT$/d
!install
# remove any previous entry added to the table
# for this particular change
/^[^:]*:[^:]*:[^:]*:[^#]*#ROBOT$/d
# add the needed entry at the end of the table;
# sed(1) does not properly interpret the '$a'
# construct if you previously deleted the last
# line, so the command
# $a\
# rb:023456:wait:/usr/robot/bin/setup #ROBOT
# will not work here if the file already contained
# the modification. Instead, you will settle for
# inserting the entry before the last line!
$i\
rb:023456:wait:/usr/robot/bin/setup #ROBOT

postinstall スクリプト

# make init re-read inittab
/sbin/init q ||
exit 2
exit 0