Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Managing HP-UX Software With SD-UX: HP 9000 Computers > Chapter 9 Creating Software Packages

Creating a Product Specification File (PSF)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

SD uses a "Product Specification File" (PSF) to define the physical product package. The PSF provides a "road map" that identifies the product according to its attributes, contents, compatibilities, dependencies and descriptions. The SD Product Specification File (PSF) drives the swpackage session. It describes how the product is structured and defines the attributes that apply to it.

The PSF can:

  • Define vendor information (optional) for groups of products (including all products), or for individual products.

  • Specify one or more products (required).

  • For each product, define attributes for one or more subproducts (optional), filesets (required), and files (required).

  • Define attributes for the distribution depot/media (optional).

  • Specify what computer(s) and operating system(s) the product supports.

  • Define attributes that describe the software objects.

Packaging Specification File Examples

Minimal PSF File

Here is an example of the minimum PSF file: one that includes only the required keywords:

product
tag SD
fileset
tag commands
file swcopy /usr/sbin/swcopy
NOTE: You must use an absolute path for the second file term in this minimum format.

Typical PSF File

Here is a portion of a typical PSF file; it describes the SD product:

# Vendor definition:
vendor
tag HP
title Hewlett-Packard Company
description < data/description.hp
end
# Product definition:
product
tag SD
title HP Software Distributor
revision B.10.20
number J2326AA
category system_management
description < data/description
copyright < data/copyright
readme < data/README
architecture HP-UX_10.20_700/800
machine_type 9000/[78]*
os_name HP-UX
os_release ?.10.20.*
directory /
is_locatable false
# Create a product script which executes during the swremove
# analysis phase. (This particular script returns an ERROR,
# which prevents the removal of the SD product.)
checkremove scripts/checkremove.sd
# Subproduct definitions:
subproduct
tag Manager
title Management Utilities
contents commands agent data man
end
subproduct
tag Agent
title Agent component
contents agent data man
end
# Fileset definitions:
fileset
tag commands
title Commands (management utilities)
revision 2.15
description < data/commands
# Control scripts:
configure scripts/configure.commands
# Dependencies
corequisite SD.data
# Files:
directory ./commands=/usr/sbin
file swinstall
file swcopy
[vellip]
directory ./nls=/usr/lib/nls/C
file swinstall.cat
file swpackage.cat
file swutil.cat
directory ./ui=/var/adm/sw/ui
file *
[vellip]
end # commands
# other filesets
[vellip]
fileset
tag man
title Manual pages for the Software Distributor
revision 2.05
directory ./man/man8=/usr/man/man8
file *
directory ./man/man4=/usr/man/man4
file *
directory ./man/man5=/usr/man/man5
file *
end #end of man fileset
end #end of SD product

From the above example, the packager can get all the information needed to package the product properly into a distribution depot.

PSF Syntax

Each SD object (product, subproduct, filesets, and file) has its own set of attributes and each attribute has a keyword that defines it. Most attributes are optional; they do not all need to be specified in the PSF. Each attribute has its own specific requirements, but the following rules apply:

  • Keyword syntax is:

        keyword value
  • All keywords require one or more values, except as noted. If the keyword is there but the value is missing, a warning message is generated and the keyword is ignored.

  • Place comments on a line by themselves or after the keyword-value syntax. Comment lines are designated by preceding them with #.

  • Use quotes when defining a value (for example, description ) that can span multiple lines. Quotes are not required when defining a single-line value that contains embedded whitespace.

  • Any errors encountered while reading the PSF cause swpackage to terminate. Errors are also logged to both stderr and the logfile.

PSF Object Syntax

The following table and sections describe the PSF keywords, the allowable values for each keyword, and the the syntax for the objects you can define in a PSF.

Table 9-1 Keywords Used in the Product Specification File

Class

Keyword

Value

Example

Depot

layout_version depot tag title description copyright number end

revision_string, 32 bytes tag_string, 16 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes multi_line_string, 8192 bytes tag_string, 32 bytes

1.0 APPLICATIONS_CD HP-UX Applications Software Disc </mfg/misc/depot/description </mfg/misc/depot/copyright B2358-13601

Vendor

vendor tag title description end

tag_string/version_comp., 16 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes

HP Hewlett-Packard Company </mfg/misc/vendor/desc

Category *

tag title description end

tag_string, 16 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes revision_string, 32 bytes

patch_normal Category of Patches For normal problems 0.0

Product (required)

product tag (required) revision title description vendor_tag copyright readme number category_tag is_locatable directory architecture machine_type os_name os_release os_version is_patch end

