パッケージ開発の最後の手順は、パッケージをインストールして、発行されたパッケージが正しくパッケージ化されているかどうかをテストすることです。
root 権限を必要としないでインストールをテストするには、テストユーザーにソフトウェアインストールプロファイルを割り当てます。テストユーザーにソフトウェアインストールに関連するプロファイルを割り当てるには、usermod コマンドの -P オプションを使用します。
次の pkg set-publisher コマンドは、my-repository リポジトリ内のすべてのパブリッシャーを、このイメージで構成されているパブリッシャーの一覧に追加します。
$ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ $ pkg set-publisher -p my-repository pkg set-publisher: Added publisher(s): mypublisher $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ mypublisher origin online F file:///home/username/my-repository/
イメージを変更せずに、インストールコマンドが実行する内容を確認するには、pkg install コマンドに -nv オプションを使用します。次のコマンドでは、実際にパッケージをインストールします。
$ pkg install mypkg Packages to install: 1 Create boot environment: No Create backup boot environment: No Services to change: 1 DOWNLOAD PKGS FILES XFER (MB) SPEED Completed 1/1 3/3 0.0/0.0 787k/s PHASE ITEMS Installing new actions 16/16 Updating package state database Done Updating image state Done Creating fast lookup database Done Reading search index Done Updating search index 1/1
システム上に配布されたソフトウェアを調べます。
$ find /opt/mysoftware /opt/mysoftware /opt/mysoftware/bin /opt/mysoftware/bin/mycmd /opt/mysoftware/lib /opt/mysoftware/lib/mylib.so.1 /opt/mysoftware/man /opt/mysoftware/man/man1 /opt/mysoftware/man/man1/mycmd.1 /opt/mysoftware/man/man-index /opt/mysoftware/man/man-index/term.dic /opt/mysoftware/man/man-index/term.req /opt/mysoftware/man/man-index/term.pos /opt/mysoftware/man/man-index/term.exp /opt/mysoftware/man/man-index/term.doc /opt/mysoftware/man/man-index/.index-cache /opt/mysoftware/man/man-index/term.idx
バイナリとマニュアルページに加えて、アクチュエータが man-index サービスを再起動した結果としてマニュアルページのインデックスもシステムにより生成されました。
pkg info コマンドは、パッケージに追加されたメタデータを表示します。
$ pkg info mypkg Name: mypkg Summary: This is an example package Description: This is a full description of all the interesting attributes of this example package. Category: Applications/Accessories State: Installed Publisher: mypublisher Version: 1.0 Build Release: 5.11 Branch: 0 Packaging Date: July 20, 2013 00:54:52 AM Size: 12.95 kB FMRI: pkg://mypublisher/mypkg@1.0,5.11-0:20130720T005452Z
pkg search コマンドは、mypkg によって配布されるファイルのクエリー検索時にヒットしたものを返します。
$ pkg search -l mycmd INDEX ACTION VALUE PACKAGE basename file opt/mysoftware/bin/mycmd pkg:/mypkg@1.0-0