]> git.sur5r.net Git - bacula/docs/blob - docs/manual/rpm-faq.tex
Updates
[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 (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
46    which reads
47
48 \footnotesize
49 \begin{verbatim}
50         %define rh7 0
51         
52 \end{verbatim}
53 \normalsize
54
55 and edit it to read  
56
57 \footnotesize
58 \begin{verbatim}
59         %define rh7 1
60         
61 \end{verbatim}
62 \normalsize
63
64 Alternately you may pass the define on the command line when calling rpmbuild:
65  
66
67 \footnotesize
68 \begin{verbatim}
69         rpmbuild -ba --define "build_rh7 1" bacula.spec
70         rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
71         
72 \end{verbatim}
73 \normalsize
74
75 \item 
76    \label{faq2}
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  
81
82 \footnotesize
83 \begin{verbatim}
84         %define mysql 0
85         
86 \end{verbatim}
87 \normalsize
88
89 to  
90
91 \footnotesize
92 \begin{verbatim}
93         %define mysql 1
94         
95 \end{verbatim}
96 \normalsize
97
98 in the spec file directly or pass it to rpmbuild on the command line:  
99
100 \footnotesize
101 \begin{verbatim}
102         rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec
103         
104 \end{verbatim}
105 \normalsize
106
107 \item 
108    \label{faq3}
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.  
114 \item 
115    \label{faq4}
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
124    command as root:
125
126 \footnotesize
127 \begin{verbatim}
128         chmod -R 777 /usr/src/redhat
129         
130 \end{verbatim}
131 \normalsize
132
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
136
137 {\tt .rpmmacros} 
138
139 in your home directory (or edit  the file if it already exists)
140 and add the following line:  
141
142 \footnotesize
143 \begin{verbatim}
144         %_topdir /home/myuser/redhat
145         
146 \end{verbatim}
147 \normalsize
148
149 \item 
150    \label{faq5}
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.
159 \end{enumerate}
160
161 \item {\bf Support for RHEL4, CentOS 4 and x86_64}
162    The examples below
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 
165    not RHEL4.
166
167 \footnotesize
168 \begin{verbatim}
169 Build with one of these 3 commands:
170
171 rpmbuild --rebuild \
172         --define "build_rhel4 1" \
173         --define "build_sqlite 1" \
174         bacula-1.38.3-1.src.rpm
175
176 rpmbuild --rebuild \
177         --define "build_rhel4 1" \
178         --define "build_postgresql 1" \
179         bacula-1.38.3-1.src.rpm
180
181 rpmbuild --rebuild \
182         --define "build_rhel4 1" \
183         --define "build_mysql 1" \
184         --define "build_mysql4 1" \
185         bacula-1.38.3-1.src.rpm
186
187 For CentOS substitute '--define "build_centos4 1"' in place of rhel4.
188
189 For 64 bit support add '--define "build_x86_64 1"'
190 \end{verbatim}
191 \normalsize
192
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:
197 \footnotesize
198 \begin{verbatim}
199 # RedHat builds
200 --define "build_rh7 1"
201 --define "build_rh8 1"
202 --define "build_rh9 1"
203
204 # Fedora Core build
205 --define "build_fc1 1"
206 --define "build_fc3 1"
207 --define "build_fc4 1"
208
209 # Whitebox Enterprise build
210 --define "build_wb3 1"
211
212 # RedHat Enterprise builds
213 --define "build_rhel3 1"
214 --define "build_rhel4 1"
215
216 # CentOS build
217 --define "build_centos4 1"
218
219 # SuSE build
220 --define "build_su9 1"
221
222 # Mandrake build
223 --define "build_mdk 1"
224
225 MySQL support:
226
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"
231
232 PostgreSQL support:
233 --define "build_postgresql 1"
234
235 Sqlite support:
236 --define "build_sqlite 1"
237
238 \end{verbatim}
239 \normalsize