tag_string, 16 bytes revision_string, 32 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes multi_line_string, 8192 bytes tag_string, 16 bytes multi_line_string, 1 Mbyte tag_string, 32 bytes tag_string, 32 bytes boolean, 5 bytes path_string, 1024 bytes one_line_string, 80 bytes uname_string, 64 bytes uname_string, 32 bytes uname_string, 32 bytes uname_string, 32 bytes boolean, 5 bytes

SD B.10.20 HP Software Distributor </mfg/sd/data/description </mfg/sd/data/copyright HP </mfg/sd/data/README J2326AA patch_normal true /usr S700/800_HP-UX_10.20 9000/7*|9000/8* HP-UX ?.10.20.* [A-Z] false

Subproduct

subproduct tag title description contents end

tag_string, 16 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes one line list of fileset tag_strings

Manager SD Management Interfaces Subset </mfg/sd/data/manager/desc commands agent man data

Fileset (required)

fileset tag (required) revision pose.as.os.release title description ancestor is_kernel is_reboot prerequisite corequisite architecture machine_type os_name os_release os_version is_patch category_tag is_sparse supersedes end

tag_string, 16 bytes revision_string, 32 bytes uname_string, 32 bytes one_line_string, 80 bytes multi_line_string, 8192 bytes list of product, fileset boolean, 5 bytes boolean, 5 bytes software_specification software_specification one_line_string, 80 bytes uname_string, 64 bytes uname_string, 32 bytes uname_string, 32 bytes uname_string, 32 bytes boolean, 5 bytes tag_string, 16 bytes boolean, 5 bytes software_specification, 8192 bytes

man 1.42 B.10.20 SD Manual Pages </mfg/sd/data/man/desc OLDSD.MAN false false SD.agent SD.man HP-UX_10.20_700/800 9000/[78]* HP-UX ?.10.20.* ? false patch_normal false product.fileset,fr=revision

File

directory file (required) file (required) file_permiss.

path_mapping_string file_specification file_specification permission_string

/build/hpux/700/mfg/usr=/usr * -m 04555 sbin/swinstall -u 0222 -o root -g sys

Control Script

checkinstall preinstall postinstall configure unconfigure verify checkremove preremove postremove control_file

path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes path_string, 1024 bytes

/mfg/sd/scripts/checkinstall /mfg/sd/scripts/preinstall /mfg/sd/scripts/postinstall /mfg/sd/scripts/configure /mfg/sd/scripts/unconfigure /mfg/sd/scripts/verify /mfg/sd/scripts/checkremove /mfg/sd/scripts/preremove /mfg/sd/scripts/postremove /mfg/sd/scripts/subscripts

 

Selecting the PSF Layout Version

PSF syntax conforms to the layout_version=1.0 of the POSIX 1387.2 Software Administration standard. Previous versions of SD supported the POSIX layout_version=0.8 syntax, which continues to be supported.

You can select the layout version in the depot definition in the PSF file (see “Depot Class ” below) or with the layout_version option for swpackage, swmodify, swcopy, or swlist.

