Create a file named checkinstall with your favorite text editor.
Save your changes and quit the editor when you are done.
Complete one of the following tasks.
If you want to create additional installation scripts, skip to the next task, How to Write Procedure Scripts.
If you have not created your prototype file, complete the procedure How to Create a prototype File by Using the pkgproto Command. Skip to Step 5.
If you have already created your prototype file, edit it and add an entry for the installation script you just created.
Build your package.
See How to Build a Package, if needed.
# checkinstall script for SUNWcadap # # This confirms the existence of the required specU database # First find which database package has been installed. pkginfo -q SUNWspcdA # try the older one if [ $? -ne 0 ]; then pkginfo -q SUNWspcdB # now the latest if [ $? -ne 0 ]; then # oops echo "No database package can be found. Please install the" echo "SpecU database package and try this installation again." exit 3 # Suspend else DBBASE="`pkgparam SUNWsbcdB BASEDIR`/db" # new DB software fi else DBBASE="`pkgparam SUNWspcdA BASEDIR`/db" # old DB software fi # Now look for the database file we will need for this installation if [ $DBBASE/specUlatte ]; then exit 0 # all OK else echo "No database file can be found. Please create the database" echo "using your installed specU software and try this" echo "installation again." exit 3 # Suspend fi
After you build the package, install it to confirm that it installs correctly and verify its integrity. Chapter 4, Verifying and Transferring a Package explains these tasks and provides step-by-step instructions on how to transfer your verified package to a distribution medium.