This is an overview of the pkg(5)-enabled tools that you can integrate into your layered software distributions. Refer to the instructions in the Assembling Install Bundles for details on how to integrate the tools introduced below.
pkg(1) Command Line Interface
If you are assembling an OS platform-specific image at the factory, then you will likely pre-install the package containing the pkg(5) client CLI. Alternatively, the pkg(5) Java Bootstrap facility can be used to complete the pkg(5) client installation dynamically. In either case, your own applications and the end users of the applications can use the pkg CLI to manage their installation images.
pkg(1) documentation
Update Tool GUI, Desktop Notifier and Software Update GUI
When your images are expected to be used in desktop environments, you should consider pre-installing the Update Tool GUI and its companion desktop notifier and Software Update GUI. The Update Tool enables end users to manage pkg(5)-based installation images by performing many of the common tasks available through the pkg CLI:
- Listing and applying updates to installed packaged
- Browsing repositories for add-on packages
- Browsing and removing installed packages
- Creating and removing installation images
You can either pre-install the updatetool package or depend on the pkg(5) Java bootstrap to dynamically complete installation of the GUI and notifier.
You can include your own desktop Start or Applications menu items to enable your users to easily launch the Update Tool GUI.
For more information on desktop notification, see the Desktop Notifier Integration page.
pkg(5) Java Bootstrap and Stub Scripts
The pkg(5) Java bootstrap facility is used when you assemble pkg(5)-based universal distribution images. i.e. A single download or install bundle that you offer for use across a wide variety of OS platforms. A universal bundle is a binary distribution of your software in which you've chosen to exclude the packages containing the pkg(5) infrastructure and its native OS platform-dependencies. Bundle assemblers may choose to create a universal bundle when they want to deliver a zip file that users can download and apply to any supported OS platform or they want to minimize the initial download size of their bundles.
The pkg(5) Java Bootstrap facility is a JAR file containing code that enables your universal bundle to dynamically complete or "bootstrap" the installation of the pkg(5) client software either when an initial installation application is executed or when a stub script is executed by an end user.
The prerequisites for using the bootstrap facility are:
- Image is packaged in pkg(5) format and the URLs of the associated repository has been included in the image at the factory by the bundle assembler
- Either an initial installation program or bootstrap stub scripts are used to trigger execution of the bootstrap
- Suitable version of Java is available on the system
- Network connectivity to the package repository
The bootstrap stub scripts can be used to represent the pkg command and updatetool GUI start up commands in your installation image. As long as you represent these commands in the form of the bootstrap stub scripts in your universal image and the requirements listed above are met, when a user executes these commands, the pkg(5) Java bootstrap facility will be executed to dynamically complete the installation of pkg(5) and, optionally, the Update Tool GUI. The formal package installation process replaces the stub scripts with their real counterparts.
Your initial installation program can pass the bootstrap facility parameters to specify user preferences such as opting out of automatic update notifications.
Refer to the pkg(5) Java Bootstrap Interface documentation for more details.
pkg(5) Client APIs
pkg(5) Client Java API
If you have Java applications that would benefit from directly interfacing with pkg(5) for the purposes of enabling users to list and apply available updates and add-on package and perform other image management functions, you can use the pkg(5) Client Java API. The pkg(5) Client Java API currently provides a small subset of the interfaces provided by the pkg CLI and the underlying IPS Python modules, but there's enough functionality to support custom administrative applications providing basic update and add-on management functions.
pkg(5) Client Java API JavaDocs
pkg(5) Python API
Since pkg(5) is written in Python, you can also use the Python API of pkg(5) directly from your client applications.
pkg(5) Repository Atom Feeds
pkg(5) repositories provide an Atom feed that feed readers and custom applications can use to notify users of newly published packages and updates to existing packages.
Eventually we'd like to realize the ability for you to add links to packages in web pages and enable users to simply click on those links to install and update packages. The OpenSolaris pkg(5) project has already defined a .p5i file format to enable developers to do this, but our toolkit needs to be enhanced to ensure that the appropriate helper application can be executed to facilitate on-the-fly installation of selected packages.