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