2. Method B: The native package manager
Prev | Chapter 11. Deployment to remote hosts | Next

## 2. 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|depot|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), depot (HP-UX), and solaris-pkg (Solaris).

| Customization
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.

| Baseline initialization
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).

| Client packages
Samhain uses a password embedded in the binary for client/server authentication (for details see Section 3 ). To avoid the need for changing the binary after installation (to set the password), it is possible to compile it in during package building (for RPM and DEB packages only). To do so, export the password in the PASSWORD environment variable before running the command make rpm or make deb .

| Note
For reasons explained in Section 2 , 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.

### 2.1. Building an RPM

#### 2.1.1. Custom RPM

If you run ./configure in the source directory, a spec file `samhain.spec` will be created from `samhain.spec.in`. You can then use make rpm to create source and binary RPMs, or make srpm to create just the source RPM.

The RPM will be located in `/usr/src/(distribution-specific)/RPMS/i386`. Installing the RPM will not initialize the database automatically.

If anything fails during the build (and after installation has begun), just cd into the build directory and do a make uninstall && make uninstall-boot . If building for a non-RedHat system, the error messages will tell you which file paths in the spec file were incorrect.

#### 2.1.2. Single-host

If you want to create an RPM for a single-host version of samhain without any fancy options, you can just run

                bash$ rpmbuild -ta samhain-version.tar.gz

on the tarball (there is a default spec file in there).

The RPM will be located in `/usr/src/(distribution-specific)/RPMS/i386`. Installing the RPM will not initialize the baseline database automatically.

### 2.2. Building an HP-UX package

First run ./configure in the source directory with your preferred options, then do a make depot . The result should be a package named `samhain.depot`, that can be installed with swinstall . Installing the package will not initialize the baseline database automatically.

### 2.3. Building a Solaris package

| Note
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`.

### 2.4. 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).

| Note
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).

### 2.5. 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).

Prev | Up | Next
Chapter 11. Deployment to remote hosts | Home | Chapter 12. Security Design