]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula.spec.in
Update to sqlite3.
[bacula/bacula] / bacula / platforms / redhat / bacula.spec.in
1 # Bacula RPM spec file
2 # Copyright (C) 2000-2006 Kern Sibbald
3
4 # Platform Build Configuration
5
6 # basic defines for every build
7 %define _version @VERSION@
8 %define _release 1
9 %define depkgs_version 09Sep07
10 %define _rescuever @VERSION@
11 %define docs_version @VERSION@
12
13 # any patches for this release
14 # be sure to check the setup section for patch macros
15
16 #--------------------------------------------------------------------------
17 # it should not be necessary to change anything below here for a release
18 # except for patch macros in the setup section
19 #--------------------------------------------------------------------------
20
21 # third party packagers
22 %define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
23 %{?contrib_packager:%define _packager %{contrib_packager}}
24
25 Summary: Bacula - The Network Backup Solution
26 Name: bacula
27 Version: %{_version}
28 Release: %{_release}
29 Group: System Environment/Daemons
30 License: GPL v2
31 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
32 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
33 Source2: Release_Notes-%{version}-%{release}.tar.gz
34 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
35 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
36 BuildRoot: %{_tmppath}/%{name}-root
37 URL: http://www.bacula.org/
38 Vendor: The Bacula Team
39 Packager: %{_packager}
40
41 # define the basic package description
42 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
43 %define blurb2 Bacula is a set of computer programs that permit you (or the system
44 %define blurb3 administrator) to manage backup, recovery, and verification of computer
45 %define blurb4 data across a network of computers of different kinds. In technical terms,
46 %define blurb5 it is a network client/server based backup program. Bacula is relatively
47 %define blurb6 easy to use and efficient, while offering many advanced storage management
48 %define blurb7 features that make it easy to find and recover lost or damaged files.
49 %define blurb8 Bacula source code has been released under the GPL version 2 license.
50
51 # directory locations
52 %define sqlite_bindir /usr/lib/bacula/sqlite
53 %define _docsrc ../%{name}-docs-%{docs_version}
54 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
55 %define depkgs ../depkgs
56 %define _mandir /usr/share/man
57
58 # directory locations for FHS-compatibility
59 %define sysconf_dir /etc/bacula
60 %define script_dir /etc/bacula
61 %define working_dir /var/lib/bacula
62 %define pid_dir /var/run
63
64 # NOTE these defines are used in some rather complex useradd and groupadd
65 # commands. If you change them examine the post scripts for consequences.
66 %define director_daemon_user bacula
67 %define storage_daemon_user bacula
68 %define file_daemon_user root
69 %define daemon_group bacula
70 # group that has write access to tape devices, usually disk on Linux
71 %define storage_daemon_group disk
72 %define user_file /etc/passwd
73 %define group_file /etc/group
74
75 # program locations
76 %define useradd /usr/sbin/useradd
77 %define groupadd /usr/sbin/groupadd
78 %define usermod /usr/sbin/usermod
79
80 # platform defines - set one below or define the build_xxx on the command line
81 # RedHat builds
82 %define rh7 0
83 %{?build_rh7:%define rh7 1}
84 %define rh8 0
85 %{?build_rh8:%define rh8 1}
86 %define rh9 0
87 %{?build_rh9:%define rh9 1}
88 # Fedora Core build
89 %define fc1 0
90 %{?build_fc1:%define fc1 1}
91 %define fc3 0
92 %{?build_fc3:%define fc3 1}
93 %define fc4 0
94 %{?build_fc4:%define fc4 1}
95 %define fc5 0
96 %{?build_fc5:%define fc5 1}
97 %define fc6 0
98 %{?build_fc6:%define fc6 1}
99 %define fc7 0
100 %{?build_fc7:%define fc7 1}
101 # Whitebox Enterprise build
102 %define wb3 0
103 %{?build_wb3:%define wb3 1}
104 # RedHat Enterprise builds
105 %define rhel3 0
106 %{?build_rhel3:%define rhel3 1}
107 %{?build_rhel3:%define wb3 1}
108 %define rhel4 0
109 %{?build_rhel4:%define rhel4 1}
110 %{?build_rhel4:%define fc3 1}
111 %define rhel5 0
112 %{?build_rhel5:%define rhel5 1}
113 %{?build_rhel5:%define fc6 1}
114 # CentOS build
115 %define centos3 0
116 %{?build_centos3:%define centos3 1}
117 %{?build_centos3:%define wb3 1}
118 %define centos4 0
119 %{?build_centos4:%define centos4 1}
120 %{?build_centos4:%define fc3 1}
121 %define centos5 0
122 %{?build_centos5:%define centos5 1}
123 %{?build_centos5:%define fc6 1}
124 # SL build
125 %define sl3 0
126 %{?build_sl3:%define sl3 1}
127 %{?build_sl3:%define wb3 1}
128 %define sl4 0
129 %{?build_sl4:%define sl4 1}
130 %{?build_sl4:%define fc3 1}
131 %define sl5 0
132 %{?build_sl5:%define sl5 1}
133 %{?build_sl5:%define fc6 1}
134 # SuSE build
135 %define su9 0
136 %{?build_su9:%define su9 1}
137 %define su10 0
138 %{?build_su10:%define su10 1}
139 %define su102 0
140 %{?build_su102:%define su102 1}
141 %define su103 0
142 %{?build_su103:%define su103 1}
143 # Mandrake builds
144 %define mdk 0
145 %{?build_mdk:%define mdk 1}
146 %define mdv 0
147 %{?build_mdv:%define mdv 1}
148 %{?build_mdv:%define mdk 1}
149
150 # client only build
151 %define client_only 0
152 %{?build_client_only:%define client_only 1}
153
154 # test for a platform definition
155 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk}
156 %{error: You must specify a platform. Please examine the spec file.}
157 exit 1
158 %endif
159
160 # database defines
161 # set for database support desired or define the build_xxx on the command line
162 %define mysql 0
163 %{?build_mysql:%define mysql 1}
164 # if using mysql 4.x define this and mysql above
165 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
166 %define mysql4 0
167 %{?build_mysql4:%define mysql4 1}
168 %{?build_mysql4:%define mysql 1}
169 # if using mysql 5.x define this and mysql above
170 # currently: SuSE 10.1 and Fedora Core 5
171 %define mysql5 0
172 %{?build_mysql5:%define mysql5 1}
173 %{?build_mysql5:%define mysql 1}
174 %define sqlite 0
175 %{?build_sqlite:%define sqlite 1}
176 %define postgresql 0
177 %{?build_postgresql:%define postgresql 1}
178
179 # test for a database definition
180 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
181 %{error: You must specify database support. Please examine the spec file.}
182 exit 1
183 %endif
184
185 %if %{mysql}
186 %define db_backend mysql
187 %endif
188 %if %{sqlite}
189 %define db_backend sqlite3
190 %endif
191 %if %{postgresql}
192 %define db_backend postgresql
193 %endif
194
195 # 64 bit support
196 %define x86_64 0
197 %{?build_x86_64:%define x86_64 1}
198
199 # check what distribution we are
200 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4} || %{rhel5}
201 %define _dist %(grep Red /etc/redhat-release)
202 %endif
203 %if %{fc1} || %{fc4} || %{fc5} || %{fc7}
204 %define _dist %(grep Fedora /etc/redhat-release)
205 %endif
206 %if %{centos5} || %{centos4} || %{centos3}
207 %define _dist %(grep CentOS /etc/redhat-release)
208 %endif
209 %if %{sl5} ||%{sl4} || %{sl3}
210 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
211 %endif
212 %if %{fc3} && ! %{rhel4} && ! %{centos4} && ! %{sl4}
213 %define _dist %(grep Fedora /etc/redhat-release)
214 %endif
215 %if %{fc6} && ! %{rhel5} && ! %{centos5} && ! %{sl5}
216 %define _dist %(grep Fedora /etc/redhat-release)
217 %endif
218 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
219 %define _dist %(grep White /etc/whitebox-release)
220 %endif
221 %if %{su9} || %{su10} || %{su102} || %{su103}
222 %define _dist %(grep -i SuSE /etc/SuSE-release)
223 %endif
224 %if %{mdk}
225 %define _dist %(grep Mand /etc/mandrake-release)
226 %endif
227 Distribution: %{_dist}
228
229 # Should we build gconsole, possible only if gtk= >= 2.4 available.
230 # leaving all the BuildRequires and Requires in place below for now.
231 # su10, fc3 and fc4 now nobuild, tray monitor fails to build as of 2.2.1 
232 # release as it needs 2.10
233
234 %define gconsole 1
235 %if %{rh7} || %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{su9} || %{su10}
236 %define gconsole 0
237 %endif
238 %if %{mdk} && ! %{mdv}
239 %define gconsole 0
240 %endif
241
242 # specifically disallow gconsole if desired
243 %{?nobuild_gconsole:%define gconsole 0}
244
245 # Should we build wxconsole, only wxWidgets >=2.6 is supported
246 # currently only SuSE 10 and FC4/FC5
247 %define wxconsole 0
248 %{?build_wxconsole:%define wxconsole 1}
249
250 # Should we build bat
251 # requires >= Qt-4.2
252 %define bat 0
253 %{?build_bat:%define bat 1}
254
255 # should we turn on python support
256 %define python 0
257 %{?build_python:%define python 1}
258
259 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
260 %if %{mdk}
261 %define manpage_ext bz2
262 %else
263 %define manpage_ext gz
264 %endif
265
266 # for client only build
267 %if %{client_only}
268 %define mysql 0
269 %define mysql4 0
270 %define mysql5 0
271 %define postgresql 0
272 %define sqlite 0
273 %define gconsole 0
274 %define wxconsole 0
275 %endif
276
277 %{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)}
278 %{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)}
279
280 BuildRequires: gcc, gcc-c++, make, autoconf
281 BuildRequires: ncurses-devel, perl
282 BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, libxml2-devel, zlib-devel
283 BuildRequires: openssl-devel
284 %if %{python}
285 BuildRequires: python, python-devel
286 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
287 %endif
288 %if %{gconsole}
289 BuildRequires: pkgconfig, pango-devel, atk-devel
290 %endif
291
292 # Rh qt4 packages don't provide, guess what, qt!
293 # so fix for broken rh
294 %define broken_rh 0
295 %if %{rhel5} || %{centos5} || %{sl5} || %{fc5} || %{fc6} || %{fc7}
296 %define broken_rh 1
297 %endif
298 %if %{bat} && ! %{broken_rh}
299 BuildRequires: qt-devel >= 4.2
300 %endif
301 %if %{bat} && %{broken_rh}
302 BuildRequires: qt4-devel >= 4.2
303 %endif
304
305 %if %{rh7}
306 BuildRequires: libtermcap-devel
307 BuildRequires: glibc-devel >= 2.2
308 %endif
309 %if %{su9}
310 BuildRequires: termcap
311 BuildRequires: glibc-devel >= 2.3
312 %endif
313 %if %{su9} && %{gconsole}
314 BuildRequires: libgnome >= 2.0
315 BuildRequires: gtk2-devel >= 2.0
316 BuildRequires: libgnomeui-devel >= 2.0
317 BuildRequires: ORBit2-devel
318 BuildRequires: libart_lgpl-devel >= 2.0
319 BuildRequires: libbonobo-devel >= 2.0
320 BuildRequires: libbonoboui-devel >= 2.0
321 BuildRequires: bonobo-activation-devel
322 BuildRequires: gconf2-devel
323 BuildRequires: linc-devel
324 BuildRequires: freetype2-devel
325 %endif
326 %if %{su10}
327 BuildRequires: termcap
328 BuildRequires: glibc-devel >= 2.3
329 %endif
330 %if %{su10} && %{gconsole}
331 BuildRequires: libgnome >= 2.12
332 BuildRequires: gtk2-devel >= 2.8
333 BuildRequires: libgnomeui-devel >= 2.12
334 BuildRequires: ORBit2-devel
335 BuildRequires: libart_lgpl-devel >= 2.3
336 BuildRequires: libbonobo-devel >= 2.10
337 BuildRequires: libbonoboui-devel >= 2.10
338 BuildRequires: bonobo-activation-devel
339 BuildRequires: gconf2-devel
340 BuildRequires: freetype2-devel
341 BuildRequires: cairo-devel
342 BuildRequires: fontconfig-devel >= 2.3
343 BuildRequires: gnome-vfs2-devel >= 2.12
344 BuildRequires: libpng-devel
345 %endif
346 %if %{su102}
347 BuildRequires: termcap
348 BuildRequires: glibc-devel >= 2.5
349 %endif
350 %if %{su102} && %{gconsole}
351 BuildRequires: libgnome >= 2.16
352 BuildRequires: gtk2-devel >= 2.10
353 BuildRequires: libgnomeui-devel >= 2.16
354 BuildRequires: ORBit2-devel
355 BuildRequires: libart_lgpl-devel >= 2.3
356 BuildRequires: libbonobo-devel >= 2.16
357 BuildRequires: libbonoboui-devel >= 2.16
358 BuildRequires: bonobo-activation-devel
359 BuildRequires: gconf2-devel
360 BuildRequires: freetype2-devel
361 BuildRequires: cairo-devel
362 BuildRequires: fontconfig-devel >= 2.4
363 BuildRequires: gnome-vfs2-devel >= 2.16
364 BuildRequires: libpng-devel
365 %endif
366 %if %{su103}
367 BuildRequires: termcap
368 BuildRequires: glibc-devel >= 2.6
369 %endif
370 %if %{su103} && %{gconsole}
371 BuildRequires: libgnome >= 2.20
372 BuildRequires: gtk2-devel >= 2.12
373 BuildRequires: libgnomeui-devel >= 2.20
374 BuildRequires: ORBit2-devel
375 BuildRequires: libart_lgpl-devel >= 2.3
376 BuildRequires: libbonobo-devel >= 2.20
377 BuildRequires: libbonoboui-devel >= 2.20
378 BuildRequires: bonobo-activation-devel
379 BuildRequires: gconf2-devel
380 BuildRequires: freetype2-devel
381 BuildRequires: cairo-devel
382 BuildRequires: fontconfig-devel >= 2.4
383 BuildRequires: gnome-vfs2-devel >= 2.20
384 BuildRequires: libpng-devel
385 %endif
386 %if %{mdk}
387 BuildRequires: libtermcap-devel
388 BuildRequires: libstdc++-static-devel
389 BuildRequires: glibc-static-devel
390 BuildRequires: glibc-devel >= 2.3
391 %endif
392 %if %{mdk} && !%{mdv} && %{gconsole}
393 BuildRequires: gtk2-devel >= 2.0
394 BuildRequires: libgnomeui2-devel >= 2.0
395 BuildRequires: libORBit2-devel
396 BuildRequires: libart_lgpl-devel >= 2.0
397 BuildRequires: libbonobo2_0-devel
398 BuildRequires: libbonoboui2_0-devel
399 BuildRequires: libbonobo-activation-devel
400 BuildRequires: libGConf2-devel
401 BuildRequires: freetype2-devel
402 %endif
403 %if %{mdv} && %{gconsole}
404 BuildRequires: gtk2-devel >= 2.8
405 BuildRequires: libgnomeui2-devel >= 2.10
406 BuildRequires: libORBit2-devel
407 BuildRequires: libart_lgpl-devel >= 2.3
408 BuildRequires: libbonobo2_0-devel
409 BuildRequires: libbonoboui2_0-devel
410 BuildRequires: libbonobo-activation-devel
411 BuildRequires: libGConf2-devel
412 BuildRequires: freetype2-devel
413 %endif
414 %if %{fc3}
415 BuildRequires: libtermcap-devel
416 BuildRequires: glibc-devel >= 2.3
417 %endif
418 %if %{fc3} && %{gconsole}
419 BuildRequires: gtk2-devel >= 2.4
420 BuildRequires: libgnomeui-devel >= 2.8
421 BuildRequires: ORBit2-devel
422 BuildRequires: libart_lgpl-devel >= 2.3
423 BuildRequires: libbonobo-devel >= 2.8
424 BuildRequires: libbonoboui-devel >= 2.8
425 BuildRequires: bonobo-activation-devel
426 BuildRequires: GConf2-devel
427 BuildRequires: freetype-devel
428 %endif
429 %if %{fc4}
430 BuildRequires: libtermcap-devel
431 BuildRequires: glibc-devel >= 2.3
432 %endif
433 %if %{fc4} && %{gconsole}
434 BuildRequires: gtk2-devel >= 2.6
435 BuildRequires: libgnomeui-devel >= 2.10
436 BuildRequires: ORBit2-devel
437 BuildRequires: libart_lgpl-devel >= 2.3
438 BuildRequires: libbonobo-devel >= 2.8
439 BuildRequires: libbonoboui-devel >= 2.8
440 BuildRequires: bonobo-activation-devel
441 BuildRequires: GConf2-devel
442 BuildRequires: freetype-devel
443 %endif
444 %if %{fc5}
445 BuildRequires: libtermcap-devel
446 BuildRequires: glibc-devel >= 2.4
447 %endif
448 %if %{fc5} && %{gconsole}
449 BuildRequires: gtk2-devel >= 2.8
450 BuildRequires: libgnomeui-devel >= 2.14
451 BuildRequires: ORBit2-devel
452 BuildRequires: libart_lgpl-devel >= 2.3
453 BuildRequires: libbonobo-devel >= 2.14
454 BuildRequires: libbonoboui-devel >= 2.14
455 BuildRequires: GConf2-devel
456 BuildRequires: freetype-devel
457 %endif
458 %if %{fc6}
459 BuildRequires: libtermcap-devel
460 BuildRequires: glibc-devel >= 2.5
461 %endif
462 %if %{fc6} && %{gconsole}
463 BuildRequires: gtk2-devel >= 2.10
464 BuildRequires: libgnomeui-devel >= 2.16
465 BuildRequires: ORBit2-devel
466 BuildRequires: libart_lgpl-devel >= 2.3
467 BuildRequires: libbonobo-devel >= 2.16
468 BuildRequires: libbonoboui-devel >= 2.16
469 BuildRequires: GConf2-devel
470 BuildRequires: freetype-devel
471 %endif
472 %if %{fc7}
473 BuildRequires: libtermcap-devel
474 BuildRequires: glibc-devel >= 2.5
475 %endif
476 %if %{fc7} && %{gconsole}
477 BuildRequires: gtk2-devel >= 2.10
478 BuildRequires: libgnomeui-devel >= 2.18
479 BuildRequires: ORBit2-devel
480 BuildRequires: libart_lgpl-devel >= 2.3
481 BuildRequires: libbonobo-devel >= 2.18
482 BuildRequires: libbonoboui-devel >= 2.18
483 BuildRequires: GConf2-devel
484 BuildRequires: freetype-devel
485 %endif
486 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7}
487 BuildRequires: libtermcap-devel
488 BuildRequires: glibc-devel >= 2.3
489 %endif
490 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7} && %{gconsole}
491 BuildRequires: gtk2-devel >= 2.0
492 BuildRequires: libgnomeui-devel >= 2.0
493 BuildRequires: ORBit2-devel
494 BuildRequires: libart_lgpl-devel >= 2.0
495 BuildRequires: libbonobo-devel >= 2.0
496 BuildRequires: libbonoboui-devel >= 2.0
497 BuildRequires: bonobo-activation-devel
498 BuildRequires: GConf2-devel
499 BuildRequires: linc-devel
500 BuildRequires: freetype-devel
501 %endif
502
503 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
504 BuildRequires: mysql-devel >= 3.23
505 %endif
506
507 %if %{mysql} && %{mysql4}
508 BuildRequires: mysql-devel >= 4.0
509 %endif
510
511 %if %{mysql} && %{mysql5}
512 BuildRequires: mysql-devel >= 5.0
513 %endif
514
515 %if %{postgresql} && %{wb3}
516 BuildRequires: rh-postgresql-devel >= 7
517 %endif
518
519 %if %{postgresql} && ! %{wb3}
520 BuildRequires: postgresql-devel >= 7
521 %endif
522
523 %if %{wxconsole}
524 BuildRequires: wxGTK-devel >= 2.6
525 %endif
526
527 %description
528 %{blurb}
529
530 %{blurb2}
531 %{blurb3}
532 %{blurb4}
533 %{blurb5}
534 %{blurb6}
535 %{blurb7}
536 %{blurb8}
537
538 %if %{mysql}
539 %package mysql
540 %endif
541 %if %{sqlite}
542 %package sqlite
543 %endif
544 %if %{postgresql}
545 %package postgresql
546 %endif
547
548 Summary: Bacula - The Network Backup Solution
549 Group: System Environment/Daemons
550 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
551 Conflicts: bacula-client
552 Obsoletes: bacula-rescue
553
554 %if %{su9} || %{su10} || %{su102} || %{su103}
555 Conflicts: bacula
556 %endif
557
558 Requires: ncurses, libstdc++, zlib, openssl, mtx
559
560 %if %{rh7}
561 Requires: glibc >= 2.2
562 Requires: libtermcap
563 %endif
564 %if %{su9} || %{su10}
565 Requires: glibc >= 2.3
566 Requires: termcap
567 %endif
568 %if %{su102}
569 Requires: glibc >= 2.5
570 Requires: termcap
571 %endif
572 %if %{su103}
573 Requires: glibc >= 2.6
574 Requires: termcap
575 %endif
576 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{fc5} && ! %{fc6} && ! %{fc7}
577 Requires: glibc >= 2.3
578 Requires: libtermcap
579 %endif
580 %if %{fc5}
581 Requires: glibc >= 2.4
582 Requires: libtermcap
583 %endif
584 %if %{fc6} || %{fc7}
585 Requires: glibc >= 2.5
586 Requires: libtermcap
587 %endif
588
589 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
590 Requires: mysql >= 3.23
591 Requires: mysql-server >= 3.23
592 %endif
593 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
594 Requires: mysql >= 4.0
595 Requires: mysql-server >= 4.0
596 %endif
597 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk} && %{mysql5}
598 Requires: mysql >= 5.0
599 Requires: mysql-server >= 5.0
600 %endif
601
602 %if %{mysql} && %{su9} && ! %{mysql4}
603 Requires: mysql >= 3.23
604 Requires: mysql-client >= 3.23
605 %endif
606 %if %{mysql} && %{su9} && %{mysql4}
607 Requires: mysql >= 4.0
608 Requires: mysql-client >= 4.0
609 %endif
610 %if %{mysql} && %{su10} && %{mysql4}
611 Requires: mysql >= 4.0
612 Requires: mysql-client >= 4.0
613 %endif
614 %if %{mysql} && %{su10} && %{mysql5}
615 Requires: mysql >= 5.0
616 Requires: mysql-client >= 5.0
617 %endif
618 %if %{mysql} && %{su102} && %{mysql5}
619 Requires: mysql >= 5.0
620 Requires: mysql-client >= 5.0
621 %endif
622 %if %{mysql} && %{su103} && %{mysql5}
623 Requires: mysql >= 5.0
624 Requires: mysql-client >= 5.0
625 %endif
626
627 %if %{mysql} && %{mdk} && ! %{mysql4}
628 Requires: mysql >= 3.23
629 Requires: mysql-client >= 3.23
630 %endif
631 %if %{mysql} && %{mdk} && %{mysql4}
632 Requires: mysql >= 4.0
633 Requires: mysql-client >= 4.0
634 %endif
635
636 %if %{postgresql} && %{wb3}
637 Requires: rh-postgresql >= 7
638 Requires: rh-postgresql-server >= 7
639 %endif
640 %if %{postgresql} && ! %{wb3}
641 Requires: postgresql >= 7
642 Requires: postgresql-server >= 7
643 %endif
644
645 %if %{mysql}
646 %description mysql
647 %endif
648 %if %{sqlite}
649 %description sqlite
650 %endif
651 %if %{postgresql}
652 %description postgresql
653 %endif
654
655 %if %{python}
656 Requires: python >= %{pyver}
657 %endif
658
659 %{blurb}
660
661 %{blurb2}
662 %{blurb3}
663 %{blurb4}
664 %{blurb5}
665 %{blurb6}
666 %{blurb7}
667 %{blurb8}
668
669 %if %{mysql}
670 This build requires MySQL to be installed separately as the catalog database.
671 %endif
672 %if %{postgresql}
673 This build requires PostgreSQL to be installed separately as the catalog database.
674 %endif
675 %if %{sqlite}
676 This build incorporates sqlite3 as the catalog database, statically compiled.
677 %endif
678 %if %{python}
679 This build includes python scripting support.
680 %endif
681
682 %if ! %{client_only}
683 %package mtx
684 Summary: Bacula - The Network Backup Solution
685 Group: System Environment/Daemons
686 Provides: mtx
687
688 %description mtx
689 This is Bacula's version of mtx tape utilities for Linux distributions that
690 do not provide their own mtx package
691 %endif
692
693 %package client
694 Summary: Bacula - The Network Backup Solution
695 Group: System Environment/Daemons
696 Provides: bacula-fd
697 Conflicts: bacula-mysql
698 Conflicts: bacula-sqlite
699 Conflicts: bacula-postgresql
700 Obsoletes: bacula-rescue
701
702 %if %{su9} || %{su10} || %{su102}
703 Provides: bacula
704 %endif
705
706 Requires: libstdc++, zlib, openssl
707
708 %if %{rh7}
709 Requires: glibc >= 2.2
710 Requires: libtermcap
711 %endif
712 %if %{su9} || %{su10}
713 Requires: glibc >= 2.3
714 Requires: termcap
715 %endif
716 %if %{su102}
717 Requires: glibc >= 2.5
718 Requires: termcap
719 %endif
720 %if %{su102}
721 Requires: glibc >= 2.6
722 Requires: termcap
723 %endif
724 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{fc5} && ! %{fc6}
725 Requires: glibc >= 2.3
726 Requires: libtermcap
727 %endif
728 %if %{fc5}
729 Requires: glibc >= 2.4
730 Requires: libtermcap
731 %endif
732 %if %{fc6} || %{fc7}
733 Requires: glibc >= 2.5
734 Requires: libtermcap
735 %endif
736
737 %if %{python}
738 Requires: python >= %{pyver}
739 %endif
740
741 %description client
742 %{blurb}
743
744 %{blurb2}
745 %{blurb3}
746 %{blurb4}
747 %{blurb5}
748 %{blurb6}
749 %{blurb7}
750 %{blurb8}
751
752 This is the File daemon (Client) only package. It includes the command line 
753 console program.
754 %if %{python}
755 This build includes python scripting support.
756 %endif
757
758 %if ! %{client_only}
759 %package updatedb
760
761 Summary: Bacula - The Network Backup Solution
762 Group: System Environment/Daemons
763
764 %description updatedb
765 %{blurb}
766
767 %{blurb2}
768 %{blurb3}
769 %{blurb4}
770 %{blurb5}
771 %{blurb6}
772 %{blurb7}
773 %{blurb8}
774
775 This package installs scripts for updating older versions of the bacula
776 database.
777 %endif
778
779 %if %{gconsole}
780 %package gconsole
781 Summary: Bacula - The Network Backup Solution
782 Group: System Environment/Daemons
783 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
784 %endif
785
786 %if %{gconsole} && %{su9}
787 Requires: gtk2 >= 2.0
788 Requires: libgnome >= 2.0
789 Requires: libgnomeui >= 2.0
790 Requires: glibc >= 2.3
791 Requires: ORBit2
792 Requires: libart_lgpl >= 2.0
793 Requires: libbonobo >= 2.0
794 Requires: libbonoboui >= 2.0
795 Requires: bonobo-activation
796 Requires: gconf2
797 Requires: linc
798 Requires: freetype2
799 %endif
800 %if %{gconsole} && %{su10}
801 Requires: gtk2 >= 2.8
802 Requires: libgnome >= 2.12
803 Requires: libgnomeui >= 2.12
804 Requires: glibc >= 2.3
805 Requires: ORBit2
806 Requires: libart_lgpl >= 2.3
807 Requires: libbonobo >= 2.10
808 Requires: libbonoboui >= 2.10
809 Requires: bonobo-activation
810 Requires: gconf2
811 Requires: freetype2
812 Requires: cairo
813 Requires: fontconfig >= 2.3
814 Requires: gnome-vfs2 >= 2.12
815 Requires: libpng
816 %endif
817 %if %{gconsole} && %{su102}
818 Requires: gtk2 >= 2.10
819 Requires: libgnome >= 2.16
820 Requires: libgnomeui >= 2.16
821 Requires: glibc >= 2.5
822 Requires: ORBit2
823 Requires: libart_lgpl >= 2.3
824 Requires: libbonobo >= 2.16
825 Requires: libbonoboui >= 2.16
826 Requires: bonobo-activation
827 Requires: gconf2
828 Requires: freetype2
829 Requires: cairo
830 Requires: fontconfig >= 2.4
831 Requires: gnome-vfs2 >= 2.16
832 Requires: libpng
833 %endif
834 %if %{gconsole} && %{su103}
835 Requires: gtk2 >= 2.12
836 Requires: libgnome >= 2.20
837 Requires: libgnomeui >= 2.20
838 Requires: glibc >= 2.6
839 Requires: ORBit2
840 Requires: libart_lgpl >= 2.3
841 Requires: libbonobo >= 2.20
842 Requires: libbonoboui >= 2.20
843 Requires: bonobo-activation
844 Requires: gconf2
845 Requires: freetype2
846 Requires: cairo
847 Requires: fontconfig >= 2.4
848 Requires: gnome-vfs2 >= 2.20
849 Requires: libpng
850 %endif
851 %if %{gconsole} && %{mdk} && !%{mdv}
852 Requires: gtk2 >= 2.0
853 Requires: libgnomeui2
854 Requires: glibc >= 2.3
855 Requires: ORBit2
856 Requires: libart_lgpl >= 2.0
857 Requires: libbonobo >= 2.0
858 Requires: libbonoboui >= 2.0
859 Requires: GConf2
860 Requires: freetype2
861 %endif
862 %if %{gconsole} && %{mdv}
863 Requires: gtk2 >= 2.8
864 Requires: libgnomeui2
865 Requires: glibc >= 2.3
866 Requires: ORBit2
867 Requires: libart_lgpl >= 2.3
868 Requires: libbonobo >= 2.10
869 Requires: libbonoboui >= 2.10
870 Requires: GConf2
871 Requires: freetype2
872 %endif
873 %if %{gconsole} && %{fc3}  
874 Requires: gtk2 >= 2.4
875 Requires: libgnomeui >= 2.8
876 Requires: glibc >= 2.3
877 Requires: ORBit2
878 Requires: libart_lgpl >= 2.3
879 Requires: libbonobo >= 2.8
880 Requires: libbonoboui >= 2.8
881 Requires: bonobo-activation
882 Requires: GConf2
883 Requires: freetype
884 %endif
885 %if %{gconsole} && %{fc4}  
886 Requires: gtk2 >= 2.6
887 Requires: libgnomeui >= 2.10
888 Requires: glibc >= 2.3
889 Requires: ORBit2
890 Requires: libart_lgpl >= 2.3
891 Requires: libbonobo >= 2.8
892 Requires: libbonoboui >= 2.8
893 Requires: bonobo-activation
894 Requires: GConf2
895 Requires: freetype
896 %endif
897 %if %{gconsole} && %{fc5}  
898 Requires: gtk2 >= 2.8
899 Requires: libgnomeui >= 2.14
900 Requires: glibc >= 2.4
901 Requires: ORBit2
902 Requires: libart_lgpl >= 2.3
903 Requires: libbonobo >= 2.14
904 Requires: libbonoboui >= 2.14
905 Requires: GConf2
906 Requires: freetype
907 %endif
908 %if %{gconsole} && %{fc6}  
909 Requires: gtk2 >= 2.10
910 Requires: libgnomeui >= 2.16
911 Requires: glibc >= 2.5
912 Requires: ORBit2
913 Requires: libart_lgpl >= 2.3
914 Requires: libbonobo >= 2.16
915 Requires: libbonoboui >= 2.16
916 Requires: GConf2
917 Requires: freetype
918 %endif
919 %if %{gconsole} && %{fc7}  
920 Requires: gtk2 >= 2.10
921 Requires: libgnomeui >= 2.18
922 Requires: glibc >= 2.5
923 Requires: ORBit2
924 Requires: libart_lgpl >= 2.3
925 Requires: libbonobo >= 2.18
926 Requires: libbonoboui >= 2.18
927 Requires: GConf2
928 Requires: freetype
929 %endif
930 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7}
931 Requires: gtk2 >= 2.0
932 Requires: libgnomeui >= 2.0
933 Requires: glibc >= 2.3
934 Requires: ORBit2
935 Requires: libart_lgpl >= 2.0
936 Requires: libbonobo >= 2.0
937 Requires: libbonoboui >= 2.0
938 Requires: bonobo-activation
939 Requires: GConf2
940 Requires: linc
941 Requires: freetype
942 %endif
943 %if %{gconsole} && %{su9}
944 Requires: xsu
945 %endif
946 %if %{gconsole} && %{su10}
947 Requires: xsu
948 %endif
949 %if %{gconsole} && %{su102}
950 Requires: xsu
951 %endif
952 %if %{gconsole} && %{su103}
953 Requires: xsu
954 %endif
955 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103}
956 Requires: usermode
957 %endif
958
959 %if %{gconsole}
960 %description gconsole
961 %{blurb}
962
963 %{blurb2}
964 %{blurb3}
965 %{blurb4}
966 %{blurb5}
967 %{blurb6}
968 %{blurb7}
969 %{blurb8}
970
971 This is the Gnome Console package. It is an add-on to the client or
972 server packages.
973 %endif
974
975 %if %{wxconsole}
976 %package wxconsole
977 Summary: Bacula - The Network Backup Solution
978 Group: System Environment/Daemons
979 Requires: wxGTK >= 2.6, libstdc++, openssl
980 %endif
981
982 %if %{wxconsole} && %{su10}
983 Requires: gtk2 >= 2.8
984 %endif
985
986 %if %{wxconsole} && %{su102}
987 Requires: gtk2 >= 2.10
988 %endif
989
990 %if %{wxconsole} && %{su103}
991 Requires: gtk2 >= 2.12
992 %endif
993
994 %if %{wxconsole} && %{fc3}  
995 Requires: gtk2 >= 2.4
996 %endif
997
998 %if %{wxconsole} && %{fc4}  
999 Requires: gtk2 >= 2.6
1000 %endif
1001
1002 %if %{wxconsole} && %{fc5}  
1003 Requires: gtk2 >= 2.8
1004 %endif
1005
1006 %if %{wxconsole} && %{fc6}  
1007 Requires: gtk2 >= 2.10
1008 %endif
1009
1010 %if %{wxconsole} && %{fc7}  
1011 Requires: gtk2 >= 2.10
1012 %endif
1013
1014 %if %{wxconsole}
1015 %description wxconsole
1016 %{blurb}
1017
1018 %{blurb2}
1019 %{blurb3}
1020 %{blurb4}
1021 %{blurb5}
1022 %{blurb6}
1023 %{blurb7}
1024 %{blurb8}
1025
1026 This is the WXWindows Console package. It is an add-on to the client or
1027 server packages.
1028 %endif
1029
1030 %if %{bat}
1031 %package bat
1032 Summary: Bacula - The Network Backup Solution
1033 Group: System Environment/Daemons
1034 %endif
1035
1036 %if %{bat} && %{su10}
1037 Requires: openssl
1038 Requires: glibc >= 2.4
1039 Requires: fontconfig
1040 Requires: freetype2
1041 Requires: libgcc
1042 Requires: libpng
1043 Requires: qt >= 4.2
1044 Requires: libstdc++
1045 Requires: zlib
1046 %endif
1047
1048 %if %{bat} && %{su102}
1049 Requires: openssl
1050 Requires: glibc >= 2.5
1051 Requires: fontconfig
1052 Requires: freetype2
1053 Requires: libgcc
1054 Requires: libpng
1055 Requires: qt >= 4.2
1056 Requires: libstdc++
1057 Requires: zlib
1058 %endif
1059
1060 %if %{bat} && %{su103}
1061 Requires: openssl
1062 Requires: glibc >= 2.6
1063 Requires: fontconfig
1064 Requires: freetype2
1065 Requires: libgcc
1066 Requires: libpng
1067 Requires: qt >= 4.2
1068 Requires: libstdc++
1069 Requires: zlib
1070 %endif
1071
1072 %if %{bat} && %{fc5}
1073 Requires: openssl
1074 Requires: glibc >= 2.4
1075 Requires: fontconfig
1076 Requires: freetype
1077 Requires: libgcc
1078 Requires: libpng
1079 Requires: qt4 >= 4.2
1080 Requires: libstdc++
1081 Requires: zlib
1082 %endif
1083
1084 %if %{bat} && %{fc6}
1085 Requires: openssl
1086 Requires: glibc >= 2.5
1087 Requires: fontconfig
1088 Requires: freetype
1089 Requires: libgcc
1090 Requires: libpng
1091 Requires: qt4 >= 4.2
1092 Requires: libstdc++
1093 Requires: zlib
1094 %endif
1095
1096 %if %{bat} && %{fc7}
1097 Requires: openssl
1098 Requires: glibc >= 2.5
1099 Requires: fontconfig
1100 Requires: freetype
1101 Requires: libgcc
1102 Requires: libpng
1103 Requires: qt4 >= 4.2
1104 Requires: libstdc++
1105 Requires: zlib
1106 %endif
1107
1108 %if %{bat}
1109 %description bat
1110 %{blurb}
1111
1112 %{blurb2}
1113 %{blurb3}
1114 %{blurb4}
1115 %{blurb5}
1116 %{blurb6}
1117 %{blurb7}
1118 %{blurb8}
1119
1120 This is the Bacula Administration Tool package. It is an add-on to 
1121 the client or server packages.
1122 %endif
1123
1124 %prep
1125
1126 %setup
1127 %setup -T -D -b 1
1128 %setup -T -D -b 2
1129 %setup -T -D -b 3
1130 %setup -T -D -b 4
1131
1132 %build
1133
1134 %if %{su9} || %{su10} || %{su102} || %{su103}
1135 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
1136 %endif
1137
1138 cwd=${PWD}
1139 cd %{depkgs}
1140 %if %{sqlite}
1141 make sqlite3
1142 %endif
1143 %if ! %{client_only}
1144 make mtx
1145 %endif
1146 %if %{bat}
1147 make qwt
1148 %endif
1149 cd ${cwd}
1150
1151 # patches for the bundled sqlite scripts
1152
1153 # patch the make_sqlite_tables script for installation bindir
1154 #patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
1155 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
1156
1157 # patch the create_sqlite_database script for installation bindir
1158 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
1159 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
1160
1161 # patch the make_catalog_backup script for installation bindir
1162 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
1163
1164 # patch the update_sqlite_tables script for installation bindir
1165 #patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
1166 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
1167
1168 # patch the bacula-dir init script to remove sqlite service
1169 %if %{sqlite} && %{su9}
1170 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1171 %endif
1172 %if %{sqlite} && %{su10}
1173 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1174 %endif
1175 %if %{sqlite} && %{su102}
1176 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1177 %endif
1178 %if %{sqlite} && %{su103}
1179 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1180 %endif
1181
1182 # 64 bit lib location hacks
1183 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
1184 # reported to be fixed to properly detect lib locations.
1185 %if %{x86_64}
1186 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
1187 %endif
1188 %if %{mysql} && %{x86_64}
1189 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
1190 %endif
1191 %if %{python} && %{x86_64}
1192 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
1193 %endif
1194
1195 # Red Hat's 64 bit installation of QT4 appears to be broken so:
1196 %define qt_path 0
1197 %if %{rhel5} || %{centos5} || %{sl5}
1198 %define qt_path 1
1199 %endif
1200 %if %{bat} && %{qt_path} && %{x86_64}
1201 export PATH=/usr/lib64/qt4/bin/:$PATH
1202 export QTDIR=/usr/lib64/qt4/
1203 export QTINC=/usr/lib64/qt4/include/
1204 export QTLIB=/usr/lib64/qt4/
1205 %endif
1206
1207 %configure \
1208         --prefix=/usr \
1209         --sbindir=/usr/sbin \
1210         --sysconfdir=%{sysconf_dir} \
1211         --with-scriptdir=%{script_dir} \
1212         --with-working-dir=%{working_dir} \
1213         --with-pid-dir=%{pid_dir} \
1214         --enable-smartalloc \
1215         --enable-client-only \
1216         %if %{mdk}
1217         --disable-nls \
1218         %endif
1219         --enable-static-fd
1220
1221 make
1222
1223 %configure \
1224         --prefix=/usr \
1225         --sbindir=/usr/sbin \
1226         --sysconfdir=%{sysconf_dir} \
1227         --with-scriptdir=%{script_dir} \
1228         --with-working-dir=%{working_dir} \
1229         --with-pid-dir=%{pid_dir} \
1230         --enable-smartalloc \
1231 %if %{gconsole}
1232         --enable-gnome \
1233 %endif
1234 %if %{gconsole} && ! %{rh8}
1235         --enable-tray-monitor \
1236 %endif
1237 %if %{mysql}
1238         --with-mysql \
1239 %endif
1240 %if %{sqlite}
1241         --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
1242 %endif
1243 %if %{postgresql}
1244         --with-postgresql \
1245 %endif
1246 %if %{wxconsole}
1247         --enable-bwx-console \
1248 %endif
1249 %if %{bat}
1250         --enable-bat \
1251         --with-qwt=${cwd}/%{depkgs}/qwt \
1252 %endif
1253 %if %{python}
1254         --with-python \
1255 %endif
1256 %if %{client_only}
1257         --enable-client-only \
1258 %endif
1259 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3} 
1260         --disable-batch-insert \
1261 %endif
1262         --mandir=%{_mandir} \
1263         --with-subsys-dir=/var/lock/subsys \
1264         --with-dir-user=%{director_daemon_user} \
1265         --with-dir-group=%{daemon_group} \
1266         --with-sd-user=%{storage_daemon_user} \
1267         --with-sd-group=%{storage_daemon_group} \
1268         --with-fd-user=%{file_daemon_user} \
1269         --with-fd-group=%{daemon_group} \
1270         --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
1271         --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
1272         --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
1273         --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
1274         --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
1275         --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
1276         --with-openssl
1277
1278 make
1279
1280 %install
1281  
1282 cwd=${PWD}
1283 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1284 mkdir -p $RPM_BUILD_ROOT/etc/init.d
1285 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
1286 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
1287 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
1288 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
1289 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
1290
1291 %if %{gconsole} || %{wxconsole} || %{bat}
1292 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
1293 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
1294 %endif
1295
1296 %if %{gconsole} || %{wxconsole} || %{bat}
1297 %define usermode_iftrick 1
1298 %else
1299 %define usermode_iftrick 0
1300 %endif
1301
1302 %if %{usermode_iftrick} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103}
1303 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
1304 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
1305 mkdir -p $RPM_BUILD_ROOT/usr/bin
1306 %endif
1307
1308 %if %{sqlite}
1309 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
1310 %endif
1311
1312 make \
1313         prefix=$RPM_BUILD_ROOT/usr \
1314         sbindir=$RPM_BUILD_ROOT/usr/sbin \
1315         sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
1316         scriptdir=$RPM_BUILD_ROOT%{script_dir} \
1317         working_dir=$RPM_BUILD_ROOT%{working_dir} \
1318         piddir=$RPM_BUILD_ROOT%{pid_dir} \
1319         mandir=$RPM_BUILD_ROOT%{_mandir} \
1320         install
1321
1322 %if ! %{client_only}
1323 cd %{depkgs}
1324 make \
1325         prefix=$RPM_BUILD_ROOT/usr \
1326         sbindir=$RPM_BUILD_ROOT/usr/sbin \
1327         sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
1328         scriptdir=$RPM_BUILD_ROOT%{script_dir} \
1329         working_dir=$RPM_BUILD_ROOT%{working_dir} \
1330         piddir=$RPM_BUILD_ROOT%{pid_dir} \
1331         mandir=$RPM_BUILD_ROOT%{_mandir} \
1332         mtx-install
1333 cd ${cwd}
1334 %endif
1335
1336 # make install in manpages installs _everything_ shotgun style
1337 # so now delete what we will not be packaging
1338 %if ! %{wxconsole}
1339 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
1340 %endif
1341 %if ! %{bat}
1342 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bat.1.%{manpage_ext}
1343 %endif
1344 %if ! %{gconsole}
1345 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
1346 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
1347 %endif
1348 %if %{client_only}
1349 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
1350 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1351 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1352 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
1353 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
1354 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
1355 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
1356 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
1357 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
1358 %endif
1359
1360 # fixme - make installs the mysql scripts for sqlite build
1361 %if %{sqlite}
1362 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1363 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1364 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
1365 %endif
1366
1367 # fixme - make installs the mysql scripts for postgresql build
1368 %if %{postgresql}
1369 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1370 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1371 %endif
1372
1373 # fixme - make installs gconsole script for build without gconsole
1374 %if ! %{gconsole}
1375 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
1376 %endif
1377
1378 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
1379
1380 # install the init scripts
1381 %if %{su9} || %{su10} || %{su102} || %{su103}
1382 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1383 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1384 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1385 %endif
1386 %if %{mdk}
1387 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1388 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1389 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1390 %endif
1391 %if ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103} && ! %{mdk}
1392 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1393 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1394 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1395 %endif
1396 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
1397 %if %{client_only}
1398 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1399 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1400 %endif
1401
1402 # install the menu stuff
1403 %if %{gconsole} && %{su9}
1404 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1405 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1406 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1407 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1408 %endif
1409 %if %{gconsole} && %{su10}
1410 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1411 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1412 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1413 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1414 %endif
1415 %if %{gconsole} && %{su102}
1416 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1417 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1418 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1419 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1420 %endif
1421 %if %{gconsole} && %{su103}
1422 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1423 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1424 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1425 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1426 %endif
1427 %if %{wxconsole} && %{su10}
1428 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1429 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1430 %endif
1431 %if %{wxconsole} && %{su102}
1432 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1433 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1434 %endif
1435 %if %{wxconsole} && %{su103}
1436 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1437 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1438 %endif
1439 %if %{bat} && %{su102}
1440 cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
1441 cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
1442 %endif
1443 %if %{bat} && %{su103}
1444 cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
1445 cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
1446 %endif
1447 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{mdk}
1448 %define iftrick 1
1449 %else
1450 %define iftrick 0
1451 %endif
1452 %if %{gconsole} && %{iftrick}
1453 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1454 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1455 cp -p scripts/bgnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bgnome-console
1456 cp -p scripts/bgnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/bgnome-console
1457 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bgnome-console
1458 %endif
1459 %if %{gconsole} && ! %{rh8}
1460 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1461 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1462 %endif
1463 %if %{wxconsole} && %{iftrick}
1464 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1465 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1466 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bwx-console
1467 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/bwx-console
1468 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bwx-console
1469 %endif
1470 %if %{bat} && %{iftrick}
1471 cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
1472 cp -p scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
1473 cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat
1474 cp -p scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat
1475 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat
1476 %endif
1477
1478 # install sqlite
1479 %if %{sqlite}
1480 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
1481 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
1482 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
1483 %endif
1484
1485 # install the logrotate file
1486 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
1487
1488 # install the updatedb scripts
1489 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
1490
1491 # install the logwatch scripts
1492 %if ! %{client_only}
1493 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1494 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1495 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1496 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1497 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1498 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1499 %endif
1500
1501 # install the rescue files
1502 mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue
1503 mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue/freebsd
1504 mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue/solaris
1505 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1506 cp -p %{_rescuesrc}/freebsd/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/freebsd/
1507 cp -p %{_rescuesrc}/solaris/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/solaris/
1508 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1509 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1510 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1511 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1512 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1513 cp -pr %{_rescuesrc}/knoppix $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1514 touch $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/rpm_release
1515 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd
1516 rm -f src/filed/static-bacula-fd
1517
1518 # install bat since make doesn't at the moment
1519 %if %{bat}
1520 cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat
1521 cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
1522 %endif
1523
1524 # now clean up permissions that are left broken by the install
1525 %if ! %{client_only}
1526 chmod o-r $RPM_BUILD_ROOT%{script_dir}/query.sql
1527 %endif
1528 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
1529 %if %{gconsole} && ! %{rh8}
1530 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
1531 chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf
1532 %endif
1533
1534 # fix me - building enable-client-only installs files not included in bacula-client package
1535 %if %{client_only}
1536 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
1537 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
1538 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
1539 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
1540 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
1541 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
1542 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1543 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1544 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
1545 %endif
1546
1547 %clean
1548 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1549 rm -rf $RPM_BUILD_DIR/%{name}-docs-%{docs_version}
1550 rm -rf $RPM_BUILD_DIR/%{name}-rescue-%{_rescuever}
1551 rm -rf $RPM_BUILD_DIR/depkgs
1552 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
1553
1554 %if %{mysql}
1555 # MySQL specific files
1556 %files mysql
1557 %defattr(-, root, root)
1558 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
1559 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
1560 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
1561 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
1562 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
1563 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
1564 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
1565 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
1566 %endif
1567
1568 %if %{sqlite}
1569 %files sqlite
1570 %defattr(-,root,root)
1571 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
1572 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
1573 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
1574 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
1575 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
1576 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
1577 %{sqlite_bindir}/libsqlite3.a
1578 %{sqlite_bindir}/sqlite3.h
1579 %{sqlite_bindir}/sqlite3
1580 %endif
1581
1582 %if %{postgresql}
1583 %files postgresql
1584 %defattr(-,root,root)
1585 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
1586 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
1587 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
1588 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
1589 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
1590 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
1591 %endif
1592
1593 # The rest is DB backend independent
1594 %if ! %{client_only}
1595 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1596 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1597 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1598 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1599 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1600 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1601 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1602 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1603 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1604 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1605 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1606 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1607 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1608 %attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue
1609 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1610 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1611 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1612 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1613 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1614 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1615 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1616 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1617 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1618
1619 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
1620 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1621
1622 /etc/logrotate.d/bacula
1623 /etc/log.d/scripts/services/bacula
1624 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1625 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1626 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1627 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1628 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1629 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1630 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1631
1632 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1633
1634 /usr/sbin/bacula-dir
1635 /usr/sbin/bacula-fd
1636 /usr/sbin/bacula-sd
1637 /usr/sbin/bcopy
1638 /usr/sbin/bextract
1639 /usr/sbin/bls
1640 /usr/sbin/bscan
1641 /usr/sbin/btape
1642 /usr/sbin/btraceback
1643 /usr/sbin/bconsole
1644 /usr/sbin/dbcheck
1645 /usr/sbin/bsmtp
1646 /usr/sbin/bregex
1647 /usr/sbin/bwild
1648 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1649 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1650 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1651 %{_mandir}/man8/bacula.8.%{manpage_ext}
1652 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1653 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1654 %{_mandir}/man8/bextract.8.%{manpage_ext}
1655 %{_mandir}/man8/bls.8.%{manpage_ext}
1656 %{_mandir}/man8/bscan.8.%{manpage_ext}
1657 %{_mandir}/man8/btape.8.%{manpage_ext}
1658 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1659 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1660 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1661 %endif
1662
1663 %if %{mysql}
1664 %pre mysql
1665 # test for bacula database older than version 9
1666 # note: this ASSUMES no password has been set for bacula database
1667 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1668 %endif
1669
1670 %if %{sqlite}
1671 %pre sqlite
1672 # test for bacula database older than version 9
1673 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite* ];then
1674         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite* 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1675 %endif
1676
1677 %if %{postgresql}
1678 %pre postgresql
1679 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1680 %endif
1681
1682 %if ! %{client_only}
1683 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
1684         echo "This bacula upgrade will update a bacula database from version 9 to 10."
1685         echo "You appear to be running database version $DB_VER. You must first update"
1686         echo "your database to version 9 and then install this upgrade. The alternative"
1687         echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1688         echo "catalog information, then do the upgrade. Information on updating a"
1689         echo "database older than version 9 can be found in the release notes."
1690         exit 1
1691 fi
1692 %endif
1693
1694 %if %{sqlite}
1695 fi
1696 %endif
1697
1698 %if ! %{client_only}
1699 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1700 if [ -s %{sysconf_dir}/console.conf ];then
1701         cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1702 fi
1703
1704 # create the daemon users and groups
1705 # first create the groups if they don't exist
1706 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1707 if [ -z "$HAVE_BACULA" ]; then
1708         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1709         echo "The group %{daemon_group} has been added to %{group_file}."
1710         echo "See the manual chapter \"Running Bacula\" for details."
1711 fi
1712 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1713 if [ -z "$HAVE_BACULA" ]; then
1714         %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1715         echo "The group %{storage_daemon_group} has been added to %{group_file}."
1716         echo "See the manual chapter \"Running Bacula\" for details."
1717 fi
1718 # now create the users if they do not exist
1719 # we do not use the -g option allowing the primary group to be set to system default
1720 # this will be a unique group on redhat type systems or the group users on some systems
1721 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1722 if [ -z "$HAVE_BACULA" ]; then
1723         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1724         echo "The user %{storage_daemon_user} has been added to %{user_file}."
1725         echo "See the manual chapter \"Running Bacula\" for details."
1726 fi
1727 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1728 if [ -z "$HAVE_BACULA" ]; then
1729         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1730         echo "The user %{director_daemon_user} has been added to %{user_file}."
1731         echo "See the manual chapter \"Running Bacula\" for details."
1732 fi
1733 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1734 if [ -z "$HAVE_BACULA" ]; then
1735         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1736         echo "The user %{file_daemon_user} has been added to %{user_file}."
1737         echo "See the manual chapter \"Running Bacula\" for details."
1738 fi
1739 # now we add the supplementary groups, this is ok to call even if the users already exist
1740 # we only do this if the user is NOT root
1741 IS_ROOT=%{director_daemon_user}
1742 if [ "$IS_ROOT" != "root" ]; then
1743 %{usermod} -G %{daemon_group} %{director_daemon_user}
1744 fi
1745 IS_ROOT=%{storage_daemon_user}
1746 if [ "$IS_ROOT" != "root" ]; then
1747 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1748 fi
1749 IS_ROOT=%{file_daemon_user}
1750 if [ "$IS_ROOT" != "root" ]; then
1751 %{usermod} -G %{daemon_group} %{file_daemon_user}
1752 fi
1753 %endif
1754
1755 %if %{mysql}
1756 %post mysql
1757 %endif
1758 %if %{sqlite}
1759 %post sqlite
1760 %endif
1761 %if %{postgresql}
1762 %post postgresql
1763 %endif
1764
1765 %if ! %{client_only}
1766 # add our links
1767 if [ "$1" -ge 1 ] ; then
1768 /sbin/chkconfig --add bacula-dir
1769 /sbin/chkconfig --add bacula-fd
1770 /sbin/chkconfig --add bacula-sd
1771 fi
1772 %endif
1773
1774 %if %{mysql}
1775 # test for an existing database
1776 # note: this ASSUMES no password has been set for bacula database
1777 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1778
1779 # grant privileges and create tables if they do not exist
1780 if [ -z "$DB_VER" ]; then
1781         echo "Hmm, doesn't look like you have an existing database."
1782         echo "Granting privileges for MySQL user bacula..."
1783         %{script_dir}/grant_mysql_privileges
1784         echo "Creating MySQL bacula database..."
1785         %{script_dir}/create_mysql_database
1786         echo "Creating bacula tables..."
1787         %{script_dir}/make_mysql_tables
1788
1789 # check to see if we need to upgrade a 1.38 or lower database
1790 elif [ "$DB_VER" -lt "10" ]; then
1791         echo "This release requires an upgrade to your bacula database."
1792         echo "Backing up your current database..."
1793         mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1794         echo "Upgrading bacula database ..."
1795         %{script_dir}/update_mysql_tables
1796         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1797
1798 fi
1799 %endif
1800
1801 %if %{sqlite}
1802 # test for an existing database
1803 if [ -s %{working_dir}/bacula.db ]; then
1804         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1805         # check to see if we need to upgrade a 1.38 or lower database
1806         if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
1807                 echo "This release requires an upgrade to your bacula database."
1808                 echo "Backing up your current database..."
1809                 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1810                 echo "Upgrading bacula database ..."
1811                 %{script_dir}/update_sqlite3_tables
1812                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1813         fi
1814 else
1815         # create the database and tables
1816         echo "Hmm, doesn't look like you have an existing database."
1817         echo "Creating SQLite database..."
1818         %{script_dir}/create_sqlite3_database
1819         chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1820         echo "Creating the SQLite tables..."
1821         %{script_dir}/make_sqlite3_tables
1822 fi
1823 %endif
1824
1825 %if %{postgresql}
1826 # test for an existing database
1827 # note: this ASSUMES no password has been set for bacula database
1828 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1829
1830 # grant privileges and create tables if they do not exist
1831 if [ -z "$DB_VER" ]; then
1832         echo "Hmm, doesn't look like you have an existing database."
1833         echo "Creating PostgreSQL bacula database..."
1834         %{script_dir}/create_postgresql_database
1835         echo "Creating bacula tables..."
1836         %{script_dir}/make_postgresql_tables
1837         echo "Granting privileges for PostgreSQL user bacula..."
1838         %{script_dir}/grant_postgresql_privileges
1839
1840 # check to see if we need to upgrade a 1.38 or lower database
1841 elif [ "$DB_VER" -lt "10" ]; then
1842         echo "This release requires an upgrade to your bacula database."
1843         echo "Backing up your current database..."
1844         pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1845         echo "Upgrading bacula database ..."
1846         %{script_dir}/update_postgresql_tables
1847         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1848         
1849 fi
1850 %endif
1851
1852 %if ! %{client_only}
1853 # generate passwords if needed
1854 if [ -d %{sysconf_dir} ]; then
1855         cd %{sysconf_dir}
1856         for file in *.conf; do
1857                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1858                         need_password=`grep $string $file 2>/dev/null`
1859                         if [ -n "$need_password" ]; then
1860                                 pass=`openssl rand -base64 33`
1861                                 sed "s-$string-$pass-g" $file > $file.new
1862                                 cp -f $file.new $file; rm -f $file.new
1863                         fi
1864                 done
1865         done
1866 fi
1867 %endif
1868
1869 %if %{mysql}
1870 %preun mysql
1871 %endif
1872 %if %{sqlite}
1873 %preun sqlite
1874 %endif
1875 %if %{postgresql}
1876 %preun postgresql
1877 %endif
1878
1879 %if ! %{client_only}
1880 # delete our links
1881 if [ $1 = 0 ]; then
1882 /sbin/chkconfig --del bacula-dir
1883 /sbin/chkconfig --del bacula-fd
1884 /sbin/chkconfig --del bacula-sd
1885 fi
1886 %endif
1887
1888
1889 %if ! %{client_only}
1890 %files mtx
1891 %defattr(-,root,root)
1892 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1893 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1894 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1895 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1896 %attr(-, root, %{storage_daemon_group}) /usr/sbin/nsmhack
1897 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsieject
1898 %{_mandir}/man1/loaderinfo.1.%{manpage_ext}
1899 %{_mandir}/man1/mtx.1.%{manpage_ext}
1900 %{_mandir}/man1/scsitape.1.%{manpage_ext}
1901 %{_mandir}/man1/tapeinfo.1.%{manpage_ext}
1902 %{_mandir}/man1/scsieject.1.%{manpage_ext}
1903 %endif
1904
1905 %files client
1906 %defattr(-,root,root)
1907 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1908 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1909 %{script_dir}/bacula-ctl-fd
1910 /etc/init.d/bacula-fd
1911 %attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue
1912
1913 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
1914 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1915
1916 /etc/logrotate.d/bacula
1917
1918 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1919 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1920
1921 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1922
1923 /usr/sbin/bacula-fd
1924 /usr/sbin/btraceback
1925 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1926 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1927 /usr/sbin/bconsole
1928 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1929 %{_mandir}/man8/bacula.8.%{manpage_ext}
1930 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1931 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1932
1933
1934 %pre client
1935 # create the daemon group and user
1936 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1937 if [ -z "$HAVE_BACULA" ]; then
1938         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1939         echo "The group %{daemon_group} has been added to %{group_file}."
1940         echo "See the manual chapter \"Running Bacula\" for details."
1941 fi
1942 # we do not use the -g option allowing the primary group to be set to system default
1943 # this will be a unique group on redhat type systems or the group users on some systems
1944 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1945 if [ -z "$HAVE_BACULA" ]; then
1946         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1947         echo "The user %{file_daemon_user} has been added to %{user_file}."
1948         echo "See the manual chapter \"Running Bacula\" for details."
1949 fi
1950 # now we add the supplementary group, this is ok to call even if the user already exists
1951 # we only do this if the user is NOT root
1952 IS_ROOT=%{file_daemon_user}
1953 if [ "$IS_ROOT" != "root" ]; then
1954 %{usermod} -G %{daemon_group} %{file_daemon_user}
1955 fi
1956
1957 %post client
1958 # add our link
1959 if [ "$1" -ge 1 ] ; then
1960 /sbin/chkconfig --add bacula-fd
1961 fi
1962
1963 # generate passwords if needed
1964 if [ -d %{sysconf_dir} ]; then
1965         cd %{sysconf_dir}
1966         for file in *.conf; do
1967                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1968                         need_password=`grep $string $file 2>/dev/null`
1969                         if [ -n "$need_password" ]; then
1970                                 pass=`openssl rand -base64 33`
1971                                 sed "s-$string-$pass-g" $file > $file.new
1972                                 cp -f $file.new $file; rm -f $file.new
1973                         fi
1974                 done
1975         done
1976 fi
1977
1978 %preun client
1979 # delete our link
1980 if [ $1 = 0 ]; then
1981 /sbin/chkconfig --del bacula-fd
1982 fi
1983
1984 %if ! %{client_only}
1985 %files updatedb
1986 %defattr(-,root,%{daemon_group})
1987 %{script_dir}/updatedb/*
1988
1989 %pre updatedb
1990 # create the daemon group
1991 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1992 if [ -z "$HAVE_BACULA" ]; then
1993         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1994         echo "The group %{daemon_group} has been added to %{group_file}."
1995         echo "See the manual chapter \"Running Bacula\" for details."
1996 fi
1997
1998 %post updatedb
1999 echo "The database update scripts were installed to %{script_dir}/updatedb"
2000 %endif
2001
2002 %if %{gconsole}
2003 %files gconsole
2004 %defattr(-,root,root)
2005 /usr/sbin/bgnome-console
2006 %attr(-, root, %{daemon_group}) %dir %{script_dir}
2007 %attr(-, root, %{daemon_group}) %{script_dir}/gconsole
2008 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf
2009 /usr/share/pixmaps/bacula.png
2010 /usr/share/applications/bacula.desktop
2011 %{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
2012 %endif
2013
2014 %if %{gconsole} && ! %{rh8}
2015 /usr/sbin/bacula-tray-monitor
2016 %config(noreplace) %{sysconf_dir}/tray-monitor.conf
2017 /usr/share/pixmaps/bacula-tray-monitor.xpm
2018 /usr/share/applications/bacula-tray-monitor.desktop
2019 %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
2020 %endif
2021
2022 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103}
2023 # add the console helper files
2024 %config(noreplace,missingok) /etc/pam.d/bgnome-console
2025 %config(noreplace,missingok) /etc/security/console.apps/bgnome-console
2026 /usr/bin/bgnome-console
2027 %endif
2028
2029 %if %{gconsole}
2030 %pre gconsole
2031 # create the daemon group
2032 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
2033 if [ -z "$HAVE_BACULA" ]; then
2034         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
2035         echo "The group %{daemon_group} has been added to %{group_file}."
2036         echo "See the manual chapter \"Running Bacula\" for details."
2037 fi
2038
2039 %post gconsole
2040 # generate passwords if needed
2041 if [ -d %{sysconf_dir} ]; then
2042         cd %{sysconf_dir}
2043         for file in *.conf; do
2044                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
2045                         need_password=`grep $string $file 2>/dev/null`
2046                         if [ -n "$need_password" ]; then
2047                                 pass=`openssl rand -base64 33`
2048                                 sed "s-$string-$pass-g" $file > $file.new
2049                                 cp -f $file.new $file; rm -f $file.new
2050                         fi
2051                 done
2052         done
2053 fi
2054 %endif
2055
2056 %if %{wxconsole}
2057 %files wxconsole
2058 %defattr(-,root,root)
2059 /usr/sbin/bwx-console
2060 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
2061 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf
2062 /usr/share/pixmaps/wxwin16x16.xpm
2063 /usr/share/applications/wxconsole.desktop
2064 %{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
2065 %endif
2066
2067 %if %{wxconsole} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103}
2068 # add the console helper files
2069 %config(noreplace,missingok) /etc/pam.d/bwx-console
2070 %config(noreplace,missingok) /etc/security/console.apps/bwx-console
2071 /usr/bin/bwx-console
2072 %endif
2073
2074 %if %{wxconsole}
2075 %pre wxconsole
2076 # create the daemon group
2077 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
2078 if [ -z "$HAVE_BACULA" ]; then
2079         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
2080         echo "The group %{daemon_group} has been added to %{group_file}."
2081         echo "See the manual chapter \"Running Bacula\" for details."
2082 fi
2083
2084 %post wxconsole
2085 # generate passwords if needed
2086 if [ -d %{sysconf_dir} ]; then
2087         cd %{sysconf_dir}
2088         for file in *.conf; do
2089                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
2090                         need_password=`grep $string $file 2>/dev/null`
2091                         if [ -n "$need_password" ]; then
2092                                 pass=`openssl rand -base64 33`
2093                                 sed "s-$string-$pass-g" $file > $file.new
2094                                 cp -f $file.new $file; rm -f $file.new
2095                         fi
2096                 done
2097         done
2098 fi
2099 %endif
2100
2101 %if %{bat}
2102 %files bat
2103 %defattr(-,root,root)
2104 /usr/sbin/bat
2105 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
2106 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf
2107 /usr/share/pixmaps/bat_icon.png
2108 /usr/share/applications/bat.desktop
2109 %{_mandir}/man1/bat.1.%{manpage_ext}
2110 %endif
2111
2112 %if %{bat} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{su103}
2113 # add the console helper files
2114 %config(noreplace,missingok) /etc/pam.d/bat
2115 %config(noreplace,missingok) /etc/security/console.apps/bat
2116 /usr/bin/bat
2117 %endif
2118
2119 %if %{bat}
2120 %pre bat
2121 # create the daemon group
2122 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
2123 if [ -z "$HAVE_BACULA" ]; then
2124         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
2125         echo "The group %{daemon_group} has been added to %{group_file}."
2126         echo "See the manual chapter \"Running Bacula\" for details."
2127 fi
2128
2129 %post bat
2130 # generate passwords if needed
2131 if [ -d %{sysconf_dir} ]; then
2132         cd %{sysconf_dir}
2133         for file in *.conf; do
2134                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
2135                         need_password=`grep $string $file 2>/dev/null`
2136                         if [ -n "$need_password" ]; then
2137                                 pass=`openssl rand -base64 33`
2138                                 sed "s-$string-$pass-g" $file > $file.new
2139                                 cp -f $file.new $file; rm -f $file.new
2140                         fi
2141                 done
2142         done
2143 fi
2144 %endif
2145
2146 %changelog
2147 * Sat Nov 17 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2148 - switch to sqlite3
2149 * Sun Nov 11 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2150 - add new files required by rescue makefile
2151 * Sat Nov 10 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2152 - add su103 build target
2153 * Sun Nov 04 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2154 - fix dist defines for rhel5 and clones
2155 - fix rhel broken 64 bit QT4 paths
2156 - rh qt4 packages don't provide qt so fix that too
2157 * Mon Oct 29 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2158 - correct ownership when creating sqlite db file in post script
2159 * Sun Sep 16 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2160 - fix disable-batch-insert
2161 * Fri Sep 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2162 - 2.2.4 release
2163 - turn off gconsole build for fc3, tray monitor fails to build
2164 - add new files for mtx package (09Sep07 depkgs update)
2165 * Sat Sep 08 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2166 - add --disable-batch-insert for older platforms
2167 - add build targets for rhel5 and clones
2168 * Mon Sep 03 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2169 - 2.2.1 release
2170 - turn off gconsole build for su10 & fc4, tray monitor fails to build
2171 * Sat Jul 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2172 - 2.1.26 add make of qwt in depkgs for bat
2173 * Sat Jun 02 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2174 - upgrade Qt requirement for bat to 4.2
2175 * Sun May 06 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2176 - add fc7 build target
2177 * Sun Apr 29 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2178 - 2.1.8
2179 - gnome-console now bgnome-console
2180 - wxconsole now bwx-console
2181 - add build option for bat
2182 * Sat Apr 08 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2183 - merge Otto Mueller's patch but keep script dir set to /etc/bacula
2184 - add build tag for Scientific Linux per Jon Peatfield <J.S.Peatfield@damtp.cam.ac.uk>
2185 * Tue Mar 27 2007 Otto Mueller <otto.mueller@bundestag.de>
2186 - adjust directory locations for FHS-compatibility
2187   sysconf_dir (/etc/bacula), script_dir (/usr/lib/bacula),
2188   working_dir (/var/lib/bacula) and pid_dir (/var/run)
2189 * Mon Feb 26 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2190 - add SuSE 10.2 target
2191 * Sat Jan 20 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2192 - correct bug 752
2193 - set query.sql as config file
2194 - correct bug 754
2195 * Sun Jan 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2196 - 2.0.1 release
2197 - change determination of gcc version per patch from Marc Hennes
2198 - move BuildRequire for atk-devel to gnome only builds
2199 - add fc6 build tag
2200 * Sat Jan 06 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2201 - 2.0.0 release
2202 * Sun Oct 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2203 - 1.39.26 remove create_sqlite_database.in.patch
2204 * Sun Sep 24 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2205 - change ownership of working_dir on server packages to bacula.bacula so that
2206 - bacula-sd can create bootstrap files
2207 * Sat Sep 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2208 - 1.39.22 remove separate cd and make of manpages the main Makefile does it now
2209 * Sun Aug 06 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2210 - fix manpages file extension for mdk
2211 * Sat Aug 05 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2212 - bug 648 re-enable and update sqlite patches
2213 - 1.39.18 changes
2214 - updatedb 9 to 10
2215 - install man pages
2216 - lock out gconsole build for gtk+ < 2.4
2217 * Mon Jul 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2218 - move pango-devel BuildRequires into gconsole only build
2219 * Sat Jul 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2220 - add provides and conflicts for standard suse packages
2221 - add third party packager tag support
2222 - add build_client_only tag
2223 - remove bsmtp from client package
2224 - add bacula-ctl-fd to client package
2225 * Thu Jul 13 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2226 - fix directory creation when wxconsole and not gconsole
2227 * Tue Jul 04 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2228 - add check to buildrequires to make sure libstdc++ version matches gcc
2229 * Mon Jul 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2230 - add python build support
2231 - fix LDFLAGS declarations
2232 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2233 - add requires for standard compiler toolchain
2234 - move version and release tags up
2235 - move patches up
2236 - add docs_version tag
2237 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2238 - update rescuever to 1.8.6
2239 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2240 - update depkgs to 25Jun06
2241 - add mysql5 build tag
2242 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2243 - 1.38.10 bump rescue version
2244 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2245 - fix usermod statements
2246 - add fc5 target
2247 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2248 - add -g param back to useradd statements Bug 605
2249 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2250 - redundant code cleanup
2251 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2252 - add wxconsole package
2253 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2254 - 1.38.8 release
2255 - dependency update for Mandriva
2256 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2257 - 1.38.7 release
2258 - remove -n option from useradd scripts
2259 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2260 - 1.38.6 release
2261 - fix problem specifying more than one primary group for user bacula
2262 - add build switch to not build gconsole regardless of platform
2263 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2264 - add centos3 build tag
2265 - fix link error of static-fd on Mandrake with --disable-nls
2266 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2267 - add fc4 dependencies
2268 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2269 - add SuSE 10.0 build
2270 - remove specific permission in attrib macros
2271 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2272 - 1.38.5 release
2273 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
2274 - refix compat for _dist on SLES9 which seems to have been removed
2275 - added note regarding Aleksandar's use of specific permissions in attrib macros
2276 - need to review and add specific fc4 build currently using fc3 Requires
2277 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2278 - 1.38.2 release
2279 - Reorganize files and pre/post sections to remove repetitions
2280 - Always build separate mtx package
2281 - Fix file ownerships for /etc/bacula and Bacula's working dir
2282 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2283 - Disable GNOME on RH7
2284 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2285 - Red Hat and look alikes have mtx RPM, do not build/package our version
2286 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2287 - minor edit to _dist for SLES9 compatibility
2288 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2289 - 1.38.0 release
2290 - kern changed location of pdf files and html manual in docs package
2291 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2292 - 1.38.0 release
2293 - add docs (from prebuilt tarball) and rescue packages back in
2294 - remove dvd-freespace and dvd-writepart files, add dvd-handler
2295 - remove 3 of 4 sqlite script patches as not needed
2296 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2297 - changes for 1.38
2298 - remove docs and rescue sections (remove static fd)
2299 - add dvd-freespace and dvd-writepart files
2300 - update depkgs to 22Jun05
2301 - change database update to 8 to 9
2302 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2303 - minor cleanups before 1.38 changes
2304 - add popt and popt-devel build dependencies
2305 - add tetex and tetex-dvips dependencies for doc build
2306 - replace deprecated Copyright tag with License
2307 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2308 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
2309 - conflict with sqlite packages. remove readline dependency.
2310 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2311 - release 1.36.3 update docs
2312 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2313 - add centos4 build tag
2314 - add x86_64 build tag
2315 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2316 - add rhel4 build tag
2317 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
2318 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2319 - add rhel3 build tag
2320 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2321 - fix tray-monitor.conf for noreplace
2322 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2323 - fix distribution check for Fedora and Whitebox
2324 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2325 - add logwatch script
2326 - add dvd scripts
2327 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2328 - add build for Fedora Core 3 (linc now included in ORDit2)
2329 - add mysql4 define for Mandrake 10.1
2330 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2331 - fix {group_file} variable in post scripts
2332 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
2333 - add distribution checking and custom Distribution tag
2334 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2335 - ASSIGNMENT OF COPYRIGHT
2336 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
2337 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
2338 - all right, title and interest in and to the copyright in this software RPM
2339 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
2340 - free of all liens, encumbrances or any known claims against said copyright.
2341 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2342 - bug 183 fixes
2343 - thanks to Daniel Widyono
2344 - update description for rescue package to describe cdrom creation
2345 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2346 - update depkgs to 29Oct04
2347 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2348 - add cdrom rescue to bacula-rescue package
2349 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2350 - misc fixes from 1.36.0 suse feedback
2351 - fix situation where sqlite database exists but sqlite has been removed.
2352 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2353 - remove tray-monitor from RH8 build
2354 - fix permissions on tray-monitor files
2355 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2356 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
2357 - change database update to 7 to 8 upgrade,
2358 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
2359 - build in 30Jul04, add freetype dependancy to gnome package.
2360 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2361 - add documentation to console for groupadd
2362 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2363 - add support for running daemons as root.bacula
2364 - correct for change in location of floppy rescue files in 1.35.2
2365 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
2366 - updated depgkgs to 30Jul04
2367 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2368 - really, really fix symlink creation for gconsole
2369 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2370 - fix symlink creation in gconsole post install
2371 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2372 - fixed error in gconsole post script
2373 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2374 - add check for gconsole symlink before trying to create it
2375 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2376 - fix some minor permissions issues on doc files that CVS won't let us fix
2377 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2378 - add pkgconfig to BuildRequires
2379 - clean up gnome1/2 menu entries for appropriate packages
2380 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2381 - tightened up doc distribution
2382 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2383 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
2384 - rpm's horrible bug that prevents nested conditional macros prevents me
2385 - from implementing these 2 separate approaches within the conditionals which
2386 - create the separate server packages.
2387 - the solution adopted is to remove the gnome-console files from the server packages
2388 - so bacula-gconsole is now an add on for both client and server packages.
2389 - this also now allows the server packages to be install on machines without
2390 - an X-server and we can still maintain a single spec file.
2391 - added tests to make sure we have defined platform and database macros.
2392 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2393 - corrected mysql prerequisites for suse
2394 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2395 - replaced all cp commands with cp -p
2396 - removed addition of a+x permissions on gnome-console
2397 - corrected permissions on init scripts
2398 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2399 - corrected creation of sqlite_bindir in install from !mysql to sqlite
2400 -
2401 - various cleanup patches from Michael K. Johnson:
2402 - corrected post install routines for nicer chkconfig
2403 - removed chmod changes in post routines and moved to install section
2404 - removed interactive nature of post routine for rescue package
2405 - added description of building rescue disks to the description of rescue package
2406 - added clean of build root to beginning of install
2407 - removed specifying attr in all file lists
2408 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2409 - added bconsole to client package
2410 - added gconsole package as add-on to client
2411 - removed spurious dependancies on updatedb package (!cut/paste)
2412 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2413 - added updatedb package
2414 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2415 - added postgresql package
2416 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2417 - corrected the if else logic in the dependancy sections
2418 - changes for 1.34 release
2419 - /etc/bacula/console is now /etc/bacula/bconsole
2420 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
2421 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
2422 - /usr/sbin/smtp is now /usr/sbin/bsmtp
2423 - added new /etc/bacula/drop_mysql_database
2424 - added new /etc/bacula/drop_sqlite_database
2425 - added new /etc/bacula/grant_sqlite_privileges
2426 - added new generic bacula database scripts in /etc/bacula
2427 - added pre-install sections to check for database versions older than 6
2428 - added check for /etc/bacula/console.conf and copy to bconsole.conf
2429 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2430 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
2431 - added testing for existing databases before executing any of the database creation scripts
2432 - added defines working_dir and sqlite_bindir in place of hard coded paths
2433 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2434 - added build configuration for SuSE.
2435 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
2436 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2437 - added patch for create_sqlite_database to fix the installed bindir
2438 - added execute of create_sqlite_database to post of sqlite package
2439 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2440 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
2441 - added bacula-fd as Requires for rescue package
2442 - added build tag for Fedora Core 1
2443 - cleaned up dependancies for all builds
2444 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2445 - removed rh_version from package names
2446 - added platform build configuration section to beginning of file
2447 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2448 - removed make_static_bacula script from rescue package install
2449 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2450 - Added define at top of file for depkgs version
2451 - Added rescue sub-package
2452 - Moved requires statements into proper sub-package locations
2453 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2454 - Corrected Requires for Gnome 1.4/2.0 builds
2455 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2456 - Added separate source declaration for depkgs
2457 - added patch for make_catalog_backup script
2458 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2459 - Misc changes to mysql/sqlite build and rh7/8 menu differences
2460 - Added rh_version to sub-package names
2461 - Added installed but missing file /etc/bacula/gconsole
2462 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
2463 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
2464 - Update spec for version 1.31 and combine client
2465 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2466 - Initial spec file