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