Pkgmk

Description

A basic task for invoking the pkgmk, pkgtrans and pkgproto executables to build a Solaris installation file. The task works only on Solaris. See the 'Application Packaging Developer's Guide' Answerbook (easily found on the web) and the respective man pages for more information on these tools.

Parameters

Attribute Description Required
checkinstallscript The path and filename of the checkinstall script. It can be the absolute path or relative to the working directory. No
copyrightfile The path and filename of the copyright file. It can be the absolute path or relative to the working directory. No
checkinstallscript The path and filename of the checkinstall script. It can be the absolute path or relative to the working directory. No (default project directory)
destdir The directory into which the package file will be written. No (default is the ant project directory)
installbase The root directory in which all of the package files will be installed in. The final installation directory of the package is <pkgbasedir>/<installbasedir> No
output The filename for the generated package file which is can be supplied as input into the pkgadd command. The file is written to destdir. Yes
overwrite Causes the '-o' command line argument to be specified when running the pkgmk and pkgtrans commands. If true, older packages of the same name are overwritten if they exist. No (default=true)
pkgarch The ARCH parameter in the pkginfo file identifies which architectures are associated with the package. The architecture name has a maximum length of 16 alphanumeric characters. If a package is associated with more than one architecture, specify them in a comma-separated list. No (default='sparc')
pkgbasedir The default installation directory on the target machine. No (default='/opt')
pkgcategory The CATEGORY parameter in the pkginfo file specifies in which categories a package belongs. At a minimum, a package must belong to either the system or application category. Category names:
  • Are alphanumeric.
  • Have a maximum length of 16 characters.
  • Are case insensitive.
If a package belongs to more than one category, specify them in a comma-separated list.
No (default='application')
pkgdesc This attribute corresponds to the NAME field in the pkginfo file. The pkgname attribute is used for the PKG field instead. A package name is the full name of the package, which is defined via the NAME parameter in the pkginfo file. Because system administrators often use package names to determine whether or not a package needs to be installed, it is important to write clear, concise, and complete package names. Package names should
  • State when a package is needed (for example, to provide certain commands or functionality, or state if it is needed for specific hardware).
  • State what the package is used for (for example, the development of device drivers).
  • Include a description of the package abbreviation mnemonic, using key words that indicate the abbreviation is a short form of the description (for example, the package name for the package abbreviation SUNWbnuu is "Basic Networking UUCP Utilities, (Usr)").
  • Name the partition into which the package is installed.
  • Use terms consistently with their industry meaning.
  • Take advantage of the 256 character limit.
No (default='application')
pkgname A package abbreviation is a short name for a package that is defined via the PKG parameter in the pkginfo file, and must:
  • Be alphanumeric, but the first cannot be numeric.
  • Be nine or fewer characters.
  • Not be one of the reserved abbreviations install, new, and all.
Yes
pkgversion The VERSION parameter in the pkginfo file identifies the version of the package. The version has a maximum length of 256 ASCII characters, and cannot begin with a left parenthesis. Yes
postinstallscript The path and filename of the postinstall script. It can be the absolute path or relative to the working directory. No
postremovescript The path and filename of the postremove script. It can be the absolute path or relative to the working directory. No
preinstallscript The path and filename of the preinstall script. It can be the absolute path or relative to the working directory. No
preremovescript The path and filename of the preremove script. It can be the absolute path or relative to the working directory. No
prototype The path and filename of the prototype file. It can be the absolute path or relative to the working directory. If not specified, one is generated using the related attributes in the task (i.e. preinstallscript, copyrightfile, etc.) as well as any PrototypeEntry subelements that are specified. No
request The path and filename of the request script. It can be the absolute path or relative to the working directory. No
srcdir The path of the directory containing the package files. It can be the absolute path or relative to the working directory. This is only used if the prototype attribute is not specified, in which case the pkgproto tool is used to create a default one using this directory as the its input. No
workingdir The path of the temporary directory that will be created and in which the intermediate pkgmk files are written. No
owner The name of the Solaris user account that is to own the directories and files installed. No (uses the actual owner of files as they exist under 'srcdir' if the prototype file is being generated or the owner specified in the prototype entries if the prototype file is supplied)
group The name of the Solaris group that is to own the directories and files installed. No (uses the actual group of files as they exist under 'srcdir' if the prototype file is being generated or the owner specified in the prototype entries if the prototype file is supplied)

Nested Elements

PrototypeEntry

Each PrototypeEntry element specifies one entry exactly to be written to the prototype file.

Example

   <pkgmk srcdir="mydist" destdir="." output="MYPKG-sparc-local.pkg" 
        pkgname="COMapp"  
        installbase="appbasedir"
        pkgdesc="This is just an example package."
        requestscript="pkg/request" 
        checkinstallscript="pkg/checkinstall"
        preinstallscript="pkg/preinstall" 
        postinstallscript="pkg/postinstall" 
        preremovescript="pkg/preremove" 
        postremovescript="pkg/postinstall" 
        overwrite="true" 
        owner="nobody" group="other"
        pkgversion="Alpha 0.0" >
      <prototypeentry>a custom prototype entry</prototypeentry>
   </pkgmk>

Creates an installable package file named 'MYPKG-sparc-local-.pkg' in the project directory. The directories and files included in the package are those under the directory 'mydist.' When installed on a Solaris machine, the package will be registered as 'COMapp' and its parent directory will be named 'appbasedir.' The other information regarding the installed package can be queried on the Solaris machine using pkginfo (i.e. NAME, VERSION, ARCH, etc.) The specified request/install/remove scripts are also included in the package and run during pkgadd execution. The installed package files are owned by the Solaris user named 'nobody' and belong to the Solaris group named 'other.' The optional prototypeentry(s) is taken as a literal string to be written to the prototype file. See the prototype man page for details on the format of these entries.


Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.