Bacula 5 download and installation on CentOS 5

Since the developers of Bacula prefer to work with Fedora and Suse, bacula administration tool (BAT)'s compilation and installation it's not too easy to do on CentOS, a conservative distribution.

The steps I used to compile and install Bacula 5 on CentOS 5

Download the source rpms for bacula and bacula-bat from sourceforge.net

cd /usr/src
wget http://downloads.sourceforge.net/project/bacula/rpms/5.0.1/bacula-5.0.1-1.src.rpm
wget http://downloads.sourceforge.net/project/bacula/rpms/5.0.1/bacula-bat-5.0.1-1.src.rpm
wget http://downloads.sourceforge.net/project/bacula/rpms/5.0.1/bacula-docs-5.0.1-1.src.rpm

Install few development packages required by bacula

yum install rpm-build gcc gcc-c++ autoconf glibc-devel ncurses-devel \
    readline-devel libstdc++-devel zlib-devel openssl-devel libacl-devel \
    pkgconfig libxml2-devel libtermcap-devel sqlite-devel

Compile the bacula package with sqlite database engine enabled

rpmbuild -bb --clean /usr/src/redhat/SPECS/bacula.spec \
    --define "contrib_packager My Name <me@domain.tld>" \
    --define "build_centos5 1" \
    --define "build_sqlite 1"

Install few packages required usually by Qt compilation, Qt being used by bat, bacula administration tool

yum install mesa-libGLU-devel libXau-devel mesa-libGL-devel xorg-x11-proto-devel libXdmcp-devel libX11-devel mesa-libGLU-devel libXext-devel libXcursor-devel libXfixes-devel libXrandr-devel libXrender-devel libXinerama-devel libXi-devel libICE-devel libSM-devel libXt-devel dbus-devel


Adjust /usr/src/redhat/SPECS/bacula-bat.spec to include some settings specific to CentOS. I've modified the file directly. Below is the .diff, and the full .spec file is attached at page bottom.

bacula.spec.centos5.diff

# diff -ruN bacula-bat-5.0.1-dist.spec bacula-bat.spec
--- bacula-bat-5.0.1-dist.spec    2010-02-25 22:00:02.000000000 +0200
+++ bacula-bat.spec    2010-03-09 19:31:53.000000000 +0200
@@ -62,6 +62,7 @@
 %define fedora 0
 %define suse 0
 %define mdk 0
+%define centos5 0
 
 %if %{_vendor} == redhat
     %define fedora 1
@@ -75,7 +76,14 @@
     %define mdk 1
     %define _dist %(grep Mand /etc/mandrake-release)
 %endif
-%if ! %{fedora} && ! %{suse} && ! %{mdk}
+%if %{build_centos5} == 1
+    %define centos5 1
+    %define centos 1
+    %define group_file /etc/group
+    %define _dist %(cat /etc/redhat-release)
+%endif
+
+%if ! %{fedora} && ! %{suse} && ! %{mdk} && ! %{centos}
 %{error: Unknown platform. Please examine the spec file.}
 exit 1
 %endif
@@ -100,16 +108,28 @@
 BuildRequires: gcc, gcc-c++, make, autoconf
 BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, zlib-devel
 BuildRequires: openssl-devel, fontconfig-devel, libpng-devel, libstdc++-devel, zlib-devel
-
 Requires: openssl
 Requires: fontconfig
+
+%if %{build_centos5}
+BuildRequires: freetype-devel, mesa-libGLU-devel, libXau-devel, mesa-libGL-devel
+BuildRequires: xorg-x11-proto-devel, libXdmcp-devel, libX11-devel, mesa-libGLU-devel
+BuildRequires: libXext-devel, libXcursor-devel, libXfixes-devel, libXrandr-devel
+BuildRequires: libXrender-devel, libXinerama-devel, libXi-devel, libICE-devel,
+BuildRequires: libSM-devel, libXt-devel dbus-devel
+Requires: freetype, mesa-libGLU, libXau, mesa-libGL, libXdmcp, libX11, mesa-libGLU
+Requires: libXext, libXcursor, libXfixes, libXrandr, libXrender
+Requires: libXinerama, libXi, libICE, libSM, libXt, dbus
+%else
+BuildRequires: freetype2-devel
 Requires: freetype2
+%endif
 Requires: libgcc
 Requires: libpng
 Requires: libstdc++
 Requires: zlib
 
-%if %{suse}
+%if %{suse} && !%{centos5}
 Requires: /usr/bin/kdesu
 Requires: freetype2
 BuildRequires: freetype2-devel

Compile the bacula-bat package

# rpmbuild bacula-bat stuff: binaries
rpmbuild -bb --clean /usr/src/redhat/SPECS/bacula-bat.spec \
    --define "contrib_packager My Name <me@domain.tld>" \
    --define "build_centos5 1" --define "centos5 1"
# rpmbuild bacula-bat source rpm, including the modified .spec file
rpmbuild -bs /usr/src/redhat/SPECS/bacula-bat.spec \
    --define "contrib_packager My Name <me@domain.tld>" \
    --define "build_centos5 1" --define 'centos5 1'


If nothing wrong happened, in /usr/src/redhat/RPMS/<your_system_architecture>/ should be located the new .rpm's

CentOS 5.4 Bacula 5 RPMs

# ls -l /usr/src/redhat/RPMS/i386/bacula*
-rw-r--r-- 1 root root 4262980 Mar  9 20:00 /usr/src/redhat/RPMS/i386/bacula-bat-5.0.1-1.i386.rpm
-rw-r--r-- 1 root root 1543038 Mar  9 18:31 /usr/src/redhat/RPMS/i386/bacula-client-5.0.1-1.i386.rpm
-rw-r--r-- 1 root root 3308172 Mar  9 18:31 /usr/src/redhat/RPMS/i386/bacula-sqlite-5.0.1-1.i386.rpm
-rw-r--r-- 1 root root   22577 Mar  9 18:31 /usr/src/redhat/RPMS/i386/bacula-updatedb-5.0.1-1.i386.rpm


Next: Bacula 5 RPM Packages installation
Č
ċ
bacula-bat-5.0.1.spec.centos5.diff
(1k)
Emil Cazamir,
Mar 9, 2010, 9:43 AM
ċ
bacula-bat.spec
(10k)
Emil Cazamir,
Mar 9, 2010, 9:43 AM
Comments