> Producing and Maintaining Packages
Overview
Most all software is covered by one or more licenses that govern its usage and redistribution. The pkg(5) system provides a formal mechanism for publishing licenses with your package as well as tools for viewing licenses before and after installation. The Update Tool GUI also uses this mechanism to display package licenses before installation.
Licenses are typically delivered by two mechanism. The first is the pkg(5) system's license action which includes the license as part of the package metadata. The second is to use the pkg(5) system's file action to include a copy of the license in your software's install image.
Best Practices
| # | Title | Description |
|---|---|---|
| 1 | Use license action | All packages that contain copyrighted software must include one or more license actions to state its conditions of use. |
| 2 | Ship license files | All license content delivered via license actions should also be delivered as files via one or more file actions. |
| 3 | Consistency in License Names and Contents | Identical licenses should have identical license names and license contents. |
Details
1. Use license Action
IPS supports the license action which associates a software license with a package. For example:
license /home/build/updatetool/LICENSE.txt license=CDDLv1.0
In this case LICENSE.txt is the source of the license content and CDDLv1.0 is the name of the license. A package may contain more than one license action if it is covered by more than one license.
The contents of the license file (LICENSE.txt in our example) should be either ASCII or ISO 8859-1 and formatted to 72 character lines. The license name should be ASCII.
A user can view the license of a package before installation using the pkg info command:
pkg info -r --license updatetool . . .
To see the name of the license for a package you can query the package contents:
pkg contents -t license -o license updatetool LICENSE CDDLv1.0
2. Ship License Files
In addition to license actions it is a best practice for unbundled products to deliver license files within a package using the file action so that users can view licenses by inspecting the filesystem. License files should be installed near the top level of the relevant component directory. For example:
file /home/build/updatetool/LICENSE.txt path=updatetool/LICENSE.txt
If your product is broken up into multiple packages, then you may need to choose one of the packages as the appropriate package in which to ship the license files (even though all packages would include the license action).
3. Consistency in License Names and Contents
Both the pkg(5) system and the Update Tool GUI perform optimizations when they detect that licenses from different packages are identical. Therefore whenever possible packages with identical licenses should use identical license names and have identical license contents. Project consolidations are encouraged to standardize on license content and names.
[XXX Do we want to provide references to license names and boilerplate to use?]