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: RedHat
38 7.x (rh7), RedHat 8.0 (rh8), RedHat 9 (rh9), Fedora Core (fc1), Whitebox
39 Enterprise Linux (RHEL) 3.0 (wb3), Mandrake 10.x (mdk) and SuSE 9.x (su9).
40 The package build is controlled by a mandatory define set at the beginning of
41 the file. These defines basically just control the dependency information that
42 gets coded into the finished rpm package.
43 The platform define may be edited in the spec file directly (by default all
44 defines are set to 0 or "not set"). For example, to build the RedHat 7.x
45 package find the line in the spec file which reads
63 Alternately you may pass the define on the command line when calling rpmbuild:
68 rpmbuild -ba --define "build_rh7 1" bacula.spec
69 rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
76 {\bf How do I control which database support gets built?}
77 Another mandatory build define controls which database support is compiled,
78 one of build\_sqlite, build\_mysql or build\_postgresql. To get the MySQL
79 package and support either set the
97 in the spec file directly or pass it to rpmbuild on the command line:
101 rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec
108 {\bf What other defines are used?}
109 Two other building defines of note are the depkgs\_version and tomsrtbt
110 identifiers. These two defines are set with each release and must match the
111 version of those sources that are being used to build the packages. You would
112 not ordinarily need to edit these.
115 {\bf I'm getting errors about not having permission when I try to build the
116 packages. Do I need to be root?}
117 No, you do not need to be root and, in fact, it is better practice to build
118 rpm packages as a non-root user. Bacula packages are designed to be built by
119 a regular user but you must make a few changes on your system to do this. If
120 you are building on your own system then the simplest method is to add write
121 permissions for all to the build directory (/usr/src/redhat/). To accomplish
122 this, execute the following command as root:
126 chmod -R 777 /usr/src/redhat
131 If you are working on a shared system where you can not use the method above
132 then you need to recreate the /usr/src/redhat directory tree with all of its
133 subdirectories inside your home directory. Then create a file named {\tt
134 .rpmmacros} in your home directory (or edit the file if it already exists)
135 and add the following line:
139 %_topdir /home/myuser/redhat
146 {\bf I'm building my own rpms but on all platforms and compiles I get an
147 unresolved dependency for something called /usr/afsws/bin/pagsh.}
148 This is a shell from the OpenAFS (Andrew File System). If you are seeing this
149 then you chose to include the docs/examples directory in your package. One of
150 the example scripts in this directory is a pagsh script. Rpmbuild, when
151 scanning for dependencies, looks at the shebang line of all packaged scripts
152 in addition to checking shared libraries. To avoid this do not package the
156 \item {\bf Support for RHEL4, CentOS 4 and x86_64}
158 explicit build support for RHEL4 (I think) and CentOS 4. Build support
159 for x86_64 has also been added. Test builds have been done on CentOS but
164 Build with one of these 3 commands:
167 --define "build_rhel4 1" \
168 --define "build_sqlite 1" \
169 bacula-1.36.2-4.src.rpm
172 --define "build_rhel4 1" \
173 --define "build_postgresql 1" \
174 bacula-1.36.2-4.src.rpm
177 --define "build_rhel4 1" \
178 --define "build_mysql 1" \
179 --define "build_mysql4 1" \
180 bacula-1.36.2-4.src.rpm
182 For CentOS substitute '--define "build_centos4 1"' in place of rhel4.
184 For 64 bit support add '--define "build_x86_64 1"'
188 \subsection*{Build Options}
189 \index[general]{Build Options}
190 \addcontentsline{toc}{subsection}{Build Options}
191 The spec file currently supports building on the following platforms:
195 --define "build_rh7 1"
196 --define "build_rh8 1"
197 --define "build_rh9 1"
200 --define "build_fc1 1"
201 --define "build_fc3 1"
202 --define "build_fc4 1"
204 # Whitebox Enterprise build
205 --define "build_wb3 1"
207 # RedHat Enterprise builds
208 --define "build_rhel3 1"
209 --define "build_rhel4 1"
212 --define "build_centos4 1"
215 --define "build_su9 1"
218 --define "build_mdk 1"
222 --define "build_mysql 1"
223 # if using mysql 4.x define this and mysql above
224 # currently: Mandrake 10.x, SuSE 9.x, RHEL4
225 --define "build_mysql4 1"
228 --define "build_postgresql 1"
231 --define "build_sqlite 1"