omnios-extra Build System - Part III - OmniOS

Share on:

UPDATE: I have updated the at with a much more detailed view on building packages for OmniOS and this should be your first port of call, should you be interested in creating packages for OmniOS.

OmniOS Community Edition is a free and open-source Unix operating system derived from OpenSolaris and based on Illumos. Developers forked OpenSolaris after Oracle Corporation discontinued it, in order to continue development and distribution of the source code. The OmniOSce project is stewarded by the OmniOS Community Edition Association. OmniOSce's goal is to produce a self-hosting, minimalist Illumos-based release suitable for production deployment.

The Image Packaging System, also known as IPS, is a cross-platform (written in Python) package management system created by the OpenSolaris community in coordination with Sun Microsystems. IPS is designed to eliminate some long-standing issues with previous software distribution, installation, and maintenance mechanisms that have caused significant problems for Solaris users, developers, and maintainers.

Today I will be using the build system for the OmniOS Extra IPS Repository. This allows a convenient and standardized manner to build IPS Packages. I will package the Apache httpd web server as I have been demonstrating in the last two posts.

Setup the Build Environment from the OmniOS Extra Source at Github

Grab the git repo and drop it into a directory of your choice.

cd /var/git
git clone

The source contains a file called that can be copied as and used as an environment for your own publishing environment:

cd omnios-extra/
cp lib/ lib/

Edit the variables; I have set the following to use in my own environment:


Note: I am using the IPS repo I setup in the previous post to publish the packages.

Further, the lib/global-tranforms.mog file needs to be edited to represent my environment. I edit all transforms to point to the PREFIX in the file. This can be accomplished as follows:

mv lib/global-transforms.mog{,.ooce}
sed 's/ooce/pbdigital/g' lib/global-transforms.mog.ooce > lib/global-transforms.mog

Tada! The environment is now set up.

Building Apache Portable Runtime Library

Making the Source Available at $MIRROR Location

Make sure source is available under the $MIRROR set in For this example the will search under and also expects to find a sha256 checksum file. For the Apache Portable Runtime source, this will be named apr-1.7.0.tar.bz2.sha256 and the contents should read:


Now we can create our build directory:

mkdir omnios-extra/build/apr
cd omnios-extra/build/apr

The build directory needs at least two file, & local.mog. Viewing these two files should be explanation enough. You can also browse the files in the OmniOS Extra IPS Repository to help you create your own local files.

vi local.mog

Add Patches

To get the automatic build to work, we need to add any changes that we made manually in the previous posts, as patches. These reside under the patches directory. As well as just copying the patch to the patches directory, we need to create the file series, which contains a list of patches we wish to apply. In this case the following takes care of proc_mutex.c.patch.

mkdir patches
cp proc_mutex.c.patch patches/
echo "proc_mutex.c.patch" >> patches/series

Building Apache Portable Runtime

Now we have all the files in place, the directory structure should look as follows:

# tree apr/
|-- local.mog
`-- patches
    |-- proc_mutex.c.patch
    `-- series

1 directory, 4 files

Time to build! When the build is being published, it needs the permissions of pkg5srv to do so. So before the build I make sure all the permissions are set accordingly and then issue the ./ command as the pkg5srv user.

chown -R pkg5srv:pkg5srv /var/git/omnios-extra
su pkg5srv -c ./ -l

You may receive some warnings through the build but can choose to continue as the package should build correctly. Of note I skip pkglint as I have done these checks manually in the previous posts.

Building Apache Portable Runtime Utilities

This follows exactly as above. The files need for the package are as follows:, local.mog, apr_crypto.c.patch & configure.patch.

Building Apache httpd Server

The only addition we need to make to the httpd build is that we need to add the SMF Manifest and Method into the files directory:

mkdir files
cp apache24 files/
cp apache24.xml files/

And in the file, we need to include the install_smf command to install these files and restart the SMF process.

install_smf network apache24.xml apache24

The files for the httpd build are, local.mog, apache24 & apache24.xml.

Wrapping Up

This concludes this series on IPS packaging for OmniOS. Happy Hacking!