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