JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Application Packaging Developer's Guide     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

1.  Designing a Package

2.  Building a Package

3.  Enhancing the Functionality of a Package (Tasks)

4.  Verifying and Transferring a Package

5.  Case Studies of Package Creation

Soliciting Input From the Administrator

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The request Script

Creating a File at Installation and Saving It During Removal

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The space File

The i.admin Class Action Script

The r.cfgdata Removal Script

Defining Package Compatibilities and Dependencies

Techniques

Approach

Case Study Files

The pkginfo File

The copyright File

The compver File

The depend File

Modifying a File by Using Standard Classes and Class Action Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The i.inittab Installation Class Action Script

The r.inittab Removal Class Action Script

The inittab File

Modifying a File by Using the sed Class and a postinstall Script

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The sed Class Action Script (/etc/inittab)

The postinstall Script

Modifying a File by Using The build Class

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The Build File

Modifying crontab Files During Installation

Techniques

Approach

Case Study Files

The pkginfo Command

The prototype File

The i.cron Installation Class Action Script

The r.cron Removal Class Action Script

crontab File #1

crontab File #2

Installing and Removing a Driver With Procedure Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The request Script

The postinstall Script

The preremove Script

Installing a Driver by Using the sed Class and Procedure Scripts

Techniques

Approach

Case Study Files

The pkginfo File

The prototype File

The sed Class Action Script (/etc/devlink.tab)

The postinstall Installation Script

The preremove Removal Script

The copyright File

6.  Advanced Techniques for Creating Packages

Glossary

Index

Soliciting Input From the Administrator

The package in this case study has three types of objects. The administrator may choose which of the three types to install and where to locate the objects on the installation machine.

Techniques

This case study demonstrates the following techniques:

Approach

To set up the selective installation in this case study, you must complete the following tasks:

Case Study Files

The pkginfo File

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

The prototype File

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

The request Script

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

Note that a request script can exit without leaving any files on the file system. For installations on Oracle Solaris versions prior to 2.5 and compatible versions (where no checkinstall script may be used) the request script is the correct place to test the file system in any manner necessary to ensure that the installation will succeed. When the request script exits with code 1, the installation will quit cleanly.

These example files show the use of parametric paths to establish multiple base directories. However, the preferred method involves use of the BASEDIR parameter which is managed and validated by the pkgadd command. Whenever multiple base directories are used, take special care to provide for installation of multiple versions and architectures on the same platform.