Creating a Solaris Package
1 Introduction
Creating your own Solaris package can be very practical. Why? It saves time and it’s clean :-)
We will need several files, but not all of them are mandatory. I’ll try to detail as much as possible to make everything clear.
It’s also possible to secure your package by certifying it via SSL, GPG, etc.
2 Creating Necessary Files
Let’s create a package folder and work in it. Here’s the composition of a package:
|
|
This includes:
- NAMEofpackage: A package name with 3 to 4 unique capital letters, which will contain all the files necessary for installation
- copyright and other files: Files that will interact during the package usage phase or simply contain information
Let me detail the last point. Here are the files you can use:
- pkginfo: Contains information about the package (mandatory)
- prototype: Contains the list of files and directories to copy. Also contains the package configuration files (mandatory)
- compver: Defines older versions of packages compatible with this one
- depend: Defines other packets required to install this packet
- space: Defines the disk space required for this package
- copyright: The copyright
- request: Prerequisites for installation
- checkinstall: Script performing tests to verify that everything is fine before installation
- preinstall: Script to prepare for installation
- postinstall: Script to finish installation
- preremove: Script to prepare for package removal
- postremove: Script to finish the removal
Create a folder containing the desired name of your package and the desired tree structure as shown in the example above.
2.1 copyright
For copyright, put your own. Something simple:
Copyright (c) 2009 Deimos
All Rights Reserved
This product is protected by copyright and distributed under
licenses restricting copying, distribution, and decompilation.
2.2 depend
If you have dependencies for your package, you must list them here. For example, in this case, I need to have Perl and associated libraries. I’ll gather the list of packet names I need and put them in my depend file:
|
|
Then, we need to replace ‘system’ with ‘P’ to get this in our file:
P SUNWperl584core Perl 5.8.4 (core)
P SUNWperl584usr Perl 5.8.4 (non-core)
2.3 pkginfo
Now, the famous file containing the package description:
|
|
2.4 prototype
Finally, this file is the most complex. It must contain all existing file names (f), folders (d), and also information (i).
Use only what you need (pkginfo is mandatory):
|
|
Then I’ll go to my NAMEofpackage folder and add what’s left:
|
|
The content of my file should ultimately look something like this:
|
|
3 Creating the Package
Now we’ll create the package. We’ll make a package_done folder to create the package in:
|
|
At this point, we have our Solaris package in folder form and not with a pkg extension (which is classier, more beautiful, and glows in the dark). That’s why here’s the final step:
|
|
And now I have my beautiful package in .pkg format :-)
4 Resources
https://docs.sun.com/app/docs/doc/817-0406/ch1designpkg-51728?a=view
Last updated 14 Nov 2009, 16:04 +0200.