Differences between the two layout versions include the following:

  • The vendor is handled differently.

    For the current standard (layout_version=1.0), each vendor class definition is associated only with subsequent products or bundles that contain a vendor_tag attribute that matches the tag attribute within the vendor class definition.

    For the previous standard (layout_version=0.8 or if you do not specify a layout_version), products or bundles are automatically associated with the last vendor class you defined at the distribution level, or from a vendor that you define within the product or bundle. Explicitly defined vendor_tag attributes (with or without a value) take precedence.

  • The corequisites and prerequisites have singular titles for layout_version=0.8 (that is, corequisite and prerequisite). (See “Dependency Class ” below.)

  • Category objects and keywords are handled differently.

    For layout_version=1.0 (current standard):

    • category_tag is a valid product attribute that replaces the category and category_title attributes.

    • You can define category class objects.

    For layout_version=0.8 (previous standard:

    • category and category_title are valid product attributes that replace the category_tag attribute.

    • category class objects are not recognized.

For a more complete description of PSF requirements for layout_version=0.8, refer to the swpackage.4 manual page in a previous version of HP-UX.

PSF Value Types

The values for each attribute keyword in your PSF must be of a specific type discussed below.

NOTE: PSF syntax conforms to the layout_version=1.0 of the POSIX 1387.2 Software Administration standard. Previous versions of SD supported the POSIX layout_version=0.8 syntax, which continues to be supported. See “Selecting the PSF Layout Version” above for more information.

Title not available (PSF Value Types )

boolean

Maximum length: 5 bytes

  • Either true or false

file_specification

Maximum length: NA

  • Explicitly specifies a file to be packaged, using the format:

      [-m  mode] [-o [owner[,]][uid]] [-g [group[,]][gid]] [-v]
    [source] [destination]
  • The source and destination can be paths relative to source and destination directories specified in the path_mapping_string.

  • Can also use * direct swpackage to include all files below the source directory specified in the path_mapping_string.

Example: -m 04555 sbin/swinstall

multi_line_string

Maximum length: 8192 bytes; READMEs can be 1 Mbyte maximum size.

  • All ASCII characters in one or more paragraphs of text that can be specified in-line, surrounded by double-quotes, or stored in a file and specified using a filename.

The syntax for specifying a filename containing the multi_line_string is to use the redirection symbol.

Example: /mfg/sd/description

one_line_string

Maximum length: 80 bytes

  • All ASCII characters.

  • No white space characters, except for blank (i.e. space and tab), are allowed.

Example: Hewlett-Packard Company

path_string

Maximum length: 255 bytes for tapes, 1024 bytes for depots, 1024 bytes for source file pathnames.

  • An absolute or relative path to a file object.

Examples: /usr, /mfg/sd/scripts/configure

path_mapping_string

Maximum length: none

  • A value of the form source [=destination] where the source is the directory where source files are located. The optional destination maps the source to a directory in which the files will actually be installed.

Example: /build/hpux/700/mfg/usr=/usr

permission_string

Maximum length: none

  • A value of the form:

    [-m mode|-u umask] [-o[owner[,]][uid]] [-g[group[,]][gid]]

    where each component defines a default permissions value for every file defined in a fileset. The default values can be overridden in each file's specific definition. The owner and group fields are tag_strings. The uid and gid fields are unsigned integers. The mode and umask are unsigned integers which support only the octal character set: "0"-"7".

Example: -u 0222 -o root -g sys

revision_string

Maximum length: 32 bytes

  • Contains dot-separated one_line_string.

Example: A.09.00

software_specification

Maximum length: none

  • SD software specifications use this form:

    bundle[.product][.subproduct][.fileset][,version]
    or
    product[.subproduct][.fileset][,version]

    For version syntax, see version_component value type below.

    The \* software specification selects all products. It is not allowed when removing software from the root directory /.

Examples: SD.agent or SD,r=2.0,a=S700/800_HP-UX_9.0,v=HP

tag_string

Maximum length: 16 bytes

  • Requires one or more alphanumeric characters (A-Z, a-z, 0-9), including the first character.

  • White space characters are not allowed.

  • Directory path character, slash (/), is not allowed

  • SD metacharacters (. , : #) are not allowed

  • Shell metacharacters (;&(){}|<>" "` '\) are not allowed

Examples: HP, SD

uname_string

Maximum length: 64 bytes for machine_type, 32 bytes for other uname attributes. You can get uname attributes by using the uname(1) command on the system(s). These uname attributes are:

  • The machine hardware model name (machine_type).

  • The trademarked name of the operating system (os_name).

  • The current release number of the operating system (os_release).

  • The current version number of the operating system (os_version).

Syntax restrictions are:

  • uname strings of ASCII characters only.

  • White space characters are not allowed.

  • Shell pattern matching notations () are allowed.

  • Values can be separated using the vertical bar (|) to signify an "or" condition.

Examples: 9000/7*|9000/8*, HP-UX, ?.09.*, [A-Z]

version_component

Maximum length: none

  • Uses this form:

    [,r=revision][,a=arch][,v=vendor][,c=category]
    [,l=location][,fr=revision][,fa=arch]
    or
    [instance_id]

    where:

    • The (equal sign) can be replaced by: , , , , , or .

    • location applies only to installed software and refers only to software installed to a location other than the default product directory.

    • fr and fa apply only to filesets.

    • The instance_id specification is a number you can assign (in the IPD for the product — see “Installed Products Database ” in Chapter 2 “Installing and Copying Software ”) to further distinguish between similar versions. For example, Mysoft,3 would be the third version of the product Mysoft. Use this form only when you are sure of the product contents.

  • These rules apply:

    • No whitespace characters are allowed.

    • Each version specification is repeatable within the component (e.g. , ). If you use multiple components, the selection must match all components.

    • A relational operator (, , , , , , or ) performs an individual comparison on each dot-separated fields. For example, means choose all revisions that are greater than or equal to BB.10.00. Software is selected only when when matches within each field are satisfied.

    • Wildcards are not allowed with relational operators.

    • Use the (equals) relational operator to specify a particular version component. For swlist, swpackage, and swmodify, it also supports the shell pattern matching notations () or wildcards to specify more than one version of a software product.

    • Pattern matching notation () are allowed only with the relational operator.

Depot Class

The Depot attributes are designed for distribution tapes and CD-ROMs to allow you to list information about the media (that is, find out what media it is).

The Depot (tape) specification for a PSF looks like this:

depot
layout_version 1.0
tag APPLICATIONS_CD
title HP-UX Applications Software Disk
description </mfg/misc/depot/description
copyright </mfg/misc/depot/copyright
number B2358-13601

[<vendor specification>] optional
<product specification> required
[<product specification>] optional
[vellip]
end

Each keyword above defines an attribute of a distribution depot. The depot keyword is always required; all other attributes are optional.

Title not available (Depot Class )

layout_version

PSF syntax conforms to the layout_version=1.0 of the POSIX 1387.2 Software Administration standard. Previous versions of SD supported the POSIX layout_version=0.8 syntax, which continues to be supported. (You can also select the layout version with the layout_version option for swpackage, swmodify, swcopy, or swlist.) See “Selecting the PSF Layout Version” above for more information.

tag

The short name of the target depot (tape) being created/modified by swpackage.

title

The full name of the target depot (tape) being created/modified by swpackage.

description

The description of the target depot; either the text itself or a pointer to a filename that contains the text.

copyright

The text (or a pointer to a filename) for the copyright information for the depot's contents.

number

The part or manufacturing number of the distribution media (CD or tape depot).

end

Ends the depot specification, no value is required. This keyword is optional. If you use it and it is incorrectly placed, the specification will fail.

Vendor Class

The Vendor attributes let you add a description to the PSF.

NOTE: The layout_version keyword in the depot class affects how vendors are associated with products and bundles. See “Selecting the PSF Layout Version” and “Depot Class ” above for more information.

The Vendor specification looks like this:

vendor
tag HP
title Hewlett-Packard Company
description </mfg/misc/vendor/description
end

Each keyword defines an attribute of the vendor object.

Title not available (Vendor Class )

tag

The vendor's identifier. Associates this vendor object with a product or bundle. This tag attribute must match the vendor_tag attribute in the product or bundle.

title

A one-line string that further identifies the vendor.

description

A multi-line description of the vendor. The description value can be either the text itself or a filename that contains the text.

end

An optional keyword that ends the vendor specification, no value is required. If you use it and it is incorrectly placed, the specification will fail.

Category Class

The Category attributes let you add a description to the PSF.

NOTE: The layout_version keyword in the depot class affects how categories are associated with products and bundles. See “Selecting the PSF Layout Version” and “Depot Class ” above for more information.

The Category specification looks like this:

category
tag patch_normal
title Category of patches
description For normal problems
revision 0.0
end

Each keyword defines an attribute of the Category object. If a category specification is included in the PSF, swpackage requires only the category and tag keywords.

Title not available (Category Class )

tag

The category identifier. Associates this object with a product or bundle. This tag attribute must match the category_tag attribute in the product or bundle.

title

A one-line string that further identifies the category.

description

A multi-line description of the category. The description value can consist of text or a filename for a text file.

revision

The revision information (release number, version).

end

An optional keyword that ends the specification. No value is required. If you place this keyword incorrectly in the PSF, the specification will fail.

Product Class

The Product specification is a required class in the PSF. It lets you identify the product you are packaging.

NOTE: The layout_version keyword in the depot class affects how category and vendor objects are associated with products and bundles. See “Selecting the PSF Layout Version” and “Depot Class ” above for more information.

The Product specification looks like this:

  product
tag SD
revision 2.0
title Software Distributor
vendor_tag HP
description </mfg/sd/data/description
copyright </mfg/sd/data/copyright
readme </mfg/sd/data/README
number J2326AA
category_tag systems_management
is_locatable false
directory /usr
architecture Series_700/800_HP-UX_10.20
machine_type 9000/700*|9000/8*
os_name HP-UX
os_release ?.10.20.*
os_version [A-Z]
is_patch false

[<vendor specification>] optional
[<subproduct specification>] optional
[vellip]
[<control_script specification>] optional
[vellip]
<fileset specification> required
[<fileset specification>] optional
[vellip]
end

For each product object specified, swpackage requires only the product and tag keywords, plus one or more fileset specifications.

Title not available (Product Class )

tag

The product's identifier (name).

revision

The revision information (release number, version) for the product.

title

A one-line string that further identifies the product.

vendor_tag

Associates this product or bundle with a vendor object (defined separately in the PSF) if that object has a matching tag attribute.

description

A multi-line description of the product; either the text value itself or a filename that contains the text.

copyright

A multi-line description of the product's copyright; either the text value itself or a filename that contains the text.

readme

A text file of the README information for the product.

number

The part number of the product.

category_tag

Associates this product or bundle with a category object (defined separately in the PSF) if that object has a matching tag attribute.

The default value is an empty list or patch if the is_patch attribute is set to true.

NOTE: The category tag patch is reserved. When the is_patch product attribute is set to true, a built-in category_tag attribute of value patch is automatically included with the product definition.
is_locatable

Defines whether a product can be installed to any product directory, or whether it must be installed into a specific directory. The attribute can be set to "true" or "false." (If not defined, swpackage sets the default attribute to "false.")

directory

The default, absolute pathname to the directory in which the product will be installed. Defines the directory in which the product files are contained.

architecture

The UNIX target system on which the product will run. Provides a human-readable summary of the four uname attributes (machine_type, os_name, os_release and os_version).

machine_type

The machine type on which the product will run. If not specified, the keyword is assigned a wildcard value of *, meaning it will run on all machines. If there are multiple machine platforms, you must separate each machine designation with a | (vertical bar). For example, a keyword value of 9000/7*|9000/8* means the product will run on all HP Series 9000 Model 7XX or all HP 9000 Series 8XX machines. Alternatively, the value 9000/[78]* would also work. The value is matched against a UNIX target's uname -m result.

os_name

The operating system name on which the product will run. If not specified, the attribute is assigned a value of *, meaning it will run on all operating systems. The value is matched against a UNIX target's uname -s result.

os_release

The release number of the product's operating system. If not specified, the attribute is assigned a value of *, meaning it will run on all releases. The value is matched against a UNIX target's uname -r result.

os_version

The version number of the operating system. If not specified, the attribute is assigned a value of *, meaning it runs on any version. The value is matched against a UNIX target's uname -v result.

is_patch

A boolean flag that identifies a software object as a patch. The default value is false. When set to true, a built-in category_tag attribute of value patch is automatically included with the product definition.

end

Ends the product specification, no value is required. This keyword is optional. If you use it and it is incorrectly placed, the specification will fail.

Subproduct Class

The Subproduct specification lets you group filesets within a larger Product specification. Subproducts are optional. A Subproduct specification looks like this:

 subproduct
tag Manager
title SD Management Interfaces Subset
description </mfg/sd/data/manager/description
contents manager agent packager man doc
end

If a subproduct object is specified, swpackage requires the subproduct, tag and contents keywords.

Title not available (Subproduct Class )

tag

The subproduct's identifier.

title

A one-line string that further identifies the subproduct.

description

A multi-line description of the subproduct; either the text value itself, or a filename that contains the text.

contents

A whitespace-separated list of the filesets that comprise the subproduct (that is, contents fileset fileset fileset fileset...).

In the PSF, fileset definitions are not contained within the scope of subproduct definitions. The contents keyword is used to assign filesets to subproducts. This linkage allows a fileset to be contained in multiple subproducts.

end

Ends the subproduct specification, no value is required. This keyword is optional. If you use it and it is incorrectly placed, the specification will fail.

Fileset Class

The Fileset specification is required in the PSF. Use Filesets to group files together.

A Fileset Specification looks like this:

fileset
tag manB
revision 1.42
pose.as.os.release B.10.10
title SD Manual Page
description </mfg/sd/data/man/description
ancestor OLDSD.MAN
is_kernel false
is_reboot false
prerequisite SD.agent,r>=2.0
corequisite SD.man,r>=2.0
architecture HP-UX_10.20_700/800
machine_type 9000/[78]*
os_name HP-UX
os_release ?.10.20.*
os_version ?
is_patch false
category_tag manpg
is_sparse false
supersedes product.fileset,fr=revision

[<control script specification>] optional
[vellip]
[<dependency specification>] optional
[vellip]
<file specification> required
[<file specification>] optional
[vellip]
end

For each fileset object specified, swpackage requires the fileset and tag keywords, plus one or more file specifications.

Title not available (Fileset Class )

tag

The fileset identifier.

revision

The revision number or version of the fileset.

pose.as.os.release

Overrides the existing os_version attribute of any target to which the fileset is being installed.

title

A one-line string that further identifies the fileset.

description

A multi-line description of the fileset; either the text value itself or a filename that contains the text.

ancestor

If the swinstall.match_target option is set to "true," this attribute causes the current fileset to be selected if the product.fileset specified as an ancestor exists on the UNIX Target system. Note that the only items allowed in an ancestor attribute are the product and fileset names, separated by a period. You can specify multiple ancestor attribute lines.

is_kernel

Defines a fileset to be a contributor to an operating system's kernel. The attribute can be set to "true" or "false." If not specified, swpackage sets this attribute to "false."

is_reboot

Declares that a fileset requires a system reboot after installation. The attribute can be "true" or "false." If not specified, swpackage sets this attribute to "false."

corequisites

Defines a run-time dependency on another software object. For this fileset to correctly operate, the other software must be installed and configured. See “Dependency Class ” below.

prerequisites

Defines an install-time dependency on another software object. For this fileset to be correctly installed (or configured), the other software must be installed (or configured). See “Dependency Class ” below.

architecture

Describes the target system(s) on which the product will run. Provides a human-readable summary of the four uname(1) attributes which define the exact target system(s) the product supports.

machine_type

Defines the machine on which the product will run. If not specified, swpackage assigns a value of *, meaning the product runs on all machines. If there are multiple machine platforms, use wildcards or the | character to identify them. This attribute should match the value of uname -m on the supported target machine(s).

os_name

Defines the operating system on which the product will run. If not specified, swpackage assigns a value of *, meaning the product runs on all operating systems. If there are multiple operating systems, use wildcards or the | character to identify them. This attribute should match the value of uname -s on the supported target system.

os_release

Defines the operating system release on which the product will run. If not specified, swpackage assigns a value of *, meaning the product runs on all releases. If there are multiple operating system releases, use wildcards or the | character to identify them. This attribute should match the value of uname -r on the supported target system.

os_version

Defines the operating system version on which the product will run. If not specified, swpackage assigns a value of *, meaning the product runs on all OS versions. If there are multiple operating system versions, use wildcards or the | character to identify them. This attribute should match the value of uname -v on the supported target system.

category_tag

Associates this file with a category object (defined separately in the PSF) if that object has a matching tag attribute.

The default value is an empty list or patch if the is_patch attribute is set to true.

NOTE: The category tag patch is reserved. When the is_patch file attribute is set to true, a built-in category_tag attribute of value patch is automatically included with the file definition.
is_patch

A boolean flag that identifies a software object as a patch. The default value is false. When set to true, a built-in category_tag attribute of value patch is automatically included with the product definition.

is_sparse

A boolean flag that indicates a fileset contains only a subset of files in the base (ancestor) fileset and that the contents are to be merged with the base fileset. The default value is false. If the is_patch attribute is true, the is_sparse attribute is also set to true.

supersedes

Indicates when a patch is replaced by (or merged into) a later patch. The attribute indicates which previous patches are replaced by the patch being installed or copied. This attribute value is a list of software specifications of other patches that this patch "supersedes".

end

Optional keyword to end the fileset specification. No value is required. If you place this keyword incorrectly, the file specification will fail.

Dependency Class

You can use the PSF to specify dependencies between filesets. You can also define dependencies between:

  • A fileset and another product (namely, a subset of that product).

  • A particular fileset within that product.

  • The entire product.

Dependencies are defined within the fileset class definition. (See “Fileset Class ” above.)

SD supports two types of dependencies:

Title not available (Dependency Class )

Corequisites

A corequisite dependency states that a fileset requires another software to operate correctly.

NOTE: A corequisite dependency DOES NOT IMPLY ANY LOAD ORDER (run-time dependency).
Prerequisites

A prerequisite dependency states that a fileset requires the other software to be installed and/or configured correctly BEFORE it can be installed and configured. Prerequisites control the order of an installation with swinstall. (Install-time dependency).

The swinstall, swcopy, swverify, and swremove commands understand dependencies. You can control whether dependencies must be present to install the software. By default, swinstall will not install unless dependencies can be met.

NOTE: A dependency must always be specified using a software specification that starts with the product tag for the requisite software.

Control Script Class

SD supports execution of product and fileset control scripts that allow you to perform additional checks and operations beyond those supported by SD. The swinstall, swconfig, swverify, and swremove commands each execute one or more vendor supplied scripts. All these scripts are optional.

For a complete description of Control Scripts and guidelines for their use, see Appendix B “Control Scripts ”.

File Class

Within a fileset specification, you can specify the following file types to be packaged into the fileset by swpackage:

  • control script

  • regular file

  • directory

  • hard link

  • symbolic link

Control scripts are fully described in Appendix B “Control Scripts ”. If a recognized unpackageable file type or an unrecognized file type is given, an error message is printed.

The swpackage command supports these mechanisms for specifying the files contained in a fileset:

Title not available (File Class )

directory mapping

You can point swpackage at a source directory in which the fileset's files are located. In addition, you can map this source directory to the appropriate (destination) directory in which this subset of the product's files will be located.

recursive (implicit) file specification

If directory mapping is active, you can simply tell swpackage to recursively include all files in the directory into the fileset.

explicit file specification

For all or some of the files in the fileset, you can name each source file and destination location.

default permission specification

For all or some of the files in the fileset, you can define a default set of permissions.

These mechanisms can all be used in combination with the others.

Directory Mapping

(Optional) The directory source [= destination] specification defines the source directory under which subsequently listed files are located. In addition, you can map the source directory to a destination directory under which the packaged files will be installed.

For example, the definition:

directory /build/hpux/700/mfg/usr = /usr

causes files from the /build/hpux/700/mfg/ directory to have the prefix /usr when installed. The destination directory must be a superset of the product's directory attribute, if defined in the product specification. If the product's directory is defined, and the destination is not a superset, swpackage generates an error.

The destination directory must be an absolute pathname. If not, then swpackage generates an error.

The source directory can be either an absolute pathname, or a relative pathname. If relative, swpackage interprets it relative to the current working directory in which the command was invoked.

If the source directory does not exist, swpackage generates an error.

Recursive File Specification

The file * keyword directs swpackage to include every file (and directory) within the current source directory in the fileset. swpackage attempts to include the entire, recursive contents of the source directory in the fileset. (Partial wildcarding is not supported, e.g. file dm* to indicate all files starting with "dm".)

The directory keyword must have been previously specified before the file * specification can be used. If not, swpackage generates an error.

When processing the directory recursively, swpackage encounters the following errors:

  • Cannot search directory (permission denied)

  • Cannot read the file (permission denied)

  • Unsupported file type encountered

All attributes for the destination file object are taken from the source file, unless a file_permission keyword is active (this keyword is described below).

The user can specify multiple pairs of

directory  source[=destination]
file *

to gather all files from different source directories into a single fileset.

If you do not want to recursively include all files and directories, use the explicit file specification.

Explicit File Specification

You can explicitly specify the files to be packaged into a fileset. If you want to recursively include all files and directories, use the recursive file specification (file *).

You can use the directory keyword to define a source (and destination) for explicitly specified files. If no directory keyword is active, then the full source path and the absolute destination path must be specified for each file. An explicit file specification overrides or adds to, on a file-by-file basis, the specifications set by the directory and/or file_permissions keywords.

An explicit file specification uses this form:

file [-m mode] [-o [owner[,]][uid]] [-g [group[,]][gid]] [-v] source [destination]

Title not available (Explicit File Specification )

file

This keyword specifies an existing file (usually within the currently active source directory) to include in the fileset.

-m mode

This option defines the (octal) mode for a file or directory at its destination.

-o [owner[,]][uid]

This option defines the file's owner name and/or uid at its destination. If only the owner is specified, then the owner and uid attributes are set for the destination file based on the packaging host's /etc/passwd. If only the uid is specified, it is set as the destination's uid and no owner name is assigned. If both are specified, each sets the corresponding attribute for the file object.

During an installation, the owner attribute is used to set the owner name and uid, unless the owner name is not specified or is not defined in the UNIX Target system's /etc/passwd. In this case, the uid attribute is used to set the uid.

-g [group[,]][gid]

This option defines the file's group name and/or gid at its destination. If only the group is specified, then the group and gid attributes are set for the destination file based on the packaging host's /etc/group. If only the gid specified, it is set as the destination's gid attribute and no group name is assigned. If both are specified, each sets the corresponding attribute for the file object.

During an installation, the group attribute is used to set the group name and gid, unless the group name is not specified or is not defined in the UNIX Target system's /etc/group. In this case, the gid attribute is used to set the gid.

-v

This option marks the file as volatile, meaning it can be modified (that is, deleted) after it is installed without impacting the fileset.

Files that may have their attributes (size, last modified time, etc.) changed through normal use after they are installed should be specified in the PSF file as volatile (by specifying -v on the line defining the file). swverify will not, by default, check file attributes for files that have the is_volatile attribute set to "true" (see the check_volatile option for swverify).

source

This value defines the path to a file you want to include in the package.

If this is a relative path, swpackage will search for it relative to the source directory set by the directory keyword. If no source directory is active, swpackage will search for it relative to the current working directory in which the command was invoked.

All attributes for the destination file object are taken from the source file, unless a file_permission keyword is active, or the -m, -o, or -g options are also included in the file specification.

destination

This value defines the destination path at which the file will be installed. If destination is a relative path, the active destination directory set by the directory keyword will be prefixed to it. If it is a relative path, and no destination directory is active, swpackage generates an error. If the destination is not specified, then the source path is used as the destination, with the appropriate mapping done with the active destination directory (if any).

When processing existing files in a source directory, swpackage identifies the following four kinds of errors:

  • Cannot search directory (permission denied)

  • Cannot read the file (permission denied)

  • Unsupported file type encountered (source file must be a control script, regular file, directory, hard link or symbolic link)

  • File does not exist

Example File Specifications

The following examples illustrate the use of the directory and file keywords.

  • Include all files under /build/hpux/700/mfg to be rooted under /usr:

    directory  /build/hpux/700/mfg=/usr
    file *
  • Include only certain files under /build/hpux/700/mfg/, to be rooted under /usr and /var/adm/sw:

    directory /build/hpux/700/mfg=/usr
    file sbin/swinstall
    file sbin/swcopy
    [vellip]
    directory /build/hpux/700/mfg=/var/adm/sw
    file nls/swinstall.cat nls/en_US.88591/swinstall.cat
    file defaults newconfig/defaults
    file defaults defaults
  • Explicitly list files, no directory mapping specified:

    file  /build/hpux/700/mfg/usr/bin/swinstall /usr/sbin/swinstall
    file /build/hpux/700/mfg/usr/bin/swcopy /usr/sbin/swcopy
    file /build/hpux/700/mfg/data/nls/swinstall.cat
    /var/adm/sw/nls/en_US.88591/swinstall.cat
    file /build/hpux/700/mfg/data/defaults /var/adm/sw/newconfig/defaults
    file /build/hpux/700/mfg/data/defaults /var/adm/sw/defaults
  • Use all specification types to include files:

    directory  /build/hpux/700/mfg/usr=/usr
    file *
    directory /build/hpux/700/mfg/data=/var/adm/sw
    file defaults newconfig/defaults
    file /build/hpux/700/mfg/data/defaults=/var/adm/sw/defaults
Permission Specifications

By default, a destination file will inherit the mode, owner, and group of the source file. You can use the file_permissions keyword to set a default permission mask, owner, and group for all the files being packaged into the fileset:

file_permissions [-m mode| -u umask] [-o [owner[,]] [uid]] [-g [group[,]][gid]]

Title not available (Permission Specifications )

file_permissions

This keyword applies only to the fileset in which it is defined. You can specify multiple file_permissions; later definitions replace previous definitions.

-m mode

This option defines a default (octal) mode for all files.

-u umask

Instead of specifying an octal mode as the default, you can specify an octal umask (1) value that gets "subtracted" from an existing source file's mode to generate the mode of the destination file.

By specifying a umask, you can set a default mode for executable files, non-executable files, and directories. (A specific mode can be set for any file using -m.)

-o [owner[,]][uid]

This option defines the destination file's owner name and/or or uid. See the discussion of the -o option in the "Explicit File Specification" section above.

-g [group[,]][gid]

This option defines the destination file's group name and/or or gid. See the discussion of the -g option in the "Explicit File Specification" section above.

Example Permission Specifications

The following examples illustrate the use of the file_permission keyword.

  • Set a read only 444 mode for all file objects (requires override for every executable file and directory):

        file_permissions  -m 444
  • Set a read mode for non-executable files, and a read/execute mode for executable files and directories:

    file_permissions  -u 222
  • Set the same mode defaults, plus an owner and group:

    file_permissions  -u 222  -o bin  -g bin
  • Set the same mode defaults, plus a uid and gid:

    file_permissions  -u 222  -o 2  -g 2
  • Set the owner write permission in addition to the above:

    file_permissions  -u 022  -o 2  -g 2
  • If you do not define file_permissions, swpackage uses the default value file_permissions -u 000 for destination file objects based on existing source files. (Meaning the mode, owner/uid, group/gid are set based on the source file, unless specific overrides are specified for a destination file.)

Re-Specifying Files

In addition to being able to specify files as a group (with file *) for general attributes, the PSF also allows you to "re-specify" files within that definition to modify individual attributes.

For example, suppose you wanted to specify all the files in a fileset which contained 100 files. All these files were to be recursively "discovered" and packaged into the fileset. Most of them would have the same owner, group, and mode (and other file attributes).

But, out of those 100 files, there might be five that are volatile (that is, you don't care if they get modified or deleted). So, instead of listing all 100 files individually, and using the -v option for the five, you could specify all 100 with file * and then modify the five individually in their own way:

        directory source = /product file *

file -v 1
file -v 2
file -v 3
file -v 4
file -v 5

This also works well for permissions. If nearly all the 100 files above had the same permission attributes, but three should have a different owner and mode, you could specify:

        directory  source = /product

file_permissions -o bin -g bin -m 555
file *

file_permissions -o root -g other -m -04555
file 1
file 2
file 3

Essentially, this capability combines the recursive file specifications function with explicit file specification (as described above).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.