3.2. Building and installing Heartbeat from source

3.2.1. Heartbeat build prerequisites

Building Heartbeat requires the presence of the following tools and libraries on the build system:

  • A C compiler (typically gcc) and associated C development libraries;
  • the flex scanner generator and the bison parser compiler;
  • net-snmp development headers, to enable SNMP related functionality;
  • OpenIPMI development headers, to enable IPMI related functionality;
  • Python (just the language interpreter, not library headers)
  • the cluster-glue development headers. See Section 3.1, “Building and installing Cluster Glue from source” for details on how to build these from source.
[Note]Note

This list applies to the default software configuration. If you configure the source with non-standard options, other dependencies may apply.

3.2.2. Downloading Heartbeat sources

Downloading a release tarball

Downloading a released version of Heartbeat as a compressed tarball is equivalent to fetching a tagged snapshot from the Mercurial source code repository. Release tags follow the format STABLE-x.y.z, where x.y.z is the released version of Heartbeat you wish to download.

If, for example, one wants to download the 3.0.4 release, the correct sequence of commands would be:

# wget http://hg.linux-ha.org/dev/archive/STABLE-3.0.4.tar.bz2
# tar -vxjf STABLE-3.0.4.tar.bz2

Downloading the latest Mercurial snapshot

The latest development code is always available in the Mercurial repository as the tip revision.

To download a tarball auto-generated from the tip, use this sequence of commands:

# wget http://hg.linux-ha.org/dev/archive/tip.tar.bz2
# tar -vxjf tip.tar.bz2

Checking out sources from Mercurial

This is the method you would apply if you have the Mercurial utilities locally installed. Checking out the sources amounts to cloning the repository:

$ hg clone http://hg.linux-ha.org/dev heartbeat-dev
requesting all changes
adding changesets
adding manifests
adding file changes
added 12491 changesets with 34830 changes to 2632 files
updating working directory
356 files updated, 0 files merged, 0 files removed, 0 files unresolved

3.2.3. Building Heartbeat

Building Heartbeat is an automated process making extensive use of GNU Autotools. When building and installing on the same machine, it usually amounts to just the following sequence of commands:

$ ./bootstrap
$ ./configure
$ make
$ sudo make install
[Note]Note

The bootstrap script is a convenience wrapper around automake, autoheader, autoconf, and libtool. ConfigureMe is a convenience wrapper for the autoconf-generated configure script.

A number of configuration options are supported, and you may tweak some of them to optimize Heartbeat for your system. To retrieve a list of configuration options, you may invoke configure with the --help option. A customized build may thus comprise these steps:

$ ./bootstrap
$ ./configure --help
$ ./configure <configuration-options>
$ make
$ sudo make install

Some typical configuration options that you may wish to set are --prefix, --sysconfdir, and --localstatedir, as shown in this example:

$ ./bootstrap
$ ./configure --help
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install

3.2.4. Building Packages

RPM packages

RPM spec files are provided in the Heartbeat source tree both for SuSE and Red Hat based distributions:

heartbeat-suse.spec should be used for OpenSUSE and SLES installations. heartbeat-fedora.spec is for Fedora, Red Hat Enterprise Linux, and CentOS.

Debian packages

Debian packaging for Heartbeat is maintained in a Mercurial repository on alioth.debian.org. Thus, rather than cloning or downloading from the upstream Mercurial repository, use the one hosted on alioth.

Once you have checked out or unpacked the source tree from the alioth repository, simply invoke dpkg-buildpackage from the top of the source tree — like you would with any other Debian package.