Method B: The native package manager

Samhain provides an easy method to create custom binary packages with the native package manager of your operating system. Basically, this works like:

bash$./configure [your preferred options]
bash$make rpm|deb|tbz2|solaris-pkg

I.e. the binary package will be built with the compile options chosen in the preceding ./configure command. Supported package formats are: rpm (e.g. Redhat, SuSE, ...), deb (Debian), tbz2 (Gentoo Linux), and solaris-pkg (Solaris).

TipTIP
 

The binary package will use the OS-specific samhainrc.OS configuration file from the source directory, thus if you customize this, your package will contain your customized version.

TipTIP
 

Upon installation, the package will not automatically initialize the baseline database, and not start the daemon (though it will install the runlevel script to start upon boot).

NoteNOTE
 

For reasons explained in the Section called Integrity of the executable in the chapter called Security Design>, we do not recommend to distribute binary packages to third parties. On the other hand, it is perfectly ok to use a self-built binary package to install/distribute samhain on your machine/within your own network.

Building an RPM

Building a Solaris package

NoteNOTE
 

This is experimental and not well tested. Constructive feedback from experienced Solaris administrators is welcome.

First run ./configure in the source directory with your preferred options, then do a make solaris-pkg. The result should be a package named samhain.pkg.

Building a Gentoo Linux package

First run ./configure [your preferred options] in the source directory (reminder: use ./configure --prefix=USR, NOT ./configure --prefix=/usr for standard paths), then do a make tbz2. The .tbz2 package will be in /usr/portage/packages/All (this is just how Gentoo package building works).

The Gentoo package thus created will not initialize the database automatically upon installation. The .tbz2 package file will be in /usr/portage/packages/All (this is just how Gentoo package building works).

NoteNOTE
 

If you just want to install on your own system, rather than building a package for other machines, you can use the command make emerge (after running ./configure, of course).

Building a Debian package

First run ./configure in the source directory (reminder: use ./configure --prefix=USR, NOT ./configure --prefix=/usr for standard paths), then do a make deb. The .deb package and the corresponding .dsc file will be in the directory above the source directory (this is just how Debian package building works).

You will need the following additional Debian packages in order to build a Debian packages: apt-get fakeroot, apt-get debmake, apt-get debhelper, apt-get devscripts, and apt-get cpio.

The Debian package thus created will not initialize the database automatically upon installation. It will be located in the parent directory of the source directory (that's just the way the Debian build system works).