2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define _version @VERSION@
9 %define depkgs_version 09Sep07
10 %define _rescuever @VERSION@
11 %define docs_version @VERSION@
13 # any patches for this release
14 # be sure to check the setup section for patch macros
16 #--------------------------------------------------------------------------
17 # it should not be necessary to change anything below here for a release
18 # except for patch macros in the setup section
19 #--------------------------------------------------------------------------
21 # third party packagers
22 %define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
23 %{?contrib_packager:%define _packager %{contrib_packager}}
25 Summary: Bacula - The Network Backup Solution
29 Group: System Environment/Daemons
31 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
32 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
33 Source2: Release_Notes-%{version}-%{release}.tar.gz
34 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
35 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
36 BuildRoot: %{_tmppath}/%{name}-root
37 URL: http://www.bacula.org/
38 Vendor: The Bacula Team
39 Packager: %{_packager}
41 # define the basic package description
42 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
43 %define blurb2 Bacula is a set of computer programs that permit you (or the system
44 %define blurb3 administrator) to manage backup, recovery, and verification of computer
45 %define blurb4 data across a network of computers of different kinds. In technical terms,
46 %define blurb5 it is a network client/server based backup program. Bacula is relatively
47 %define blurb6 easy to use and efficient, while offering many advanced storage management
48 %define blurb7 features that make it easy to find and recover lost or damaged files.
49 %define blurb8 Bacula source code has been released under the GPL version 2 license.
52 %define sqlite_bindir /usr/lib/bacula/sqlite
53 %define _docsrc ../%{name}-docs-%{docs_version}
54 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
55 %define depkgs ../depkgs
56 %define _mandir /usr/share/man
58 # directory locations for FHS-compatibility
59 %define sysconf_dir /etc/bacula
60 %define script_dir /etc/bacula
61 %define working_dir /var/lib/bacula
62 %define pid_dir /var/run
64 # NOTE these defines are used in some rather complex useradd and groupadd
65 # commands. If you change them examine the post scripts for consequences.
66 %define director_daemon_user bacula
67 %define storage_daemon_user bacula
68 %define file_daemon_user root
69 %define daemon_group bacula
70 # group that has write access to tape devices, usually disk on Linux
71 %define storage_daemon_group disk
72 %define user_file /etc/passwd
73 %define group_file /etc/group
76 %define useradd /usr/sbin/useradd
77 %define groupadd /usr/sbin/groupadd
78 %define usermod /usr/sbin/usermod
80 # platform defines - set one below or define the build_xxx on the command line
83 %{?build_rh7:%define rh7 1}
85 %{?build_rh8:%define rh8 1}
87 %{?build_rh9:%define rh9 1}
90 %{?build_fc1:%define fc1 1}
92 %{?build_fc3:%define fc3 1}
94 %{?build_fc4:%define fc4 1}
96 %{?build_fc5:%define fc5 1}
98 %{?build_fc6:%define fc6 1}
100 %{?build_fc7:%define fc7 1}
101 # Whitebox Enterprise build
103 %{?build_wb3:%define wb3 1}
104 # RedHat Enterprise builds
106 %{?build_rhel3:%define rhel3 1}
107 %{?build_rhel3:%define wb3 1}
109 %{?build_rhel4:%define rhel4 1}
110 %{?build_rhel4:%define fc3 1}
112 %{?build_rhel5:%define rhel5 1}
113 %{?build_rhel5:%define fc6 1}
116 %{?build_centos3:%define centos3 1}
117 %{?build_centos3:%define wb3 1}
119 %{?build_centos4:%define centos4 1}
120 %{?build_centos4:%define fc3 1}
122 %{?build_centos5:%define centos5 1}
123 %{?build_centos5:%define fc6 1}
126 %{?build_sl3:%define sl3 1}
127 %{?build_sl3:%define wb3 1}
129 %{?build_sl4:%define sl4 1}
130 %{?build_sl4:%define fc3 1}
132 %{?build_sl5:%define sl5 1}
133 %{?build_sl5:%define fc6 1}
136 %{?build_su9:%define su9 1}
138 %{?build_su10:%define su10 1}
140 %{?build_su102:%define su102 1}
143 %{?build_mdk:%define mdk 1}
145 %{?build_mdv:%define mdv 1}
146 %{?build_mdv:%define mdk 1}
149 %define client_only 0
150 %{?build_client_only:%define client_only 1}
152 # test for a platform definition
153 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk}
154 %{error: You must specify a platform. Please examine the spec file.}
159 # set for database support desired or define the build_xxx on the command line
161 %{?build_mysql:%define mysql 1}
162 # if using mysql 4.x define this and mysql above
163 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
165 %{?build_mysql4:%define mysql4 1}
166 %{?build_mysql4:%define mysql 1}
167 # if using mysql 5.x define this and mysql above
168 # currently: SuSE 10.1 and Fedora Core 5
170 %{?build_mysql5:%define mysql5 1}
171 %{?build_mysql5:%define mysql 1}
173 %{?build_sqlite:%define sqlite 1}
175 %{?build_postgresql:%define postgresql 1}
177 # test for a database definition
178 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
179 %{error: You must specify database support. Please examine the spec file.}
184 %define db_backend mysql
187 %define db_backend sqlite
190 %define db_backend postgresql
195 %{?build_x86_64:%define x86_64 1}
197 # check what distribution we are
198 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4} || %{rhel5}
199 %define _dist %(grep Red /etc/redhat-release)
201 %if %{fc1} || %{fc4} || %{fc5} || %{fc7}
202 %define _dist %(grep Fedora /etc/redhat-release)
204 %if %{centos5} || %{centos4} || %{centos3}
205 %define _dist %(grep CentOS /etc/redhat-release)
207 %if %{sl5} ||%{sl4} || %{sl3}
208 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
210 %if %{fc3} && ! %{rhel4} && ! %{centos4} && ! %{sl4}
211 %define _dist %(grep Fedora /etc/redhat-release)
213 %if %{fc6} && ! %{rhel5} && ! %{centos5} && ! %{sl5}
214 %define _dist %(grep Fedora /etc/redhat-release)
216 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
217 %define _dist %(grep White /etc/whitebox-release)
219 %if %{su9} || %{su10} || %{su102}
220 %define _dist %(grep -i SuSE /etc/SuSE-release)
223 %define _dist %(grep Mand /etc/mandrake-release)
225 Distribution: %{_dist}
227 # Should we build gconsole, possible only if gtk= >= 2.4 available.
228 # leaving all the BuildRequires and Requires in place below for now.
229 # su10, fc3 and fc4 now nobuild, tray monitor fails to build as of 2.2.1
230 # release as it needs 2.10
233 %if %{rh7} || %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{su9} || %{su10}
236 %if %{mdk} && ! %{mdv}
240 # specifically disallow gconsole if desired
241 %{?nobuild_gconsole:%define gconsole 0}
243 # Should we build wxconsole, only wxWidgets >=2.6 is supported
244 # currently only SuSE 10 and FC4/FC5
246 %{?build_wxconsole:%define wxconsole 1}
248 # Should we build bat
251 %{?build_bat:%define bat 1}
253 # should we turn on python support
255 %{?build_python:%define python 1}
257 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
259 %define manpage_ext bz2
261 %define manpage_ext gz
264 # for client only build
275 %{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)}
276 %{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)}
278 BuildRequires: gcc, gcc-c++, make, autoconf
279 BuildRequires: ncurses-devel, perl
280 BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, libxml2-devel, zlib-devel
281 BuildRequires: openssl-devel
283 BuildRequires: python, python-devel
284 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
287 BuildRequires: pkgconfig, pango-devel, atk-devel
290 BuildRequires: qt-devel >= 4.2
293 BuildRequires: libtermcap-devel
294 BuildRequires: glibc-devel >= 2.2
297 BuildRequires: termcap
298 BuildRequires: glibc-devel >= 2.3
300 %if %{su9} && %{gconsole}
301 BuildRequires: libgnome >= 2.0
302 BuildRequires: gtk2-devel >= 2.0
303 BuildRequires: libgnomeui-devel >= 2.0
304 BuildRequires: ORBit2-devel
305 BuildRequires: libart_lgpl-devel >= 2.0
306 BuildRequires: libbonobo-devel >= 2.0
307 BuildRequires: libbonoboui-devel >= 2.0
308 BuildRequires: bonobo-activation-devel
309 BuildRequires: gconf2-devel
310 BuildRequires: linc-devel
311 BuildRequires: freetype2-devel
314 BuildRequires: termcap
315 BuildRequires: glibc-devel >= 2.3
317 %if %{su10} && %{gconsole}
318 BuildRequires: libgnome >= 2.12
319 BuildRequires: gtk2-devel >= 2.8
320 BuildRequires: libgnomeui-devel >= 2.12
321 BuildRequires: ORBit2-devel
322 BuildRequires: libart_lgpl-devel >= 2.3
323 BuildRequires: libbonobo-devel >= 2.10
324 BuildRequires: libbonoboui-devel >= 2.10
325 BuildRequires: bonobo-activation-devel
326 BuildRequires: gconf2-devel
327 BuildRequires: freetype2-devel
328 BuildRequires: cairo-devel
329 BuildRequires: fontconfig-devel >= 2.3
330 BuildRequires: gnome-vfs2-devel >= 2.12
331 BuildRequires: libpng-devel
334 BuildRequires: termcap
335 BuildRequires: glibc-devel >= 2.5
337 %if %{su102} && %{gconsole}
338 BuildRequires: libgnome >= 2.16
339 BuildRequires: gtk2-devel >= 2.10
340 BuildRequires: libgnomeui-devel >= 2.16
341 BuildRequires: ORBit2-devel
342 BuildRequires: libart_lgpl-devel >= 2.3
343 BuildRequires: libbonobo-devel >= 2.16
344 BuildRequires: libbonoboui-devel >= 2.16
345 BuildRequires: bonobo-activation-devel
346 BuildRequires: gconf2-devel
347 BuildRequires: freetype2-devel
348 BuildRequires: cairo-devel
349 BuildRequires: fontconfig-devel >= 2.4
350 BuildRequires: gnome-vfs2-devel >= 2.16
351 BuildRequires: libpng-devel
354 BuildRequires: libtermcap-devel
355 BuildRequires: libstdc++-static-devel
356 BuildRequires: glibc-static-devel
357 BuildRequires: glibc-devel >= 2.3
359 %if %{mdk} && !%{mdv} && %{gconsole}
360 BuildRequires: gtk2-devel >= 2.0
361 BuildRequires: libgnomeui2-devel >= 2.0
362 BuildRequires: libORBit2-devel
363 BuildRequires: libart_lgpl-devel >= 2.0
364 BuildRequires: libbonobo2_0-devel
365 BuildRequires: libbonoboui2_0-devel
366 BuildRequires: libbonobo-activation-devel
367 BuildRequires: libGConf2-devel
368 BuildRequires: freetype2-devel
370 %if %{mdv} && %{gconsole}
371 BuildRequires: gtk2-devel >= 2.8
372 BuildRequires: libgnomeui2-devel >= 2.10
373 BuildRequires: libORBit2-devel
374 BuildRequires: libart_lgpl-devel >= 2.3
375 BuildRequires: libbonobo2_0-devel
376 BuildRequires: libbonoboui2_0-devel
377 BuildRequires: libbonobo-activation-devel
378 BuildRequires: libGConf2-devel
379 BuildRequires: freetype2-devel
382 BuildRequires: libtermcap-devel
383 BuildRequires: glibc-devel >= 2.3
385 %if %{fc3} && %{gconsole}
386 BuildRequires: gtk2-devel >= 2.4
387 BuildRequires: libgnomeui-devel >= 2.8
388 BuildRequires: ORBit2-devel
389 BuildRequires: libart_lgpl-devel >= 2.3
390 BuildRequires: libbonobo-devel >= 2.8
391 BuildRequires: libbonoboui-devel >= 2.8
392 BuildRequires: bonobo-activation-devel
393 BuildRequires: GConf2-devel
394 BuildRequires: freetype-devel
397 BuildRequires: libtermcap-devel
398 BuildRequires: glibc-devel >= 2.3
400 %if %{fc4} && %{gconsole}
401 BuildRequires: gtk2-devel >= 2.6
402 BuildRequires: libgnomeui-devel >= 2.10
403 BuildRequires: ORBit2-devel
404 BuildRequires: libart_lgpl-devel >= 2.3
405 BuildRequires: libbonobo-devel >= 2.8
406 BuildRequires: libbonoboui-devel >= 2.8
407 BuildRequires: bonobo-activation-devel
408 BuildRequires: GConf2-devel
409 BuildRequires: freetype-devel
412 BuildRequires: libtermcap-devel
413 BuildRequires: glibc-devel >= 2.4
415 %if %{fc5} && %{gconsole}
416 BuildRequires: gtk2-devel >= 2.8
417 BuildRequires: libgnomeui-devel >= 2.14
418 BuildRequires: ORBit2-devel
419 BuildRequires: libart_lgpl-devel >= 2.3
420 BuildRequires: libbonobo-devel >= 2.14
421 BuildRequires: libbonoboui-devel >= 2.14
422 BuildRequires: GConf2-devel
423 BuildRequires: freetype-devel
426 BuildRequires: libtermcap-devel
427 BuildRequires: glibc-devel >= 2.5
429 %if %{fc6} && %{gconsole}
430 BuildRequires: gtk2-devel >= 2.10
431 BuildRequires: libgnomeui-devel >= 2.16
432 BuildRequires: ORBit2-devel
433 BuildRequires: libart_lgpl-devel >= 2.3
434 BuildRequires: libbonobo-devel >= 2.16
435 BuildRequires: libbonoboui-devel >= 2.16
436 BuildRequires: GConf2-devel
437 BuildRequires: freetype-devel
440 BuildRequires: libtermcap-devel
441 BuildRequires: glibc-devel >= 2.5
443 %if %{fc7} && %{gconsole}
444 BuildRequires: gtk2-devel >= 2.10
445 BuildRequires: libgnomeui-devel >= 2.18
446 BuildRequires: ORBit2-devel
447 BuildRequires: libart_lgpl-devel >= 2.3
448 BuildRequires: libbonobo-devel >= 2.18
449 BuildRequires: libbonoboui-devel >= 2.18
450 BuildRequires: GConf2-devel
451 BuildRequires: freetype-devel
453 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7}
454 BuildRequires: libtermcap-devel
455 BuildRequires: glibc-devel >= 2.3
457 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7} && %{gconsole}
458 BuildRequires: gtk2-devel >= 2.0
459 BuildRequires: libgnomeui-devel >= 2.0
460 BuildRequires: ORBit2-devel
461 BuildRequires: libart_lgpl-devel >= 2.0
462 BuildRequires: libbonobo-devel >= 2.0
463 BuildRequires: libbonoboui-devel >= 2.0
464 BuildRequires: bonobo-activation-devel
465 BuildRequires: GConf2-devel
466 BuildRequires: linc-devel
467 BuildRequires: freetype-devel
470 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
471 BuildRequires: mysql-devel >= 3.23
474 %if %{mysql} && %{mysql4}
475 BuildRequires: mysql-devel >= 4.0
478 %if %{mysql} && %{mysql5}
479 BuildRequires: mysql-devel >= 5.0
482 %if %{postgresql} && %{wb3}
483 BuildRequires: rh-postgresql-devel >= 7
486 %if %{postgresql} && ! %{wb3}
487 BuildRequires: postgresql-devel >= 7
491 BuildRequires: wxGTK-devel >= 2.6
515 Summary: Bacula - The Network Backup Solution
516 Group: System Environment/Daemons
517 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
518 Conflicts: bacula-client
519 Obsoletes: bacula-rescue
521 %if %{su9} || %{su10} || %{su102}
525 Requires: ncurses, libstdc++, zlib, openssl, mtx
528 Requires: glibc >= 2.2
531 %if %{su9} || %{su10}
532 Requires: glibc >= 2.3
536 Requires: glibc >= 2.5
539 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{fc5} && ! %{fc6} && ! %{fc7}
540 Requires: glibc >= 2.3
544 Requires: glibc >= 2.4
548 Requires: glibc >= 2.5
552 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
553 Requires: mysql >= 3.23
554 Requires: mysql-server >= 3.23
556 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
557 Requires: mysql >= 4.0
558 Requires: mysql-server >= 4.0
560 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk} && %{mysql5}
561 Requires: mysql >= 5.0
562 Requires: mysql-server >= 5.0
565 %if %{mysql} && %{su9} && ! %{mysql4}
566 Requires: mysql >= 3.23
567 Requires: mysql-client >= 3.23
569 %if %{mysql} && %{su9} && %{mysql4}
570 Requires: mysql >= 4.0
571 Requires: mysql-client >= 4.0
573 %if %{mysql} && %{su10} && %{mysql4}
574 Requires: mysql >= 4.0
575 Requires: mysql-client >= 4.0
577 %if %{mysql} && %{su10} && %{mysql5}
578 Requires: mysql >= 5.0
579 Requires: mysql-client >= 5.0
581 %if %{mysql} && %{su102} && %{mysql5}
582 Requires: mysql >= 5.0
583 Requires: mysql-client >= 5.0
586 %if %{mysql} && %{mdk} && ! %{mysql4}
587 Requires: mysql >= 3.23
588 Requires: mysql-client >= 3.23
590 %if %{mysql} && %{mdk} && %{mysql4}
591 Requires: mysql >= 4.0
592 Requires: mysql-client >= 4.0
595 %if %{postgresql} && %{wb3}
596 Requires: rh-postgresql >= 7
597 Requires: rh-postgresql-server >= 7
599 %if %{postgresql} && ! %{wb3}
600 Requires: postgresql >= 7
601 Requires: postgresql-server >= 7
611 %description postgresql
615 Requires: python >= %{pyver}
629 This build requires MySQL to be installed separately as the catalog database.
632 This build requires PostgreSQL to be installed separately as the catalog database.
635 This build incorporates sqlite as the catalog database, statically compiled.
638 This build includes python scripting support.
643 Summary: Bacula - The Network Backup Solution
644 Group: System Environment/Daemons
648 This is Bacula's version of mtx tape utilities for Linux distributions that
649 do not provide their own mtx package
653 Summary: Bacula - The Network Backup Solution
654 Group: System Environment/Daemons
656 Conflicts: bacula-mysql
657 Conflicts: bacula-sqlite
658 Conflicts: bacula-postgresql
659 Obsoletes: bacula-rescue
661 %if %{su9} || %{su10} || %{su102}
665 Requires: libstdc++, zlib, openssl
668 Requires: glibc >= 2.2
671 %if %{su9} || %{su10}
672 Requires: glibc >= 2.3
676 Requires: glibc >= 2.5
679 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{fc5} && ! %{fc6}
680 Requires: glibc >= 2.3
684 Requires: glibc >= 2.4
688 Requires: glibc >= 2.5
693 Requires: python >= %{pyver}
707 This is the File daemon (Client) only package. It includes the command line
710 This build includes python scripting support.
716 Summary: Bacula - The Network Backup Solution
717 Group: System Environment/Daemons
719 %description updatedb
730 This package installs scripts for updating older versions of the bacula
736 Summary: Bacula - The Network Backup Solution
737 Group: System Environment/Daemons
738 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
741 %if %{gconsole} && %{su9}
742 Requires: gtk2 >= 2.0
743 Requires: libgnome >= 2.0
744 Requires: libgnomeui >= 2.0
745 Requires: glibc >= 2.3
747 Requires: libart_lgpl >= 2.0
748 Requires: libbonobo >= 2.0
749 Requires: libbonoboui >= 2.0
750 Requires: bonobo-activation
755 %if %{gconsole} && %{su10}
756 Requires: gtk2 >= 2.8
757 Requires: libgnome >= 2.12
758 Requires: libgnomeui >= 2.12
759 Requires: glibc >= 2.3
761 Requires: libart_lgpl >= 2.3
762 Requires: libbonobo >= 2.10
763 Requires: libbonoboui >= 2.10
764 Requires: bonobo-activation
768 Requires: fontconfig >= 2.3
769 Requires: gnome-vfs2 >= 2.12
772 %if %{gconsole} && %{su102}
773 Requires: gtk2 >= 2.10
774 Requires: libgnome >= 2.16
775 Requires: libgnomeui >= 2.16
776 Requires: glibc >= 2.5
778 Requires: libart_lgpl >= 2.3
779 Requires: libbonobo >= 2.16
780 Requires: libbonoboui >= 2.16
781 Requires: bonobo-activation
785 Requires: fontconfig >= 2.4
786 Requires: gnome-vfs2 >= 2.16
789 %if %{gconsole} && %{mdk} && !%{mdv}
790 Requires: gtk2 >= 2.0
791 Requires: libgnomeui2
792 Requires: glibc >= 2.3
794 Requires: libart_lgpl >= 2.0
795 Requires: libbonobo >= 2.0
796 Requires: libbonoboui >= 2.0
800 %if %{gconsole} && %{mdv}
801 Requires: gtk2 >= 2.8
802 Requires: libgnomeui2
803 Requires: glibc >= 2.3
805 Requires: libart_lgpl >= 2.3
806 Requires: libbonobo >= 2.10
807 Requires: libbonoboui >= 2.10
811 %if %{gconsole} && %{fc3}
812 Requires: gtk2 >= 2.4
813 Requires: libgnomeui >= 2.8
814 Requires: glibc >= 2.3
816 Requires: libart_lgpl >= 2.3
817 Requires: libbonobo >= 2.8
818 Requires: libbonoboui >= 2.8
819 Requires: bonobo-activation
823 %if %{gconsole} && %{fc4}
824 Requires: gtk2 >= 2.6
825 Requires: libgnomeui >= 2.10
826 Requires: glibc >= 2.3
828 Requires: libart_lgpl >= 2.3
829 Requires: libbonobo >= 2.8
830 Requires: libbonoboui >= 2.8
831 Requires: bonobo-activation
835 %if %{gconsole} && %{fc5}
836 Requires: gtk2 >= 2.8
837 Requires: libgnomeui >= 2.14
838 Requires: glibc >= 2.4
840 Requires: libart_lgpl >= 2.3
841 Requires: libbonobo >= 2.14
842 Requires: libbonoboui >= 2.14
846 %if %{gconsole} && %{fc6}
847 Requires: gtk2 >= 2.10
848 Requires: libgnomeui >= 2.16
849 Requires: glibc >= 2.5
851 Requires: libart_lgpl >= 2.3
852 Requires: libbonobo >= 2.16
853 Requires: libbonoboui >= 2.16
857 %if %{gconsole} && %{fc7}
858 Requires: gtk2 >= 2.10
859 Requires: libgnomeui >= 2.18
860 Requires: glibc >= 2.5
862 Requires: libart_lgpl >= 2.3
863 Requires: libbonobo >= 2.18
864 Requires: libbonoboui >= 2.18
868 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && ! %{fc7}
869 Requires: gtk2 >= 2.0
870 Requires: libgnomeui >= 2.0
871 Requires: glibc >= 2.3
873 Requires: libart_lgpl >= 2.0
874 Requires: libbonobo >= 2.0
875 Requires: libbonoboui >= 2.0
876 Requires: bonobo-activation
881 %if %{gconsole} && %{su9}
884 %if %{gconsole} && %{su10}
887 %if %{gconsole} && %{su102}
890 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102}
895 %description gconsole
906 This is the Gnome Console package. It is an add-on to the client or
912 Summary: Bacula - The Network Backup Solution
913 Group: System Environment/Daemons
914 Requires: wxGTK >= 2.6, libstdc++, openssl
917 %if %{wxconsole} && %{su10}
918 Requires: gtk2 >= 2.8
921 %if %{wxconsole} && %{su102}
922 Requires: gtk2 >= 2.10
925 %if %{wxconsole} && %{fc3}
926 Requires: gtk2 >= 2.4
929 %if %{wxconsole} && %{fc4}
930 Requires: gtk2 >= 2.6
933 %if %{wxconsole} && %{fc5}
934 Requires: gtk2 >= 2.8
937 %if %{wxconsole} && %{fc6}
938 Requires: gtk2 >= 2.10
941 %if %{wxconsole} && %{fc7}
942 Requires: gtk2 >= 2.10
946 %description wxconsole
957 This is the WXWindows Console package. It is an add-on to the client or
963 Summary: Bacula - The Network Backup Solution
964 Group: System Environment/Daemons
967 %if %{bat} && %{su10}
969 Requires: glibc >= 2.4
979 %if %{bat} && %{su102}
981 Requires: glibc >= 2.5
993 Requires: glibc >= 2.4
1003 %if %{bat} && %{fc6}
1005 Requires: glibc >= 2.5
1006 Requires: fontconfig
1015 %if %{bat} && %{fc7}
1017 Requires: glibc >= 2.5
1018 Requires: fontconfig
1039 This is the Bacula Administration Tool package. It is an add-on to
1040 the client or server packages.
1053 %if %{su9} || %{su10} || %{su102}
1054 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
1062 %if ! %{client_only}
1070 # patches for the bundled sqlite scripts
1072 # patch the make_sqlite_tables script for installation bindir
1073 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
1075 # patch the create_sqlite_database script for installation bindir
1076 # not necessary after 1.39.26 no longer references sqlite binary
1077 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
1079 # patch the make_catalog_backup script for installation bindir
1080 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
1082 # patch the update_sqlite_tables script for installation bindir
1083 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
1085 # patch the bacula-dir init script to remove sqlite service
1086 %if %{sqlite} && %{su9}
1087 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1089 %if %{sqlite} && %{su10}
1090 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1092 %if %{sqlite} && %{su102}
1093 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
1096 # 64 bit lib location hacks
1097 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
1098 # reported to be fixed to properly detect lib locations.
1100 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
1102 %if %{mysql} && %{x86_64}
1103 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
1105 %if %{python} && %{x86_64}
1106 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
1109 # Red Hat's 64 bit installation of QT4 appears to be broken so:
1111 %if %{rhel5} || %{centos5} || %{sl5}
1114 %if %{bat} && %{qt_path} && %{x86_64}
1115 export PATH=/usr/lib64/qt4/bin/:$PATH
1116 export QTDIR=/usr/lib64/qt4/
1117 export QTINC=/usr/lib64/qt4/include/
1118 export QTLIB=/usr/lib64/qt4/
1123 --sbindir=/usr/sbin \
1124 --sysconfdir=%{sysconf_dir} \
1125 --with-scriptdir=%{script_dir} \
1126 --with-working-dir=%{working_dir} \
1127 --with-pid-dir=%{pid_dir} \
1128 --enable-smartalloc \
1129 --enable-client-only \
1139 --sbindir=/usr/sbin \
1140 --sysconfdir=%{sysconf_dir} \
1141 --with-scriptdir=%{script_dir} \
1142 --with-working-dir=%{working_dir} \
1143 --with-pid-dir=%{pid_dir} \
1144 --enable-smartalloc \
1148 %if %{gconsole} && ! %{rh8}
1149 --enable-tray-monitor \
1155 --with-sqlite=${cwd}/%{depkgs}/sqlite \
1161 --enable-bwx-console \
1165 --with-qwt=${cwd}/%{depkgs}/qwt \
1171 --enable-client-only \
1173 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
1174 --disable-batch-insert \
1176 --mandir=%{_mandir} \
1177 --with-subsys-dir=/var/lock/subsys \
1178 --with-dir-user=%{director_daemon_user} \
1179 --with-dir-group=%{daemon_group} \
1180 --with-sd-user=%{storage_daemon_user} \
1181 --with-sd-group=%{storage_daemon_group} \
1182 --with-fd-user=%{file_daemon_user} \
1183 --with-fd-group=%{daemon_group} \
1184 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
1185 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
1186 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
1187 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
1188 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
1189 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
1197 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1198 mkdir -p $RPM_BUILD_ROOT/etc/init.d
1199 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
1200 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
1201 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
1202 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
1203 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
1205 %if %{gconsole} || %{wxconsole} || %{bat}
1206 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
1207 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
1210 %if %{gconsole} || %{wxconsole} || %{bat}
1211 %define usermode_iftrick 1
1213 %define usermode_iftrick 0
1216 %if %{usermode_iftrick} && ! %{su9} && ! %{su10} && ! %{su102}
1217 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
1218 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
1219 mkdir -p $RPM_BUILD_ROOT/usr/bin
1223 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
1227 prefix=$RPM_BUILD_ROOT/usr \
1228 sbindir=$RPM_BUILD_ROOT/usr/sbin \
1229 sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
1230 scriptdir=$RPM_BUILD_ROOT%{script_dir} \
1231 working_dir=$RPM_BUILD_ROOT%{working_dir} \
1232 piddir=$RPM_BUILD_ROOT%{pid_dir} \
1233 mandir=$RPM_BUILD_ROOT%{_mandir} \
1236 %if ! %{client_only}
1239 prefix=$RPM_BUILD_ROOT/usr \
1240 sbindir=$RPM_BUILD_ROOT/usr/sbin \
1241 sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
1242 scriptdir=$RPM_BUILD_ROOT%{script_dir} \
1243 working_dir=$RPM_BUILD_ROOT%{working_dir} \
1244 piddir=$RPM_BUILD_ROOT%{pid_dir} \
1245 mandir=$RPM_BUILD_ROOT%{_mandir} \
1250 # make install in manpages installs _everything_ shotgun style
1251 # so now delete what we will not be packaging
1253 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
1256 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bat.1.%{manpage_ext}
1259 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
1260 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
1263 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
1264 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1265 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1266 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
1267 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
1268 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
1269 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
1270 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
1271 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
1274 # fixme - make installs the mysql scripts for sqlite build
1276 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1277 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1278 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
1281 # fixme - make installs the mysql scripts for postgresql build
1283 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1284 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1287 # fixme - make installs gconsole script for build without gconsole
1289 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
1292 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
1294 # install the init scripts
1295 %if %{su9} || %{su10} || %{su102}
1296 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1297 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1298 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1301 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1302 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1303 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1305 %if ! %{su9} && ! %{su10} && ! %{su102} && ! %{mdk}
1306 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1307 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1308 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1310 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
1312 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1313 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1316 # install the menu stuff
1317 %if %{gconsole} && %{su9}
1318 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1319 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1320 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1321 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1323 %if %{gconsole} && %{su10}
1324 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1325 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1326 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1327 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1329 %if %{gconsole} && %{su102}
1330 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1331 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1332 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1333 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1335 %if %{wxconsole} && %{su10}
1336 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1337 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1339 %if %{wxconsole} && %{su102}
1340 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1341 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1343 %if %{bat} && %{su102}
1344 cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
1345 cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
1347 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{mdk}
1352 %if %{gconsole} && %{iftrick}
1353 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1354 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1355 cp -p scripts/bgnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bgnome-console
1356 cp -p scripts/bgnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/bgnome-console
1357 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bgnome-console
1359 %if %{gconsole} && ! %{rh8}
1360 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1361 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1363 %if %{wxconsole} && %{iftrick}
1364 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1365 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1366 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bwx-console
1367 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/bwx-console
1368 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bwx-console
1370 %if %{bat} && %{iftrick}
1371 cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
1372 cp -p scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
1373 cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat
1374 cp -p scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat
1375 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat
1380 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
1381 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
1382 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
1385 # install the logrotate file
1386 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
1388 # install the updatedb scripts
1389 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
1391 # install the logwatch scripts
1392 %if ! %{client_only}
1393 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1394 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1395 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1396 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1397 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1398 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1401 # install the rescue files
1402 mkdir $RPM_BUILD_ROOT%{sysconf_dir}/rescue
1403 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1404 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1405 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1406 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1407 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1408 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT%{sysconf_dir}/rescue/
1409 touch $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/rpm_release
1410 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd
1411 rm -f src/filed/static-bacula-fd
1413 # install bat since make doesn't at the moment
1415 cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat
1416 cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
1419 # now clean up permissions that are left broken by the install
1420 %if ! %{client_only}
1421 chmod o-r $RPM_BUILD_ROOT%{script_dir}/query.sql
1423 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
1424 %if %{gconsole} && ! %{rh8}
1425 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
1426 chmod 644 $RPM_BUILD_ROOT%{sysconf_dir}/tray-monitor.conf
1429 # fix me - building enable-client-only installs files not included in bacula-client package
1431 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
1432 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
1433 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
1434 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
1435 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
1436 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
1437 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
1438 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
1439 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
1443 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1444 rm -rf $RPM_BUILD_DIR/%{name}-docs-%{docs_version}
1445 rm -rf $RPM_BUILD_DIR/%{name}-rescue-%{_rescuever}
1446 rm -rf $RPM_BUILD_DIR/depkgs
1447 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
1450 # MySQL specific files
1452 %defattr(-, root, root)
1453 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
1454 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
1455 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
1456 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
1457 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
1458 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
1459 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
1460 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
1465 %defattr(-,root,root)
1466 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite_database
1467 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_database
1468 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite_privileges
1469 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite_tables
1470 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_tables
1471 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite_tables
1472 %{sqlite_bindir}/libsqlite.a
1473 %{sqlite_bindir}/sqlite.h
1474 %{sqlite_bindir}/sqlite
1479 %defattr(-,root,root)
1480 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
1481 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
1482 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
1483 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
1484 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
1485 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
1488 # The rest is DB backend independent
1489 %if ! %{client_only}
1490 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1491 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1492 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1493 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1494 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1495 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1496 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1497 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1498 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1499 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1500 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1501 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1502 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1503 %attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue
1504 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1505 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1506 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1507 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1508 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1509 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1510 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1511 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1512 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1514 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1515 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1517 /etc/logrotate.d/bacula
1518 /etc/log.d/scripts/services/bacula
1519 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1520 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1521 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1522 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1523 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1524 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1525 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1527 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1529 /usr/sbin/bacula-dir
1537 /usr/sbin/btraceback
1543 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1544 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1545 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1546 %{_mandir}/man8/bacula.8.%{manpage_ext}
1547 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1548 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1549 %{_mandir}/man8/bextract.8.%{manpage_ext}
1550 %{_mandir}/man8/bls.8.%{manpage_ext}
1551 %{_mandir}/man8/bscan.8.%{manpage_ext}
1552 %{_mandir}/man8/btape.8.%{manpage_ext}
1553 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1554 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1555 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1560 # test for bacula database older than version 9
1561 # note: this ASSUMES no password has been set for bacula database
1562 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1567 # test for bacula database older than version 9
1568 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1569 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1574 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1577 %if ! %{client_only}
1578 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
1579 echo "This bacula upgrade will update a bacula database from version 9 to 10."
1580 echo "You appear to be running database version $DB_VER. You must first update"
1581 echo "your database to version 9 and then install this upgrade. The alternative"
1582 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1583 echo "catalog information, then do the upgrade. Information on updating a"
1584 echo "database older than version 9 can be found in the release notes."
1593 %if ! %{client_only}
1594 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1595 if [ -s %{sysconf_dir}/console.conf ];then
1596 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1599 # create the daemon users and groups
1600 # first create the groups if they don't exist
1601 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1602 if [ -z "$HAVE_BACULA" ]; then
1603 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1604 echo "The group %{daemon_group} has been added to %{group_file}."
1605 echo "See the manual chapter \"Running Bacula\" for details."
1607 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1608 if [ -z "$HAVE_BACULA" ]; then
1609 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1610 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1611 echo "See the manual chapter \"Running Bacula\" for details."
1613 # now create the users if they do not exist
1614 # we do not use the -g option allowing the primary group to be set to system default
1615 # this will be a unique group on redhat type systems or the group users on some systems
1616 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1617 if [ -z "$HAVE_BACULA" ]; then
1618 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1619 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1620 echo "See the manual chapter \"Running Bacula\" for details."
1622 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1623 if [ -z "$HAVE_BACULA" ]; then
1624 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1625 echo "The user %{director_daemon_user} has been added to %{user_file}."
1626 echo "See the manual chapter \"Running Bacula\" for details."
1628 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1629 if [ -z "$HAVE_BACULA" ]; then
1630 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1631 echo "The user %{file_daemon_user} has been added to %{user_file}."
1632 echo "See the manual chapter \"Running Bacula\" for details."
1634 # now we add the supplementary groups, this is ok to call even if the users already exist
1635 # we only do this if the user is NOT root
1636 IS_ROOT=%{director_daemon_user}
1637 if [ "$IS_ROOT" != "root" ]; then
1638 %{usermod} -G %{daemon_group} %{director_daemon_user}
1640 IS_ROOT=%{storage_daemon_user}
1641 if [ "$IS_ROOT" != "root" ]; then
1642 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1644 IS_ROOT=%{file_daemon_user}
1645 if [ "$IS_ROOT" != "root" ]; then
1646 %{usermod} -G %{daemon_group} %{file_daemon_user}
1660 %if ! %{client_only}
1662 if [ "$1" -ge 1 ] ; then
1663 /sbin/chkconfig --add bacula-dir
1664 /sbin/chkconfig --add bacula-fd
1665 /sbin/chkconfig --add bacula-sd
1670 # test for an existing database
1671 # note: this ASSUMES no password has been set for bacula database
1672 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1674 # grant privileges and create tables if they do not exist
1675 if [ -z "$DB_VER" ]; then
1676 echo "Hmm, doesn't look like you have an existing database."
1677 echo "Granting privileges for MySQL user bacula..."
1678 %{script_dir}/grant_mysql_privileges
1679 echo "Creating MySQL bacula database..."
1680 %{script_dir}/create_mysql_database
1681 echo "Creating bacula tables..."
1682 %{script_dir}/make_mysql_tables
1684 # check to see if we need to upgrade a 1.38 or lower database
1685 elif [ "$DB_VER" -lt "10" ]; then
1686 echo "This release requires an upgrade to your bacula database."
1687 echo "Backing up your current database..."
1688 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1689 echo "Upgrading bacula database ..."
1690 %{script_dir}/update_mysql_tables
1691 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1697 # test for an existing database
1698 if [ -s %{working_dir}/bacula.db ]; then
1699 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1700 # check to see if we need to upgrade a 1.38 or lower database
1701 if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
1702 echo "This release requires an upgrade to your bacula database."
1703 echo "Backing up your current database..."
1704 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1705 echo "Upgrading bacula database ..."
1706 %{script_dir}/update_sqlite_tables
1707 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1710 # create the database and tables
1711 echo "Hmm, doesn't look like you have an existing database."
1712 echo "Creating SQLite database..."
1713 %{script_dir}/create_sqlite_database
1714 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1715 echo "Creating the SQLite tables..."
1716 %{script_dir}/make_sqlite_tables
1721 # test for an existing database
1722 # note: this ASSUMES no password has been set for bacula database
1723 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1725 # grant privileges and create tables if they do not exist
1726 if [ -z "$DB_VER" ]; then
1727 echo "Hmm, doesn't look like you have an existing database."
1728 echo "Creating PostgreSQL bacula database..."
1729 %{script_dir}/create_postgresql_database
1730 echo "Creating bacula tables..."
1731 %{script_dir}/make_postgresql_tables
1732 echo "Granting privileges for PostgreSQL user bacula..."
1733 %{script_dir}/grant_postgresql_privileges
1735 # check to see if we need to upgrade a 1.38 or lower database
1736 elif [ "$DB_VER" -lt "10" ]; then
1737 echo "This release requires an upgrade to your bacula database."
1738 echo "Backing up your current database..."
1739 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1740 echo "Upgrading bacula database ..."
1741 %{script_dir}/update_postgresql_tables
1742 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1747 %if ! %{client_only}
1748 # generate passwords if needed
1749 if [ -d %{sysconf_dir} ]; then
1751 for file in *.conf; do
1752 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
1753 need_password=`grep $string $file 2>/dev/null`
1754 if [ -n "$need_password" ]; then
1755 pass=`openssl rand -base64 33`
1756 sed "s-$string-$pass-g" $file > $file.new
1757 cp -f $file.new $file; rm -f $file.new
1774 %if ! %{client_only}
1777 /sbin/chkconfig --del bacula-dir
1778 /sbin/chkconfig --del bacula-fd
1779 /sbin/chkconfig --del bacula-sd
1784 %if ! %{client_only}
1786 %defattr(-,root,root)
1787 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1788 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1789 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1790 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1791 %attr(-, root, %{storage_daemon_group}) /usr/sbin/nsmhack
1792 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsieject
1793 %{_mandir}/man1/loaderinfo.1.%{manpage_ext}
1794 %{_mandir}/man1/mtx.1.%{manpage_ext}
1795 %{_mandir}/man1/scsitape.1.%{manpage_ext}
1796 %{_mandir}/man1/tapeinfo.1.%{manpage_ext}
1797 %{_mandir}/man1/scsieject.1.%{manpage_ext}
1801 %defattr(-,root,root)
1802 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1803 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1804 %{script_dir}/bacula-ctl-fd
1805 /etc/init.d/bacula-fd
1806 %attr(-, root, %{daemon_group}) %{sysconf_dir}/rescue
1808 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1809 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1811 /etc/logrotate.d/bacula
1813 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1814 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1816 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1819 /usr/sbin/btraceback
1820 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1821 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1823 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1824 %{_mandir}/man8/bacula.8.%{manpage_ext}
1825 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1826 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1830 # create the daemon group and user
1831 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1832 if [ -z "$HAVE_BACULA" ]; then
1833 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1834 echo "The group %{daemon_group} has been added to %{group_file}."
1835 echo "See the manual chapter \"Running Bacula\" for details."
1837 # we do not use the -g option allowing the primary group to be set to system default
1838 # this will be a unique group on redhat type systems or the group users on some systems
1839 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1840 if [ -z "$HAVE_BACULA" ]; then
1841 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1842 echo "The user %{file_daemon_user} has been added to %{user_file}."
1843 echo "See the manual chapter \"Running Bacula\" for details."
1845 # now we add the supplementary group, this is ok to call even if the user already exists
1846 # we only do this if the user is NOT root
1847 IS_ROOT=%{file_daemon_user}
1848 if [ "$IS_ROOT" != "root" ]; then
1849 %{usermod} -G %{daemon_group} %{file_daemon_user}
1854 if [ "$1" -ge 1 ] ; then
1855 /sbin/chkconfig --add bacula-fd
1858 # generate passwords if needed
1859 if [ -d %{sysconf_dir} ]; then
1861 for file in *.conf; do
1862 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
1863 need_password=`grep $string $file 2>/dev/null`
1864 if [ -n "$need_password" ]; then
1865 pass=`openssl rand -base64 33`
1866 sed "s-$string-$pass-g" $file > $file.new
1867 cp -f $file.new $file; rm -f $file.new
1876 /sbin/chkconfig --del bacula-fd
1879 %if ! %{client_only}
1881 %defattr(-,root,%{daemon_group})
1882 %{script_dir}/updatedb/*
1885 # create the daemon group
1886 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1887 if [ -z "$HAVE_BACULA" ]; then
1888 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1889 echo "The group %{daemon_group} has been added to %{group_file}."
1890 echo "See the manual chapter \"Running Bacula\" for details."
1894 echo "The database update scripts were installed to %{script_dir}/updatedb"
1899 %defattr(-,root,root)
1900 /usr/sbin/bgnome-console
1901 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1902 %attr(-, root, %{daemon_group}) %{script_dir}/gconsole
1903 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf
1904 /usr/share/pixmaps/bacula.png
1905 /usr/share/applications/bacula.desktop
1906 %{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
1909 %if %{gconsole} && ! %{rh8}
1910 /usr/sbin/bacula-tray-monitor
1911 %config(noreplace) %{sysconf_dir}/tray-monitor.conf
1912 /usr/share/pixmaps/bacula-tray-monitor.xpm
1913 /usr/share/applications/bacula-tray-monitor.desktop
1914 %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
1917 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102}
1918 # add the console helper files
1919 %config(noreplace,missingok) /etc/pam.d/bgnome-console
1920 %config(noreplace,missingok) /etc/security/console.apps/bgnome-console
1921 /usr/bin/bgnome-console
1926 # create the daemon group
1927 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1928 if [ -z "$HAVE_BACULA" ]; then
1929 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1930 echo "The group %{daemon_group} has been added to %{group_file}."
1931 echo "See the manual chapter \"Running Bacula\" for details."
1935 # generate passwords if needed
1936 if [ -d %{sysconf_dir} ]; then
1938 for file in *.conf; do
1939 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
1940 need_password=`grep $string $file 2>/dev/null`
1941 if [ -n "$need_password" ]; then
1942 pass=`openssl rand -base64 33`
1943 sed "s-$string-$pass-g" $file > $file.new
1944 cp -f $file.new $file; rm -f $file.new
1953 %defattr(-,root,root)
1954 /usr/sbin/bwx-console
1955 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1956 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf
1957 /usr/share/pixmaps/wxwin16x16.xpm
1958 /usr/share/applications/wxconsole.desktop
1959 %{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
1962 %if %{wxconsole} && ! %{su9} && ! %{su10} && ! %{su102}
1963 # add the console helper files
1964 %config(noreplace,missingok) /etc/pam.d/bwx-console
1965 %config(noreplace,missingok) /etc/security/console.apps/bwx-console
1966 /usr/bin/bwx-console
1971 # create the daemon group
1972 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1973 if [ -z "$HAVE_BACULA" ]; then
1974 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1975 echo "The group %{daemon_group} has been added to %{group_file}."
1976 echo "See the manual chapter \"Running Bacula\" for details."
1980 # generate passwords if needed
1981 if [ -d %{sysconf_dir} ]; then
1983 for file in *.conf; do
1984 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
1985 need_password=`grep $string $file 2>/dev/null`
1986 if [ -n "$need_password" ]; then
1987 pass=`openssl rand -base64 33`
1988 sed "s-$string-$pass-g" $file > $file.new
1989 cp -f $file.new $file; rm -f $file.new
1998 %defattr(-,root,root)
2000 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
2001 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf
2002 /usr/share/pixmaps/bat_icon.png
2003 /usr/share/applications/bat.desktop
2004 %{_mandir}/man1/bat.1.%{manpage_ext}
2007 %if %{bat} && ! %{su9} && ! %{su10} && ! %{su102}
2008 # add the console helper files
2009 %config(noreplace,missingok) /etc/pam.d/bat
2010 %config(noreplace,missingok) /etc/security/console.apps/bat
2016 # create the daemon group
2017 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
2018 if [ -z "$HAVE_BACULA" ]; then
2019 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
2020 echo "The group %{daemon_group} has been added to %{group_file}."
2021 echo "See the manual chapter \"Running Bacula\" for details."
2025 # generate passwords if needed
2026 if [ -d %{sysconf_dir} ]; then
2028 for file in *.conf; do
2029 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
2030 need_password=`grep $string $file 2>/dev/null`
2031 if [ -n "$need_password" ]; then
2032 pass=`openssl rand -base64 33`
2033 sed "s-$string-$pass-g" $file > $file.new
2034 cp -f $file.new $file; rm -f $file.new
2042 * Sun Nov 04 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2043 - fix dist defines for rhel5 and clones
2044 - fix rhel broken 64 bit QT4 paths
2045 * Mon Oct 29 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2046 - correct ownership when creating sqlite db file in post script
2047 * Sun Sep 16 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2048 - fix disable-batch-insert
2049 * Fri Sep 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2051 - turn off gconsole build for fc3, tray monitor fails to build
2052 - add new files for mtx package (09Sep07 depkgs update)
2053 * Sat Sep 08 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2054 - add --disable-batch-insert for older platforms
2055 - add build targets for rhel5 and clones
2056 * Mon Sep 03 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2058 - turn off gconsole build for su10 & fc4, tray monitor fails to build
2059 * Sat Jul 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2060 - 2.1.26 add make of qwt in depkgs for bat
2061 * Sat Jun 02 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2062 - upgrade Qt requirement for bat to 4.2
2063 * Sun May 06 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2064 - add fc7 build target
2065 * Sun Apr 29 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2067 - gnome-console now bgnome-console
2068 - wxconsole now bwx-console
2069 - add build option for bat
2070 * Sat Apr 08 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2071 - merge Otto Mueller's patch but keep script dir set to /etc/bacula
2072 - add build tag for Scientific Linux per Jon Peatfield <J.S.Peatfield@damtp.cam.ac.uk>
2073 * Tue Mar 27 2007 Otto Mueller <otto.mueller@bundestag.de>
2074 - adjust directory locations for FHS-compatibility
2075 sysconf_dir (/etc/bacula), script_dir (/usr/lib/bacula),
2076 working_dir (/var/lib/bacula) and pid_dir (/var/run)
2077 * Mon Feb 26 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2078 - add SuSE 10.2 target
2079 * Sat Jan 20 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2081 - set query.sql as config file
2083 * Sun Jan 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2085 - change determination of gcc version per patch from Marc Hennes
2086 - move BuildRequire for atk-devel to gnome only builds
2088 * Sat Jan 06 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
2090 * Sun Oct 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2091 - 1.39.26 remove create_sqlite_database.in.patch
2092 * Sun Sep 24 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2093 - change ownership of working_dir on server packages to bacula.bacula so that
2094 - bacula-sd can create bootstrap files
2095 * Sat Sep 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2096 - 1.39.22 remove separate cd and make of manpages the main Makefile does it now
2097 * Sun Aug 06 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2098 - fix manpages file extension for mdk
2099 * Sat Aug 05 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2100 - bug 648 re-enable and update sqlite patches
2104 - lock out gconsole build for gtk+ < 2.4
2105 * Mon Jul 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2106 - move pango-devel BuildRequires into gconsole only build
2107 * Sat Jul 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2108 - add provides and conflicts for standard suse packages
2109 - add third party packager tag support
2110 - add build_client_only tag
2111 - remove bsmtp from client package
2112 - add bacula-ctl-fd to client package
2113 * Thu Jul 13 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2114 - fix directory creation when wxconsole and not gconsole
2115 * Tue Jul 04 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2116 - add check to buildrequires to make sure libstdc++ version matches gcc
2117 * Mon Jul 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2118 - add python build support
2119 - fix LDFLAGS declarations
2120 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2121 - add requires for standard compiler toolchain
2122 - move version and release tags up
2124 - add docs_version tag
2125 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2126 - update rescuever to 1.8.6
2127 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2128 - update depkgs to 25Jun06
2129 - add mysql5 build tag
2130 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2131 - 1.38.10 bump rescue version
2132 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2133 - fix usermod statements
2135 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2136 - add -g param back to useradd statements Bug 605
2137 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2138 - redundant code cleanup
2139 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2140 - add wxconsole package
2141 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2143 - dependency update for Mandriva
2144 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2146 - remove -n option from useradd scripts
2147 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2149 - fix problem specifying more than one primary group for user bacula
2150 - add build switch to not build gconsole regardless of platform
2151 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2152 - add centos3 build tag
2153 - fix link error of static-fd on Mandrake with --disable-nls
2154 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2155 - add fc4 dependencies
2156 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2157 - add SuSE 10.0 build
2158 - remove specific permission in attrib macros
2159 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
2161 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
2162 - refix compat for _dist on SLES9 which seems to have been removed
2163 - added note regarding Aleksandar's use of specific permissions in attrib macros
2164 - need to review and add specific fc4 build currently using fc3 Requires
2165 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2167 - Reorganize files and pre/post sections to remove repetitions
2168 - Always build separate mtx package
2169 - Fix file ownerships for /etc/bacula and Bacula's working dir
2170 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2171 - Disable GNOME on RH7
2172 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
2173 - Red Hat and look alikes have mtx RPM, do not build/package our version
2174 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2175 - minor edit to _dist for SLES9 compatibility
2176 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2178 - kern changed location of pdf files and html manual in docs package
2179 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2181 - add docs (from prebuilt tarball) and rescue packages back in
2182 - remove dvd-freespace and dvd-writepart files, add dvd-handler
2183 - remove 3 of 4 sqlite script patches as not needed
2184 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2186 - remove docs and rescue sections (remove static fd)
2187 - add dvd-freespace and dvd-writepart files
2188 - update depkgs to 22Jun05
2189 - change database update to 8 to 9
2190 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2191 - minor cleanups before 1.38 changes
2192 - add popt and popt-devel build dependencies
2193 - add tetex and tetex-dvips dependencies for doc build
2194 - replace deprecated Copyright tag with License
2195 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2196 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
2197 - conflict with sqlite packages. remove readline dependency.
2198 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2199 - release 1.36.3 update docs
2200 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2201 - add centos4 build tag
2202 - add x86_64 build tag
2203 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2204 - add rhel4 build tag
2205 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
2206 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2207 - add rhel3 build tag
2208 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2209 - fix tray-monitor.conf for noreplace
2210 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2211 - fix distribution check for Fedora and Whitebox
2212 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2213 - add logwatch script
2215 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2216 - add build for Fedora Core 3 (linc now included in ORDit2)
2217 - add mysql4 define for Mandrake 10.1
2218 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
2219 - fix {group_file} variable in post scripts
2220 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
2221 - add distribution checking and custom Distribution tag
2222 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2223 - ASSIGNMENT OF COPYRIGHT
2224 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
2225 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
2226 - all right, title and interest in and to the copyright in this software RPM
2227 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
2228 - free of all liens, encumbrances or any known claims against said copyright.
2229 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2231 - thanks to Daniel Widyono
2232 - update description for rescue package to describe cdrom creation
2233 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2234 - update depkgs to 29Oct04
2235 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2236 - add cdrom rescue to bacula-rescue package
2237 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2238 - misc fixes from 1.36.0 suse feedback
2239 - fix situation where sqlite database exists but sqlite has been removed.
2240 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2241 - remove tray-monitor from RH8 build
2242 - fix permissions on tray-monitor files
2243 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2244 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
2245 - change database update to 7 to 8 upgrade,
2246 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
2247 - build in 30Jul04, add freetype dependancy to gnome package.
2248 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2249 - add documentation to console for groupadd
2250 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2251 - add support for running daemons as root.bacula
2252 - correct for change in location of floppy rescue files in 1.35.2
2253 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
2254 - updated depgkgs to 30Jul04
2255 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2256 - really, really fix symlink creation for gconsole
2257 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2258 - fix symlink creation in gconsole post install
2259 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2260 - fixed error in gconsole post script
2261 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2262 - add check for gconsole symlink before trying to create it
2263 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2264 - fix some minor permissions issues on doc files that CVS won't let us fix
2265 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2266 - add pkgconfig to BuildRequires
2267 - clean up gnome1/2 menu entries for appropriate packages
2268 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2269 - tightened up doc distribution
2270 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2271 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
2272 - rpm's horrible bug that prevents nested conditional macros prevents me
2273 - from implementing these 2 separate approaches within the conditionals which
2274 - create the separate server packages.
2275 - the solution adopted is to remove the gnome-console files from the server packages
2276 - so bacula-gconsole is now an add on for both client and server packages.
2277 - this also now allows the server packages to be install on machines without
2278 - an X-server and we can still maintain a single spec file.
2279 - added tests to make sure we have defined platform and database macros.
2280 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2281 - corrected mysql prerequisites for suse
2282 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2283 - replaced all cp commands with cp -p
2284 - removed addition of a+x permissions on gnome-console
2285 - corrected permissions on init scripts
2286 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2287 - corrected creation of sqlite_bindir in install from !mysql to sqlite
2289 - various cleanup patches from Michael K. Johnson:
2290 - corrected post install routines for nicer chkconfig
2291 - removed chmod changes in post routines and moved to install section
2292 - removed interactive nature of post routine for rescue package
2293 - added description of building rescue disks to the description of rescue package
2294 - added clean of build root to beginning of install
2295 - removed specifying attr in all file lists
2296 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2297 - added bconsole to client package
2298 - added gconsole package as add-on to client
2299 - removed spurious dependancies on updatedb package (!cut/paste)
2300 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2301 - added updatedb package
2302 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2303 - added postgresql package
2304 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2305 - corrected the if else logic in the dependancy sections
2306 - changes for 1.34 release
2307 - /etc/bacula/console is now /etc/bacula/bconsole
2308 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
2309 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
2310 - /usr/sbin/smtp is now /usr/sbin/bsmtp
2311 - added new /etc/bacula/drop_mysql_database
2312 - added new /etc/bacula/drop_sqlite_database
2313 - added new /etc/bacula/grant_sqlite_privileges
2314 - added new generic bacula database scripts in /etc/bacula
2315 - added pre-install sections to check for database versions older than 6
2316 - added check for /etc/bacula/console.conf and copy to bconsole.conf
2317 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2318 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
2319 - added testing for existing databases before executing any of the database creation scripts
2320 - added defines working_dir and sqlite_bindir in place of hard coded paths
2321 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2322 - added build configuration for SuSE.
2323 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
2324 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2325 - added patch for create_sqlite_database to fix the installed bindir
2326 - added execute of create_sqlite_database to post of sqlite package
2327 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2328 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
2329 - added bacula-fd as Requires for rescue package
2330 - added build tag for Fedora Core 1
2331 - cleaned up dependancies for all builds
2332 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
2333 - removed rh_version from package names
2334 - added platform build configuration section to beginning of file
2335 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2336 - removed make_static_bacula script from rescue package install
2337 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2338 - Added define at top of file for depkgs version
2339 - Added rescue sub-package
2340 - Moved requires statements into proper sub-package locations
2341 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2342 - Corrected Requires for Gnome 1.4/2.0 builds
2343 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2344 - Added separate source declaration for depkgs
2345 - added patch for make_catalog_backup script
2346 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
2347 - Misc changes to mysql/sqlite build and rh7/8 menu differences
2348 - Added rh_version to sub-package names
2349 - Added installed but missing file /etc/bacula/gconsole
2350 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
2351 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
2352 - Update spec for version 1.31 and combine client
2353 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>