2010.7.29:  I’ve updated the steps so you no longer need to longer need to be root.  You do need a working sudo installation though for a couple of commands.
This is a quick and dirty how to about building  Bacula RPMs from the SRPMS for your CentOS 5 installation.
The setup:

  • CentOS 5.5 x86_64
  • MySQL support

1. Download the following RPMs from the Bacula site:
2.  Install the required packages:

# sudo yum install mysql-devel rpm-build libX11-devel libXext-devel
# sudo yum install GConf2-devel freetype-devel libtermcap-devel shadow-utils
# sudo yum install gcc gcc-c++ make autoconf glibc glibc-devel ncurses ncurses-devel perl  readline-devel
# sudo yum install libstdc++-devel zlib-devel openssl-devel libacl-devel pkgconfig tcp_wrappers
# sudo yum install openssl-devel fontconfig-devel libpng-devel
# sudo yum install openssl fontconfig libgcc libpng libstdc++ zlib

3. Create your rpm build environment (if you haven’t already), otherwise you can skip this stop.

# echo "%_topdir /home/${USER}/redhat/" > ~/.rpmmacros
# mkdir -p ~/redhat/{BUILD,RPMS/{i386,i686,noarch},SOURCES,SPECS,SRPMS}

4. Build the RPMs. Each command should be on one line.

# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-5.0.2-1.src.rpm
# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-bat-5.0.2-1.src.rpm
# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-docs-5.0.2-1.src.rpm
# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-mtx-5.0.2-1.src.rpm

The bacula-bat package will take the longest to build because it builds a copy of QT4 before building bat.
The rpmbuild process will build the RPMs to match the architecture of the system they are being built on.
On my x84_64 CentOS system I ended up with the following RPMs:

  • ./RPMS/noarch/bacula-docs-5.0.2-1.noarch.rpm
  • ./RPMS/x86_64/bacula-updatedb-5.0.2-1.x86_64.rpm
  • ./RPMS/x86_64/bacula-mysql-5.0.2-1.x86_64.rpm
  • ./RPMS/x86_64/bacula-mtx-5.0.2-1.x86_64.rpm
  • ./RPMS/x86_64/bacula-libs-5.0.2-1.x86_64.rpm
  • ./RPMS/x86_64/bacula-client-5.0.2-1.x86_64.rpm
  • ./RPMS/x86_64/bacula-bat-5.0.2-1.x86_64.rpm

The RPMs can be found in a subdirectory of ~/redhat/RPMS, which one depends on your architecture.
On the system that will be the Bacula server, install the following rpms:

  • bacula-bat
  • bacula-libs
  • bacula-mtx
  • bacula-mysql
  • bacula-updatedb
  • bacula-docs

The bacula-client rpm is used to install the bacula client on the Linux hosts that will be backed up.
If you have other Linux or Windows clients to backup, you can find list of prebuilt bacula clients at http://bacula.org/en/?page=downloads.

  • Attempting to install bacula-mysql and bacula-client at the same time on the same host will result in an error: bacula-mysql conflicts with bacula-client-5.0.2-1.x86_64 This is the correct behavior, do not force install the client on your bacula server.
  • The bacula-mysql RPM generats two weird messages upon install:/var/tmp/rpm-tmp.13111: line 4: fg: no job control
    The group bacula has been added to %{group_file}.
    Adding –define “_vendor redhat” doesn’t seem to help.