DRBD Users Guide 8.0-8.3

Building a DRBD RPM package

[Note]Note

The information in this section applies to DRBD 8.3.6 and above. Up until release 8.3.5, DRBD used a different RPM build approach.

The DRBD build system contains a facility to build RPM packages directly out of the DRBD source tree. For building RPMs, the section called “Checking build prerequisites” applies essentially in the same way as for building and installing with make, except that you also need the RPM build tools, of course.

Also, see the section called “Preparing the kernel source tree” if you are not building against a running kernel with precompiled headers available.

The build system offers two approaches for building RPMs. The simpler approach is to simply invoke the rpm target in the top-level Makefile:

$ ./configure
$ make rpm
$ make km-rpm

This approach will auto-generate spec files from pre-defined templates, and then use those spec files to build binary RPM packages.

The make rpm approach generates a number of RPM packages:

Table 4.2. DRBD userland RPM packages

Package nameDescriptionDependenciesRemarks
drbdDRBD meta-packageAll other drbd-* packagesTop-level virtual package. When installed, this pulls in all other userland packages as dependencies.
drbd-utilsBinary administration utilities Required for any DRBD enabled host
drbd-udevudev integration facilitydrbd-utils, udevEnables udev to manage user-friendly symlinks to DRBD devices
drbd-xenXen DRBD helper scriptsdrbd-utils, xenEnables xend to auto-manage DRBD resources
drbd-heartbeatDRBD Heartbeat integration scriptsdrbd-utils, heartbeatEnables DRBD management by legacy v1-style Heartbeat clusters
drbd-pacemakerDRBD Pacemaker integration scriptsdrbd-utils, pacemakerEnables DRBD management by Pacemaker clusters
drbd-rgmanagerDRBD Red Hat Cluster Suite integration scriptsdrbd-utils, rgmanagerEnables DRBD management by rgmanager, the Red Hat Cluster Suite resource manager
drbd-bashcompletionProgammable bash completiondrbd-utils, bash-completionEnables Programmable bash completion for the drbdadm utility

The other, more flexible approach is to have configure generate the spec file, make any changes you deem necessary, and then use the rpmbuild command:

$ ./configure --enable-spec
$ make tgz
$ cp drbd*.tar.gz `rpm -E _sourcedir`
$ rpmbuild -bb drbd.spec

If you are about to build RPMs for both the DRBD userspace utilities and the kernel module, use:

$ ./configure --enable-spec --with-km
$ make tgz
$ cp drbd*.tar.gz `rpm -E _sourcedir`
$ rpmbuild -bb drbd.spec
$ rpmbuild -bb drbd-km.spec

The RPMs will be created wherever your system RPM configuration (or your personal ~/.rpmmacros configuration) dictates.

After you have created these packages, you can install, upgrade, and uninstall them as you would any other RPM package in your system.

Note that any kernel upgrade will require you to generate a new drbd-km package to match the new kernel.

The DRBD userland packages, in contrast, need only be recreated when upgrading to a new DRBD version. If at any time you upgrade to a new kernel and new DRBD version, you will need to upgrade both packages.