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