%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
to
%define mysql 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
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 %_tmppath /tmp
It should be noted that Fedora from verion 10 and up is configured to build in the directory /rpmbuild.
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" --define "build_fc10 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" --define "build_su112 1" Mandrake 10.x build --define "build_mdk 1" Mandriva build --define "build_mdv 1" MySQL support: --define "build_mysql 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" Build python scripting support: --define "build_python 1" Build tcpwrappers support: --define "build_tcpwrappers 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"
chown bacula:bacula /var/baculaNote: as of 1.38.8 /var/bacula is installed root:bacula with permissions 770.
Kern Sibbald 2015-07-04