swpackage(4) — Hewlett-Packard Company
NAME
swpackage − product specification file (PSF) format
Remarks:
SD-UX commands are included with the HP-UX Operating System and manage software on the local host only. To install and manage software simultaneously on multiple remote hosts (including PCs) from a central controller, you must purchase the HP OpenView Software Distributor (HP Prod. No. B1996AA) which provides extended software management, multi-site software distribution capabilities and distribution to PCs. While most of the information in this manual page applies to both SD-UX commands and the OpenView product, some applies only to the OpenView product. Where this is the case, you will see:
The following xxx applies only to HP OpenView Software Distributor
DESCRIPTION
The swpackage command packages software into:
• a distribution directory (which can be accessed directly, or copied onto a CD-ROM),
• a distribution tape (such as DDS, nine-track or cartridge tapes).
Both directory and tape distributions use the same format. See sd(4) for details on this format.
The software is organized into a four-level hierarchy of software objects: bundles,products,subproducts, and filesets. The actual files that make up a software package are contained in filesets which in turn are contained in products. Bundles and subproducts are optional levels used to specify additional groupings of software. Each level of the software hierarchy has attributes associated with them (described below).
A Product Specification File (PSF) drives the swpackage command. It defines how a product is structured, and the attributes that apply to it. This manual page describes the syntax and semantics of a PSF.
The syntax described here conforms to the layout_version=1.0 of the POSIX 1387.2 Software Administration standard. The previous SD layout_version=0.8 is also supported. In that version, the vendor object is handled in a slightly different manner, described below, and the keywords corequisites, and prerequisites, have different (singular) names. What layout_version the SD commands write is controlled by the layout_version option for swpackage, swmodify, swcopy, and swlist. The version of the parser used by swpackage can be controlled by specifying the layout_version attribute in the PSF file. One exception is that the is_locatable attribute now defaults to true in all cases, and must be explicitly set to false.
For a description of the actual swpackage command, see the swpackage(1M) manual page by typing:
man swpackage
PRODUCT SPECIFICATION FILE SYNTAX
A PSF is structured as follows:
[<distribution specification>]
[<vendor specification>]
[<bundle specification>]
...
[<vendor specification>]
<product specification>
[<subproduct specifications>]
[<control script specifications>]
<fileset specification>
[<control script specifications>]
<file specifications>
[<fileset specification>]
...
[<vendor specification>]
[<product specification>]
...
In summary, the swpackage user can:
• Specify one or more products.
• For each product, specify one or more filesets.
• For each fileset, specify one or more files.
• (optional) Specify attributes for the target depot or tape.
• (optional) Specify one or more bundles, defining the bundle contents.
• (optional) Specify vendor information to be used with subsequent products and bundles.
• (optional) For each product, specify one or more subproducts, defining the subproduct contents.
• (optional) For each product or fileset, specify one or more control scripts.
There are attributes associated with each object that the user can define. All objects and attributes are defined using a
keyword value
syntax. The keyword is an identifier for the attribute. Most attributes are optional. There are specific rules for each keyword, as described below. The following rules generally apply:
• All keywords require one or more values, except as noted. If the value is missing an error is given.
• Comments can be placed on a line by themselves or after the keyword-value syntax. They are designated by preceding them with #.
• The use of double quotes ("") is required when defining a value (e.g. description ) which spans multiple lines.
• The use of double quotes (") is not required when defining a value that contains embedded whitespace. The quotes can be used, however.
Attribute Table
The following tables summarize the objects and attributes which can be defined in a PSF.
| Keyword | Type | Size | Example |
| distribution | |||
| layout_version | revision_string | 32 | 1.0 |
| tag | tag_string | 16 | EXAMPLE_DEPOT |
| title | one_line_string | 80 | Example packages |
| description | multi_line_string | 8K | < data/descr.depot |
| copyright | multi_line_string | 8K | < data/copyr.depot |
| number | tag_string | 16 | B2358-13601 |
| end | |||
| vendor | |||
| tag | tag_string | 16 | HP |
| uuid | hex_string | 40 | 12367-CDEF-0123-4569 |
| title | one_line_string | 80 | Hewlett-Packard Co. |
| description | multi_line_string | 8K | < data/descr.hp |
| end | |||
| product or bundle | |||
| * tag | tag_string | 16 | SD |
| * revision | revision_string | 32 | A.01.00 |
| * architecture | one_line_string | 80 | HP-UX_9.00_700/800 |
| * vendor_tag | tag_string | 16 | HP |
| title | one_line_string | 80 | Software Distributor |
| description | multi_line_string | 8K | < data/descr.sd |
| copyright | multi_line_string | 8K | < data/copyr.sd |
| number | tag_string | 16 | B1991A |
| category | tag_string | 16 | systems_mgmt |
| category_title | one_line_string | 80 | Systems Management |
| + readme | multi_line_string | 1024K | < data/README.sd |
| + directory | path_string | 1024 | / |
| + share_link | one-line_string | 80 | |
| + is_locatable | boolean | 5 | false |
| - contents | repeatable list | 8K | pr.fs,r=1.0,a=,v= |
| of software_specs | |||
| machine_type | uname_string | 64 | 9000/[78]* |
| os_name | uname_string | 32 | HP-UX |
| os_release | uname_string | 32 | ?.09.* |
| os_version | uname_string | 32 | ? |
| end |
The attributes marked with a * determine the uniqueness of a product or bundle definition. Their values are also of type version_component, in addition to the defined type above.
Note: Keywords marked with a + apply to products only. Keywords marked with a - apply to bundles only.
Attribute Table (continued)
| Keyword | Type | Size | Example |
| subproduct | |||
| tag | tag_string | 16 | Manager |
| title | one_line_string | 80 | Management Utilities |
| description | multi_line_string | 8K | < data/desc.mgr |
| contents | one-line list of | commands agent data man | |
| tag_string values | |||
| end | |||
| fileset | |||
| tag | tag_string | 16 | commands |
| revision | revision_string | 32 | 2.42 |
| title | one_line_string | 80 | SD Commands |
| description | multi_line_string | 8K | < data/descr.cmd |
| is_kernel | boolean | 5 | false |
| is_reboot | boolean | 5 | false |
| prerequisites | software_spec | SD.agent,r>=2.0 | |
| corequisites | software_spec | SD.man,r>=2.0 | |
| ancestor | repeatable list | product.oldfileset | |
| of product.fileset | oldproduct.fileset | ||
| directory | path_mapping_string | ./commands = /usr/sbin | |
| file | file specification | -m 04555 bin/swinstall | |
| (or) * | |||
| file_ | permission_string | -u 0222 -o root -g sys | |
| permissions | |||
| end |
Attribute Table (continued)
| Keyword | Type | Size | Example |
| control_file | |||
| checkinstall | path_string | 1024 | ./scripts/checkinstall |
| preinstall | path_string | 1024 | ./scripts/preinstall |
| postinstall | path_string | 1024 | ./scripts/postinstall |
| configure | path_string | 1024 | ./scripts/configure |
| unconfigure | path_string | 1024 | ./scripts/unconfigure |
| verify | path_string | 1024 | ./scripts/verify |
| checkremove | path_string | 1024 | ./scripts/checkremove |
| preremove | path_string | 1024 | ./scripts/preremove |
| postremove | path_string | 1024 | ./scripts/postremove |
| unpreinstall | path_string | 1024 | ./scripts/unpreinstall |
| unpostinstall | path_string | 1024 | ./scripts/unpostinstall |
| control_file | path_string | 1024 | ./scripts/subscripts |
Control files can be defined for filesets and/or products.
Value Types
The value for each attribute must be of a specific type (as noted in the table above). The types are:
tag_string
maximum length: 16 bytes
examples: HP, SD
Tag strings support a subset of isascii(3) characters only:
Requires one or more characters from: "A-Z", "a-z", "0-9", including the first character.
The isspace(3) characters are not allowed.
SDU metacharacters not allowed: .,:=
Shell metacharacters not allowed: #;&(){}|<>
Shell quoting characters not allowed: "‘’\
Directory path character not allowed: /
hex_string
maximimum length: 40 bytes
examples: 01234567-CDEF-0123-4569ABCDEF
Uuids composed of 32 hexadecimal digits separated by dashes.
Represents an unsigned integer. (Each hex digit represents 4 bits of the unsigned integer.)
Allows hexadecimal digits: 0-9, A-F
Allows separator characters: -
one_line_string
maximum length: 80 bytes
examples: Hewlett-Packard Company
One-line strings support a subset of isascii(3) characters only:
No isspace(3) characters, except for space and tab, are allowed.
multi_line_string
maximum length: 8K, or 1024K bytes
Multi-line strings support all isascii(3) characters. They represent one or more paragraphs of text. They can be specified in-line, surrounded by double-quotes. They can also be stored in a file, and specified using the "< filename" format.
revision_string
maximum length: 32 bytes
examples: 2.0, A.09.00
Revision strings contain zero or more dot-separated one_line_strings (above).
boolean
maximum length: 5 bytes
examples: true, false
One of the values "true" or "false".
path_string
maximum length: 255 bytes for tapes, 1024 bytes for depots
examples: /usr, /mfg/sd/scripts/configure
An absolute or relative path to a file. Many attributes of this type are restricted to 255 bytes in length. This restriction is due to the tar(1) command, which requires a file’s basename(1) be <= 100 bytes, and a file’s dirname(1) to be <= 155 bytes. (Some implementations of tar enforce < and not <=.)
uname_string
maximum length: 32 or 64 bytes
examples: 9000/7*|9000/8*, HP-UX, ?.09.*, [A-Z]
Uname strings containing a subset of isascii(3) characters only.
No isspace(3) characters are allowed.
Shell pattern matching notation allowed: []*?!
Patterns can be "or’ed" together using the separator: |
path_mapping_string
maximum length: none
examples: /mfg/sd/files/usr = /usr
A value of the form: "source [= destination]" where the source defines the directory in which subsequently defined files are located. The optional destination maps the source to a destination directory in which the files will actually be installed.
file_specification
maximum length: none
examples: -m 04555 sbin/swinstall or * (to denote all files and directories)
Explicitly specifies a file or directory to be packaged, using the format:
[-m mode] [-o [owner[,]][uid]] [-g [group[,]][gid]] [-v] .br [source] [destination]
The source and destination can be paths relative to source and destination directories specified in the path_mapping_string.
You can also use * to include all files below the source directory specified in the path_mapping_string.
permission_string
maximum length: none
examples: -u 0222 -o root -g sys
A value of the form:
[-m mode|-u umask ] [-o [owner[,]][uid]] [-g [group[,]][gid]]
where each component defines a default permissions value for each file and directory defined in a fileset. The default values can be overridden in each file’s specific definition. The owner and group fields are of type tag_string. The uid and gid fields are of type unsigned integer. The mode and umask are unsigned integers, but only supports the octal character set: "0"-"7".
software_spec
maximum length: none
examples: SD.agent or SD,r=2.0,a=HP-UX_A.09.00_700,v=HP
An SD software specification is of the form:
bundle[.product[.subproduct][.fileset]][,version]
or
product[.subproduct][.fileset][,version]
where the version component (see below) has the form:
[r=revision][,a=arch][,v=vendor][,c=category]
Valid forms for bundles are: bundle, bundle.product, bundle.product.fileset and bundle.product.subproduct. Valid forms for products are: product, product.subproduct and product.fileset.
Fully qualified software specs include the r=, a=, and v=, version components even if they are empty strings.
version_component
maximum length: none
A further explanation for the tag, revision, architecture, vendor, and category, attributes.
The = operator (as in r=revision, etc.) can be of the form: =, ==, >=, <=, <, >, or != and applies only to bundle and product dot-separated fields.
No isspace(3) characters are allowed.
Shell pattern matching notations []*?! are allowed. They may only be used with the = (equals) relational operator, not with the relational operators {==,<=,>=,<,>,!=}. For example, r=[34].* means to specify "all revisions equal to 3 or 4 ."
PRODUCT SPECIFICATION FILE SEMANTICS
The following sections describe the attributes which can be defined.
Distribution (Depot) Specification
distribution or depot
layout_version 1.0
tag APPLICATIONS_CD
title HP-UX Applications Software Disc
description < data/description.cd
copyright < data/copyright.cd
number B2358-13601
[<vendor specification>]
[<bundle specification>]
...
[<vendor specification>]
<product specification>
[<vendor specification>]
[<product specification>]
...
end
Each keyword defines an attribute of the distribution depot or tape itself.
distribution
If a distribution specification is included in the PSF, swpackage requires only the keyword plus one or more contained product definitions. The depot keyword can also be used in place of distribution.
layout_version
Defines the semantics to use when parsing the PSF file. To ensure POSIX 1387.2 semantics, define a layout_version of 1.0.
tag Defines the identifier (short name) for the distribution depot or tape.
title
Defines the full name (one-line description) of the distribution depot or tape.
description
Defines the multi-paragraph description of the distribution depot or tape; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
copyright
Defines the copyright information for the distribution depot or tape; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
number
Defines the part or manufacturing number of the distribution depot (e.g. CD-ROM) or tape.
end Ends the distribution specification. This keyword is optional.
Vendor Specification
Note: How vendor specifications are associated with products and bundles varies with the value of the layout_version defined for the PSF file. If a layout_version of 1.0 is defined, then this vendor definition will be associated with all subsequent product and bundles that define a matching vendor_tag attribute, until another vendor is defined.
If a layout_version is not specified, then products and bundles will automatically be assigned a vendor_tag from the last vendor object defined at the distribution level, if any, or from a vendor object defined within a product or bundle, unless a vendor_tag with or without a value is explicitly defined.
vendor
tag HP
title Hewlett-Packard Company
description < data/description.hp
end
Each keyword defines an attribute of a vendor object.
vendor
If a vendor specification is included in the PSF, swpackage requires the vendor and tag keywords.
tag Defines the identifier (short name) for the vendor.
title
Defines the full name (one-line description) for the vendor.
description
Defines the multi-paragraph description of the vendor; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
end Ends the vendor specification. This keyword is optional.
Product or Bundle Specifications
Note: Keywords marked with a + apply to products only and keywords marked with a - apply to bundles only. Products are now assumed to be locatable unless they explicitly define the is_locatable attribute to false. Non-locatable products must define this attribute.
product or bundle
tag SD
revision 2.0
architecture HP-UX_A.09.00_700
vendor_tag HP
title HP OpenView Software Distributor
description < data/description.sd
copyright < data/copyright.sd
+ readme < data/README.sd
number J2326AA
category systems_management
category_title Systems Management Applications
+ directory /
+ is_locatable false
machine_type 9000/7*|9000/8*
os_name HP-UX
os_release ?.09.*
os_version [A-Z]
- contents prod.fs1,r=1.0,a=,v= prod.fs2,r=1.0,a=,v=HP
+ [<subproduct specifications>]
+ [<control script specifications>]
+ <fileset specification>
+ [<fileset specification>]
...
end
Each keyword defines an attribute of product or bundle object.
product
For each product specified, swpackage requires only the product and tag keywords, plus one or more contained fileset definitions.
bundle
For each bundle specified, swpackage requires the bundle, tag, and contents keywords.
tag Defines the identifier (short name) for the product.
revision
Defines the revision (release number, version number) of the product.
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.
vendor_tag
Associates this product or bundle with the last defined vendor object, if that object has a matching tag attribute.
title
Defines the full name (one-line description) of the product.
description
Defines the multi-paragraph description of the product; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
copyright
Defines the copyright information for the product; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
readme
Defines the README information for the product; the value must be a pointer to the filename containing the text.
number
Defines the part or order number for the product.
category
Defines the tag or identifier that categorizes the product (e.g. "systems_management", "desktop", "CASE", "database", etc.).
category_title
Defines the full name (one-line description) of the category (e.g. "Systems Management", "Desktop Productivity Tools", etc.).
directory
Defines the default, absolute pathname to the directory in which the product’s files will be installed (i.e. the root directory of the product). If this attribute is not specified, swpackage assigns a value of "/".
is_locatable
Defines whether the product can be installed into any directory, or whether it must be installed into a specific directory. If this attribute is not specified, swpackage assigns a value of "true".
machine_type
Defines the machine(s) 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 pattern match to the value of uname -m on the supported target machine(s).
os_name
Defines the operating system(s) 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 pattern match to the value of uname -s on the supported target system(s).
os_release
Defines the operating system release(s) 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 pattern match to the value of uname -r on the supported target system(s).
os_version
Defines the operating system version(s) on which the product will run. (If not specified, swpackage assigns a value of "*", meaning the product runs on all versions.) If there are multiple operating system versions, use wildcards or the ’|’ character to identify them. This attribute should pattern match to the value of uname -v on the supported target system(s).
contents
The list of fully qualified (all version distinguishing attributes included) software_specs for the bundle.
end Ends the product or bundle specification. This keyword is optional.
Subproduct Specification
subproduct
tag Manager
title Management Utilities
description < data/description.manager
contents commands agent data man
end
Each keyword defines an attribute of a subproduct object.
subproduct
If a subproduct is specified, swpackage requires the subproduct, tag, and contents keywords.
tag Defines the identifier (short name) for the subproduct.
title
Defines the full name (one-line description) of the subproduct.
description
Defines the multi-paragraph description of the subproduct; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
contents
Defines the filesets that make up the subproduct. The value is a whitespace separated list of fileset tag values.
In the PSF, fileset definitions are not contained within subproduct definitions. The contents keyword is used to assign filesets to subproducts.
end Ends the subproduct specification. This keyword is optional.
Fileset Specification
fileset
tag commands
revision 2.15
title Commands (management utilities)
description < data/description.commands
is_kernel false
is_reboot false
[<control file specifications>]
[<dependency specifications>]
[<file specifications>]
end
Each keyword defines an attribute of a fileset object.
fileset
For each fileset specified, swpackage requires the fileset and tag keywords, plus zero or more file specifications.
tag Defines the identifier (short name) for the fileset.
revision
Defines the revision (release number, version number) of the fileset.
title
Defines the full name (one-line description) of the fileset.
description
Defines the multi-paragraph description of the fileset; the value is either the text itself (within double-quotes) or a pointer to the filename containing the text.
is_kernel
A value of "true" defines the fileset as being a contributor to the operating system kernel; the target system(s) kernel build process will be invoked after the fileset is installed. If this attribute is not specified, swpackage assumes a default value of "false".
is_reboot
A value of "true" declares that the fileset requires a system reboot after installation. If this attribute is not specified, swpackage assumes a default value of "false".
end Ends the fileset specification. This keyword is optional.
Dependency Specification
corequisites SD.data
...
prerequisites productA,r>=2.1
...
Each keyword/value defines a dependency relationship on another software object. The object can be within the same product as the dependent fileset, or it can be (within) another product. Dependency specifications are optional. Multiple dependency specifications are allowed.
corequisites
Defines a run-time dependency on another software object. For this fileset to correctly operate, the other software must be installed and configured.
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).
Control Script Specification
checkinstall scripts/checkinstall
preinstall scripts/preinstall
postinstall scripts/postinstall
configure scripts/configure
unconfigure scripts/unconfigure
verify scripts/verify
checkremove scripts/checkremove
preremove scripts/preremove
postremove scripts/postremove
unpreinstall scripts/preinstall
unpostinstall scripts/postinstall
control_file scripts/subscripts [= tag]
Each script specification defines a control script object. The value of each keyword is the source filename for the control file.
Control scripts are optional. If present, swpackage will copy the specified source filename into the depot’s storage directory for the associated product or fileset.
checkinstall
Defines the installation check script executed by swinstall. This script is executed during the analysis of each target, and it checks that the installation can be attempted. If the product or fileset check script returns 1 (ERROR), the product or fileset (respectively) will not be installed.
preinstall
Defines the installation pre-load script executed by swinstall. A fileset script is executed immediately before the fileset files are loaded. A product script is executed before any filesets for that product have been installed.
postinstall
Defines the installation post-load script executed by swinstall. A fileset script is executed immediately after the fileset files are loaded. A product script is executed after all filesets for that product have been installed.
configure
Defines the configuration script executed by swinstall and swconfig. This script configures the target host for the product or fileset (and the product or fileset for any required information about the target host).
unconfigure
Defines the un-configuration script executed by swremove and swconfig. This script unconfigures the target host for the product or fileset, undoing the configuration performed by the configure script.
verify
Defines the verification script executed by swverify. This script verifies the configuration performed by the configure script.
checkremove
Defines the remove check script executed by swremove. This script is executed during the analysis of each target, and it checks that the remove can be attempted. If the check script returns 1 (ERROR), the product or fileset will not be removed.
preremove
Defines the remove pre-remove script executed by swremove. A fileset script is executed immediately before the fileset files are removed. A product script is executed before any filesets for that product have been removed.
postremove
Defines the remove post-remove script executed by swremove. A fileset script is executed immediately after the fileset files are removed. A product script is executed after all filesets for that product have been removed.
unpreinstall
Defines the installation post-restore script executed by swinstall. A fileset script is executed immediately after the fileset files are restored if there is an error and the autorecover_product option is set to true. A product script is executed after all filesets for that product have been restored. It should undo the steps taken by the preinstall scripts.
unpostinstall
Defines the installation pre-restore script executed by swinstall. A fileset script is executed immediately before the fileset files are restored if there is an error and the autorecover_product option is set to true. Note that unpostinstall scripts are supported for filesets only. It should undo the steps taken by the postinstall script.
control_file
Defines an arbitrary control file to be included with the product/fileset, and stored alongside the named control files. It is used to include a subscript called by the named scripts, or a data file read by these scripts. If the optional tag component of the value is not specified, swpackage uses the basename(1) of the source filename as the tag for the control file. (Otherwise, the tag value is used.)
File Specification
Within a fileset specification, the user can specify the following file types to be packaged into the fileset by swpackage:
control file
regular file
directory
hard link
symbolic link
If a recognized, unpackageable type or an unrecognized type is specified, an error is issued.
The swpackage command supports these mechanisms for specifying the files contained in a fileset:
Directory mapping
The user can point swpackage at a source directory in which the fileset’s files are located. In addition, the user 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 a directory mapping is active, the user can tell swpackage to include all files and directories in the fileset (recursively) below the specified directory.
Explicit file specification
For some or all of the files and directories in the fileset, the user can name each source file and destination location.
Default permission specification
For some or all of the files and directories in the fileset, the user can define a default set of permissions.
These mechanisms can all be used in combination with the others.
Directory Mapping
The
directory source [= destination]
keyword defines a source directory under which subsequently listed files are located. In addition, the user can map the source directory to a destination directory under which the packaged files will be installed. For example, the definition:
directory ./commands = /usr/sbin
causes all files from the ./commands directory to have the prefix /usr/sbin when installed. The destination directory must be a located within the product.directory attribute, if defined. (This attribute is defined by the directory keyword in the product specification.)
The destination directory must be an absolute pathname.
The directory keyword is optional.
Recursive File Specification
The
file *
keyword directs swpackage to recursively include every file (and directory) within the current 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.
All attributes for the destination file object are taken from the source file, unless a file_permissions keyword is active (this keyword is described below).
The user can specify multiple
directory source [= destination]
file *
pairs to gather files from different source directories into a single fileset.
Explicit File Specification
Instead of, or in addition to, the recursive file specification, the user can explicitly specify the files and directories to be packaged into a fileset.
The user can use the directory keyword to define a source (and destination) for explicitly specified files. If no directory keyword is active, then the source path and the absolute destination path must be specified for each file.
An explicit file specification uses this form:
file [-m mode] [-o [owner[,]][uid]] [-g [group[,]][gid]] [-v] [source] [destination]
file Specifies an existing file or directory (perhaps within the currently active source directory) to include in the fileset.
source
Defines the relative or absolute path to the source file.
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_permissions keyword is active, or the -m , -o , or -g , options are also included in the file specification.
destination
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 is used as the destination, with the appropriate mapping done with the active destination directory (if any).
-m mode
Defines the (octal) mode of a file or directory.
-o [owner[,]][uid]
Defines the destination file’s owner name and/or or uid. If only the owner is specified, then the owner and uid attributes are set for the destination file object, based on the packaging host’s /etc/passwd. If only the uid is specified, it is set as the uid attribute for the destination object 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 defined in the target system’s /etc/passwd . In this case, the uid attribute is used to set the UID.
-g [group[,]][gid]
Defines the destination file’s group name and/or or gid. If only the group is specified, then the group and gid attributes are set for the destination file object, based on the packaging host’s /etc/group. If only the group is specified, and it contains digits only, it is interpreted as the gid, and is set as the gid attribute for the destination object; no group name is assigned to the object. 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 defined in the target system’s /etc/group. In this case, the gid attribute is used to set the GID.
-v Marks the file as volatile, meaning it can be modified (i.e. deleted) after installed without impacting the fileset.
When processing existing files in a source directory, a number of problems may be encountered. Errors or warning messages are printed for each problem. (The swpackage command terminates when errors are encountered in reading the PSF or accessing the source files.)
Example File Specifications
The following examples illustrate the use of the directory and file keywords:
Include all files under ./commands/, to be rooted under /usr/sbin/:
directory ./commands=/usr/sbin
file *
Include only certain files under ./commands/ and ./nls, to be rooted under /usr/sbin/ and /var/lib/nls/C/:
directory ./commands=/usr/sbin
file sbin/swinstall
file sbin/swcopy
...
directory ./nls=/usr/lib/nls/C/
file swinstall.cat
file swremove.cat
...
Explicitly list files and directories, no directory mapping specified:
file ./commands/swinstall /usr/sbin/swinstall
...
file ./nls /usr/lib/nls/C
file ./nls/swinstall.cat /usr/lib/nls/C/swinstall.cat
Use all specification types to include files:
directory ./commands=/usr/sbin
file *
directory ./nls=/usr/lib/nls/C
file swinstall.cat
...
file ./obam/obam.dm /etc/interface.lib/obam/obam.dm
Redefine specific files previously defined using file * (e.g. to set explicit attributes):
directory ./commands=/usr/sbin
file *
file -m 04500 swcommand
file -o adm -g sys swfile
Default Permission Specification
By default, a destination file object will inherit the mode, owner, and group of the source file. The file_permissions keyword can be specified to set a default permission umask/mode, owner, and group for all the files being packaged into the fileset:
file_permissions [-m mode|-u umask] [-o[owner[,]][uid]] \ [-g[group[,]][gid]]
file_permissions
Applies only to the fileset it is defined in. Multiple file_permissions can be specified, later definitions simply replace previous definitions.
-m mode
Defines a default (octal) mode for all file objects.
-u umask
Instead of specifying an octal mode as the default, the user can specify an octal umask (1) value which gets "subtracted" from an existing source file’s mode to generate the mode of the destination file.
By specifying a umask, the user can set a default mode for executable files, non-executable files, and directories. (A specific mode can be set for any file, as described above.)
-o[owner[,]][uid]
Defines the destination file’s owner name and/or or uid (as defined above).
-g[group[,]][gid]
Defines the destination file’s group name and/or or gid (as defined above).
Example Permission Specifications
The following examples illustrate the use of the file_permission keyword.
Set a readonly 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 for 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 the user defines no 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.)
EXAMPLES
This example illustrates a product specification file for a product that defines all attributes.
# PSF file which defines an example packaging of a product.
depot
layout_version 1.0
# Vendor definition:
vendor
tag HP
title Hewlett-Packard Company
description < data/descr.hp
end
# Product definition:
product
tag SD
revision A.01.00
architecture HP-UX_9.00_700/800
vendor_tag HP
title HP OpenView Software Distributor
number B1991A
category systems_management
category_title Systems Management Applications
description < data/descr.sd
copyright < data/copyr.sd
readme < data/README.sd
machine_type 9000/[78]*
os_name HP-UX
os_release ?.09.*
os_version ?
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 SD Commands (management utilities)
revision 2.42
description < data/descr.commands
# Control files:
configure scripts/configure.commands
# Dependencies
corequisites SD.data
corequisites SD.agent
# Files:
directory ./commands=/usr/sbin
file swinstall
file swcopy
...
directory ./nls=/usr/lib/nls/C
file swinstall.cat
file swpackage.cat
directory ./ui=/usr/lib/sw/ui
file *
...
end # commands
... # other filesets
fileset
tag man
title Manual pages for the Software Distributor
revision 2.05
directory ./man/man1m=/usr/man/man1m.Z
file *
directory ./man/man4=/usr/man/man4.Z
file *
directory ./man/man5=/usr/man/man5.Z
file *
end # man
end # SD
AUTHOR
swpackage was developed by the Hewlett-Packard Company.
SEE ALSO
swpackage(1M), sd(4), sd(5), swacl(1M), swagentd(1M), swcluster(1M), swconfig(1M), swcopy(1M), swgettools(1M), swinstall(1M), swjob(1M), swlist(1M), swmodify(1M), swreg(1M), swremove(1M), swverify(1M), update(1M), and the HP OpenView Software Distributor Administrator’s Guide or Managing HP-UX Software with SD-UX manuals.
Hewlett-Packard Company — HP-UX Release 10.20: July 1996