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