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