User Tools

Site Tools


howto_create_bat_3.0_rpm_on_rhel_5_or_centos_5

RHEL5 (as of 5.3) and its clones have official packages for qt 3.3.6 and qt 4-4.2.1, but these won't work for BAT 3.0. Here is a procedure to create a working BAT 3.0 rpm.

If you don't really need them, it is probably best to remove the older versions of qt. This will make debugging the build of BAT easier. Note however that the qt we are going to install will work side-by-side with the older ones if needed. It installs into different directories.

#yum remove qt qt-devel qt4 qt4-devel

Set up your yum repositories to use ATrpms-testing and EPEL. http://wiki.centos.org/AdditionalResources/Repositories

#yum install qt44 qt44-devel --enablerepo=atrpms-testing
#yum install qwt qwt-devel --enablerepo=epel

Download the bacula-3.0.x-x.src.rpm from sourceforge and install it like this:

#rpm -i bacula-3.0.x-x.src.rpm

This will unpack a bunch of stuff into the /usr/src/redhat directory structure.

Open the file /usr/src/redhat/SPECS/bacula.spec in a text editor and make the following changes (x86_64 users see the note at the end):

 at around line 353 
 change
 
 %if %{bat} && %{broken_rh} 
 BuildRequires: qt4-devel >= 4.2
 
 to
 
 %if %{bat} && %{broken_rh}
 BuildRequires: qt44-devel >= 4.4
 at around line 1352 ( inside the section for %if %{bat} && %{fc6} ) 
 change 
 Requires: qt4 >= 4.2
 to
 Requires: qt44 >= 4.4

Make sure you have the package rpm-build installed.

Build the rpms with a command like the following. Note that you must build one of the database servers. Due to a bug in the spec file you cannot just build the client_only. (Search for fix me in the 3.0.2-1 spec file to see why). This doesn't matter to us though, as the rpms are all separate and we only care about the one for BAT in this exercise.

 rpmbuild -bb --clean /usr/src/redhat/SPECS/bacula.spec \
 --define "build_centos5 1" \
 --define "build_mysql5 1" \
 --define "build_bat 1" \
 --define "nobuild_rescue 1" \
 --define "nobuild_gconsole 1"

If the build works out you will find rpm files in /usr/src/redhat/RPMS/i386. Install the one for BAT.

Fix your password and so forth in /etc/bacula/bat.conf

Note for x86_64 users:

The instructions above have been tested on i386. The editing of the bacula.spec file will be a little different for x86_64 systems. Look near where this comment occurs:

 # Red Hat's 64 bit installation of QT4 appears to be broken so:

It is possible that the ATrpms package for qt44 is not broken, so the fix here may not be needed at all. In any case, the paths listed here are certainly going to be wrong. Test the paths returned by the following commands after you install the qt44 package:

 pkg-config --variable=prefix QtCore
 pkg-config --variable=includedir QtCore
 pkg-config --variable=libdir QtCore

If these commands return the correct paths, then you can eliminate the fix entirely. Alternatively, you can put in the correct paths. Once you get it sorted, come back here and fix these instructions. Thanks.

Note for version 3.02 The problem that required leaving the BUILD directory in place until you ran BAT once has apparently been fixed in the new bacula.spec file, so I simplified this wiki page to reflect that. See the page history if you want to know all about it.

howto_create_bat_3.0_rpm_on_rhel_5_or_centos_5.txt · Last modified: 2009/07/29 19:35 by marknienberg