%define rh7 0
and edit it to read
%define rh7 1
Alternately you may pass the define on the command line when calling rpmbuild:
rpmbuild -ba --define "build_rh7 1" bacula.spec rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
%define mysql 0 OR %define mysql4 0 OR %define mysql5 0
to
%define mysql 1 OR %define mysql4 1 OR %define mysql5 1
in the spec file directly or pass it to rpmbuild on the command line:
rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec rpmbuild -ba --define "build_rh7 1" --define "build_mysql4 1" bacula.spec rpmbuild -ba --define "build_rh7 1" --define "build_mysql5 1" bacula.spec
chmod -R 777 /usr/src/redhat chmod -R 777 /usr/src/RPM chmod -R 777 /usr/src/packages
If you are working on a shared system where you can not use the method above then you need to recreate the appropriate above directory tree with all of its subdirectories inside your home directory. Then create a file named
.rpmmacros
in your home directory (or edit the file if it already exists) and add the following line:
%_topdir /home/myuser/redhat
Another handy directive for the .rpmmacros file if you wish to suppress the creation of debug rpm packages is:
%debug_package %{nil}
chown bacula.bacula /var/bacula/* chown root.bacula /var/bacula/bacula-fd.9102.state chown bacula.disk /var/bacula/bacula-sd.9103.state
Further, if you are using File storage volumes rather than tapes those files will also need to have ownership set to user bacula and group bacula.
Build with one of these 3 commands: rpmbuild --rebuild \ --define "build_rhel4 1" \ --define "build_sqlite 1" \ bacula-1.38.3-1.src.rpm rpmbuild --rebuild \ --define "build_rhel4 1" \ --define "build_postgresql 1" \ bacula-1.38.3-1.src.rpm rpmbuild --rebuild \ --define "build_rhel4 1" \ --define "build_mysql4 1" \ bacula-1.38.3-1.src.rpm For CentOS substitute '--define "build_centos4 1"' in place of rhel4. For Scientific Linux substitute '--define "build_sl4 1"' in place of rhel4. For 64 bit support add '--define "build_x86_64 1"'
Red Hat builds --define "build_rh7 1" --define "build_rh8 1" --define "build_rh9 1" Fedora Core build --define "build_fc1 1" --define "build_fc3 1" --define "build_fc4 1" --define "build_fc5 1" --define "build_fc6 1" --define "build_fc7 1" --define "build_fc8 1" --define "build_fc9 1" Whitebox Enterprise build --define "build_wb3 1" Red Hat Enterprise builds --define "build_rhel3 1" --define "build_rhel4 1" --define "build_rhel5 1" CentOS build --define "build_centos3 1" --define "build_centos4 1" --define "build_centos5 1" Scientific Linux build --define "build_sl3 1" --define "build_sl4 1" --define "build_sl5 1" SuSE build --define "build_su9 1" --define "build_su10 1" --define "build_su102 1" --define "build_su103 1" --define "build_su110 1" --define "build_su111 1" Mandrake 10.x build --define "build_mdk 1" Mandriva build --define "build_mdv 1" MySQL support: for mysql 3.23.x support define this --define "build_mysql 1" if using mysql 4.x define this, currently: Mandrake 10.x, Mandriva 2006.0, SuSE 9.x & 10.0, FC4 & RHEL4 --define "build_mysql4 1" if using mysql 5.x define this, currently: SuSE 10.1 & FC5 --define "build_mysql5 1" PostgreSQL support: --define "build_postgresql 1" Sqlite support: --define "build_sqlite 1" Build the client rpm only in place of one of the above database full builds: --define "build_client_only 1" X86-64 support: --define "build_x86_64 1" Supress build of bgnome-console: --define "nobuild_gconsole 1" Build the WXWindows console: requires wxGTK >= 2.6 --define "build_wxconsole 1" Build the Bacula Administration Tool: requires QT >= 4.2 --define "build_bat 1" Build python scripting support: --define "build_python 1" Modify the Packager tag for third party packages: --define "contrib_packager Your Name <youremail@site.org>" Install most files to /opt/bacula directory: --define "single_dir_install 1" Supress building the rescue files: --define "nobuild_rescue 1"
chown bacula:bacula /var/baculaNote: as of 1.38.8 /var/bacula is installed root:bacula with permissions 770.
Kern Sibbald 2009-02-06