4 \section*{Bacula\raisebox{.6ex}{{\footnotesize
5 \textsuperscript{\textregistered}}} - RPM Packaging FAQ}
6 \label{_ChapterStart34}
7 \index[general]{FAQ!Bacula\textsuperscript{\textregistered} - RPM Packaging }
8 \index[general]{Bacula\textsuperscript{\textregistered} - RPM Packaging FAQ }
9 \addcontentsline{toc}{section}{Bacula\textsuperscript{\textregistered} - RPM
14 \ilink{How do I build Bacula for platform xxx?}{faq1}
16 \ilink{How do I control which database support gets built?}{faq2}
19 \ilink{What other defines are used?}{faq3}
21 \ilink{I'm getting errors about not having permission when I try to build the
22 packages. Do I need to be root?}{faq4}
24 \ilink{I'm building my own rpms but on all platforms and compiles I get an
25 unresolved dependancy for something called
26 /usr/afsws/bin/pagsh.}{faq5}
30 \index[general]{Answers }
31 \addcontentsline{toc}{subsection}{Answers}
36 {\bf How do I build Bacula for platform xxx?}
37 The bacula spec file contains defines to build for several platforms:
38 RedHat 7.x (rh7), RedHat 8.0 (rh8), RedHat 9 (rh9), Fedora Core (fc1,
39 fc3, fc4), Whitebox Enterprise Linux (RHEL) 3.0 (wb3), Mandrake 10.x
40 (mdk) and SuSE 9.x (su9). The package build is controlled by a
41 mandatory define set at the beginning of the file. These defines
42 basically just control the dependency information that gets coded into
43 the finished rpm package. The platform define may be edited in the spec
44 file directly (by default all defines are set to 0 or "not set"). For
45 example, to build the RedHat 7.x package find the line in the spec file
64 Alternately you may pass the define on the command line when calling rpmbuild:
69 rpmbuild -ba --define "build_rh7 1" bacula.spec
70 rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
77 {\bf How do I control which database support gets built?}
78 Another mandatory build define controls which database support is compiled,
79 one of build\_sqlite, build\_mysql or build\_postgresql. To get the MySQL
80 package and support either set the
98 in the spec file directly or pass it to rpmbuild on the command line:
102 rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec
109 {\bf What other defines are used?}
110 Two other building defines of note are the depkgs\_version and tomsrtbt
111 identifiers. These two defines are set with each release and must match the
112 version of those sources that are being used to build the packages. You would
113 not ordinarily need to edit these.
116 {\bf I'm getting errors about not having permission when I try to build the
117 packages. Do I need to be root?}
118 No, you do not need to be root and, in fact, it is better practice to
119 build rpm packages as a non-root user. Bacula packages are designed to
120 be built by a regular user but you must make a few changes on your
121 system to do this. If you are building on your own system then the
122 simplest method is to add write permissions for all to the build
123 directory (/usr/src/redhat/). To accomplish this, execute the following
128 chmod -R 777 /usr/src/redhat
133 If you are working on a shared system where you can not use the method
134 above then you need to recreate the /usr/src/redhat directory tree with all
135 of its subdirectories inside your home directory. Then create a file named
139 in your home directory (or edit the file if it already exists)
140 and add the following line:
144 %_topdir /home/myuser/redhat
151 {\bf I'm building my own rpms but on all platforms and compiles I get an
152 unresolved dependency for something called /usr/afsws/bin/pagsh.} This
153 is a shell from the OpenAFS (Andrew File System). If you are seeing
154 this then you chose to include the docs/examples directory in your
155 package. One of the example scripts in this directory is a pagsh
156 script. Rpmbuild, when scanning for dependencies, looks at the shebang
157 line of all packaged scripts in addition to checking shared libraries.
158 To avoid this do not package the examples directory.
161 \item {\bf Support for RHEL4, CentOS 4 and x86_64}
163 explicit build support for RHEL4 (I think) and CentOS 4. Build support
164 for x86_64 has also been added. Test builds have been done on CentOS but
169 Build with one of these 3 commands:
172 --define "build_rhel4 1" \
173 --define "build_sqlite 1" \
174 bacula-1.38.3-1.src.rpm
177 --define "build_rhel4 1" \
178 --define "build_postgresql 1" \
179 bacula-1.38.3-1.src.rpm
182 --define "build_rhel4 1" \
183 --define "build_mysql 1" \
184 --define "build_mysql4 1" \
185 bacula-1.38.3-1.src.rpm
187 For CentOS substitute '--define "build_centos4 1"' in place of rhel4.
189 For 64 bit support add '--define "build_x86_64 1"'
193 \subsection*{Build Options}
194 \index[general]{Build Options}
195 \addcontentsline{toc}{subsection}{Build Options}
196 The spec file currently supports building on the following platforms:
200 --define "build_rh7 1"
201 --define "build_rh8 1"
202 --define "build_rh9 1"
205 --define "build_fc1 1"
206 --define "build_fc3 1"
207 --define "build_fc4 1"
209 # Whitebox Enterprise build
210 --define "build_wb3 1"
212 # RedHat Enterprise builds
213 --define "build_rhel3 1"
214 --define "build_rhel4 1"
217 --define "build_centos4 1"
220 --define "build_su9 1"
223 --define "build_mdk 1"
227 --define "build_mysql 1"
228 # if using mysql 4.x define this and mysql above
229 # currently: Mandrake 10.x, SuSE 9.x, RHEL4
230 --define "build_mysql4 1"
233 --define "build_postgresql 1"
236 --define "build_sqlite 1"