]> git.sur5r.net Git - bacula/docs/blob - docs/manual/rpm-faq.tex
This commit was manufactured by cvs2svn to create tag
[bacula/docs] / docs / manual / rpm-faq.tex
1 %%
2 %%
3
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
10 Packaging FAQ}
11
12 \begin{enumerate}
13 \item 
14    \ilink{How do I build Bacula for platform xxx?}{faq1}  
15 \item 
16    \ilink{How do I control which database support gets built?}{faq2} 
17
18 \item 
19    \ilink{What other defines are used?}{faq3}  
20 \item 
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}  
23 \item 
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} 
27 \end{enumerate}
28
29 \subsection*{Answers}
30 \index[general]{Answers }
31 \addcontentsline{toc}{subsection}{Answers}
32
33 \begin{enumerate}
34 \item 
35    \label{faq1}
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 3.0 (wb3), Red Hat Enterprise Linux 
40    (rhel3, rhel4), Mandrake 10.x (mdk), CentOS (centos3, centos4) and SuSE 
41    (su9, su10). The package build is controlled by a mandatory define set at 
42    the beginning of the file.  These defines basically just control the 
43    dependency information that gets coded into the finished rpm package as well 
44    as any special configure options required.  The platform define may be edited 
45    in the spec file directly (by default all defines are set to 0 or "not set").  
46    For example, to build the RedHat 7.x package find the line in the spec file
47    which reads
48
49 \footnotesize
50 \begin{verbatim}
51         %define rh7 0
52         
53 \end{verbatim}
54 \normalsize
55
56 and edit it to read  
57
58 \footnotesize
59 \begin{verbatim}
60         %define rh7 1
61         
62 \end{verbatim}
63 \normalsize
64
65 Alternately you may pass the define on the command line when calling rpmbuild:
66  
67
68 \footnotesize
69 \begin{verbatim}
70         rpmbuild -ba --define "build_rh7 1" bacula.spec
71         rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
72         
73 \end{verbatim}
74 \normalsize
75
76 \item 
77    \label{faq2}
78    {\bf How do I control which database support gets built?}
79    Another mandatory build define controls which database support is compiled,
80    one of  build\_sqlite, build\_mysql or build\_postgresql. To get the MySQL
81    package and support either  set the  
82
83 \footnotesize
84 \begin{verbatim}
85         %define mysql 0
86         OR
87         %define mysql4 0
88         
89 \end{verbatim}
90 \normalsize
91
92 to  
93
94 \footnotesize
95 \begin{verbatim}
96         %define mysql 1
97         OR
98         %define mysql4 1
99         
100 \end{verbatim}
101 \normalsize
102
103 in the spec file directly or pass it to rpmbuild on the command line:  
104
105 \footnotesize
106 \begin{verbatim}
107         rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec
108         rpmbuild -ba --define "build_rh7 1" --define "build_mysql4 1" bacula.spec
109         
110 \end{verbatim}
111 \normalsize
112
113 \item 
114    \label{faq3}
115    {\bf What other defines are used?}
116    Two other building defines of note are the depkgs\_version and \_rescuever
117    identifiers. These  two defines are set with each release and must match the
118    version of those sources that are  being used to build the packages. You would
119    not ordinarily need to edit these.  
120 \item 
121    \label{faq4}
122    {\bf I'm getting errors about not having permission when I try  to build the
123    packages. Do I need to be root?}
124    No, you do not need to be root and, in fact, it is better practice to
125    build rpm packages as a non-root user.  Bacula packages are designed to
126    be built by a regular user but you must make a few changes on your
127    system to do this.  If you are building on your own system then the
128    simplest method is to add write permissions for all to the build
129    directory (/usr/src/redhat/, /usr/src/RPM or /usr/src/packages).  
130    To accomplish this, execute the following command as root:
131
132 \footnotesize
133 \begin{verbatim}
134         chmod -R 777 /usr/src/redhat
135         chmod -R 777 /usr/src/RPM
136         chmod -R 777 /usr/src/packages
137         
138 \end{verbatim}
139 \normalsize
140
141 If you are working on a shared system where you can not use the method
142 above then you need to recreate the appropriate above directory tree with all
143 of its subdirectories inside your home directory.  Then create a file named
144
145 {\tt .rpmmacros} 
146
147 in your home directory (or edit  the file if it already exists)
148 and add the following line:  
149
150 \footnotesize
151 \begin{verbatim}
152         %_topdir /home/myuser/redhat
153         
154 \end{verbatim}
155 \normalsize
156
157 Another handy directive for the .rpmmacros file if you wish to supress the
158 creation of debug rpm packages is:
159
160 \footnotesize
161 \begin{verbatim}
162         %debug_package %{nil}
163         
164 \end{verbatim}
165
166 \normalsize
167
168 \item 
169    \label{faq5}
170    {\bf I'm building my own rpms but on all platforms and compiles I get an
171    unresolved dependency for something called /usr/afsws/bin/pagsh.} This
172    is a shell from the OpenAFS (Andrew File System).  If you are seeing
173    this then you chose to include the docs/examples directory in your
174    package.  One of the example scripts in this directory is a pagsh
175    script.  Rpmbuild, when scanning for dependencies, looks at the shebang
176    line of all packaged scripts in addition to checking shared libraries.
177    To avoid this do not package the examples directory. If you are seeing this 
178    problem you are building a very old bacula package as the examples have been 
179    removed from the doc packaging.
180 \end{enumerate}
181
182 \item {\bf Support for RHEL3/4, CentOS 3/4 and x86_64}
183    The examples below show
184    explicit build support for RHEL4 and CentOS 4. Build support 
185    for x86_64 has also been added. Test builds have been done on CentOS but 
186    not RHEL4.
187
188 \footnotesize
189 \begin{verbatim}
190 Build with one of these 3 commands:
191
192 rpmbuild --rebuild \
193         --define "build_rhel4 1" \
194         --define "build_sqlite 1" \
195         bacula-1.38.3-1.src.rpm
196
197 rpmbuild --rebuild \
198         --define "build_rhel4 1" \
199         --define "build_postgresql 1" \
200         bacula-1.38.3-1.src.rpm
201
202 rpmbuild --rebuild \
203         --define "build_rhel4 1" \
204         --define "build_mysql4 1" \
205         bacula-1.38.3-1.src.rpm
206
207 For CentOS substitute '--define "build_centos4 1"' in place of rhel4.
208
209 For 64 bit support add '--define "build_x86_64 1"'
210 \end{verbatim}
211 \normalsize
212
213 \subsection*{Build Options}
214 \index[general]{Build Options}
215 \addcontentsline{toc}{subsection}{Build Options}
216 The spec file currently supports building on the following platforms:
217 \footnotesize
218 \begin{verbatim}
219 RedHat builds
220 --define "build_rh7 1"
221 --define "build_rh8 1"
222 --define "build_rh9 1"
223
224 Fedora Core build
225 --define "build_fc1 1"
226 --define "build_fc3 1"
227 --define "build_fc4 1"
228
229 Whitebox Enterprise build
230 --define "build_wb3 1"
231
232 RedHat Enterprise builds
233 --define "build_rhel3 1"
234 --define "build_rhel4 1"
235
236 CentOS build
237 --define "build_centos3 1"
238 --define "build_centos4 1"
239
240 SuSE build
241 --define "build_su9 1"
242 --define "build_su10 1"
243
244 Mandrake 10.x build
245 --define "build_mdk 1"
246
247 Mandriva build
248 --define "build_mdv 1"
249
250 MySQL support:
251 for mysql 3.23.x support define this
252 --define "build_mysql 1"
253 if using mysql 4.x define this,
254 currently: Mandrake 10.x, SuSE 9.x & 10.x, FC4 & RHEL4
255 --define "build_mysql4 1"
256
257 PostgreSQL support:
258 --define "build_postgresql 1"
259
260 Sqlite support:
261 --define "build_sqlite 1"
262
263 X86-64 support:
264 --define "build_x86_64 1"
265
266 Supress build of gnome console:
267 --define "nobuild_gconsole 1"
268
269 Build the WXWindows console:
270 requires wxGTK >= 2.6
271 --define "build_wxconsole 1"
272
273 \end{verbatim}
274 \normalsize
275
276 \subsection*{RPM Install Problems}
277 \index[general]{RPM Install Problems}
278 \addcontentsline{toc}{subsection}{RPM Install Options}
279 In general the RPMs, once properly built should install correctly.
280 However, when attempting to run the daemons, a number of problems
281 can occur:
282 \begin{itemize}
283 \item [Wrong /var/bacula Permissions]
284   By default, the Director and Storage daemon do not run with
285   root permission. If the /var/bacula is owned by root, then it
286   is possible that the Director and the Storage daemon will not
287   be able to access this directory, which is used as the Working
288   Directory. To fix this, the easiest thing to do is:
289 \begin{verbatim}
290   chown bacula:bacula /var/bacula
291 \end{verbatim}
292   Note: as of 1.38.8 /var/bacula is installed root:bacula with
293   permissions 770.
294 \item [The Storage daemon cannot Access the Tape drive]
295   This can happen in some older RPM releases where the Storage
296   daemon ran under userid bacula, group bacula.  There are two
297   ways of fixing this: the best is to modify the /etc/init.d/bacula-sd
298   file so that it starts the Storage daemon with group "disk".
299   The second way to fix the problem is to change the permissions
300   of your tape drive (usually /dev/nst0) so that Bacula can access it.
301   You will probably need to change the permissions of the SCSI control
302   device as well, which is usually /dev/sg0.  The exact names depend
303   on your configuration, please see the Tape Testing chapter for
304   more information on devices.
305 \end{itemize}
306  
307