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 25Jun06
10 %define _rescuever 1.8.6
11 %define docs_version @VERSION@
13 # any patches for this release
14 # be sure to check the setup section for patch macros
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 #--------------------------------------------------------------------------
22 Summary: Bacula - The Network Backup Solution
26 Group: System Environment/Daemons
28 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
29 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
30 Source2: Release_Notes-%{version}-%{release}.tar.gz
31 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
32 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
33 BuildRoot: %{_tmppath}/%{name}-root
34 URL: http://www.bacula.org/
35 Vendor: The Bacula Team
36 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
38 # define the basic package description
39 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
40 %define blurb2 Bacula is a set of computer programs that permit you (or the system
41 %define blurb3 administrator) to manage backup, recovery, and verification of computer
42 %define blurb4 data across a network of computers of different kinds. In technical terms,
43 %define blurb5 it is a network client/server based backup program. Bacula is relatively
44 %define blurb6 easy to use and efficient, while offering many advanced storage management
45 %define blurb7 features that make it easy to find and recover lost or damaged files.
46 %define blurb8 Bacula source code has been released under the GPL version 2 license.
49 %define sqlite_bindir /usr/lib/bacula/sqlite
50 %define working_dir /var/bacula
51 %define _docsrc ../%{name}-docs-%{docs_version}
52 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
53 %define depkgs ../depkgs
55 # NOTE these defines are used in some rather complex useradd and groupadd
56 # commands. If you change them examine the post scripts for consequences.
57 %define director_daemon_user bacula
58 %define storage_daemon_user bacula
59 %define file_daemon_user root
60 %define daemon_group bacula
61 # group that has write access to tape devices, usually disk on Linux
62 %define storage_daemon_group disk
63 %define user_file /etc/passwd
64 %define group_file /etc/group
67 %define useradd /usr/sbin/useradd
68 %define groupadd /usr/sbin/groupadd
69 %define usermod /usr/sbin/usermod
71 # platform defines - set one below or define the build_xxx on the command line
74 %{?build_rh7:%define rh7 1}
76 %{?build_rh8:%define rh8 1}
78 %{?build_rh9:%define rh9 1}
81 %{?build_fc1:%define fc1 1}
83 %{?build_fc3:%define fc3 1}
85 %{?build_fc4:%define fc4 1}
87 %{?build_fc5:%define fc5 1}
88 # Whitebox Enterprise build
90 %{?build_wb3:%define wb3 1}
91 # RedHat Enterprise builds
93 %{?build_rhel3:%define rhel3 1}
94 %{?build_rhel3:%define wb3 1}
96 %{?build_rhel4:%define rhel4 1}
97 %{?build_rhel4:%define fc3 1}
100 %{?build_centos3:%define centos3 1}
101 %{?build_centos3:%define wb3 1}
103 %{?build_centos4:%define centos4 1}
104 %{?build_centos4:%define fc3 1}
107 %{?build_su9:%define su9 1}
109 %{?build_su10:%define su10 1}
112 %{?build_mdk:%define mdk 1}
114 %{?build_mdv:%define mdv 1}
115 %{?build_mdv:%define mdk 1}
117 # test for a platform definition
118 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
119 %{error: You must specify a platform. Please examine the spec file.}
124 # set for database support desired or define the build_xxx on the command line
126 %{?build_mysql:%define mysql 1}
127 # if using mysql 4.x define this and mysql above
128 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
130 %{?build_mysql4:%define mysql4 1}
131 %{?build_mysql4:%define mysql 1}
132 # if using mysql 5.x define this and mysql above
133 # currently: SuSE 10.1 and Fedora Core 5
135 %{?build_mysql5:%define mysql5 1}
136 %{?build_mysql5:%define mysql 1}
138 %{?build_sqlite:%define sqlite 1}
140 %{?build_postgresql:%define postgresql 1}
142 # test for a database definition
143 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
144 %{error: You must specify database support. Please examine the spec file.}
149 %define db_backend mysql
152 %define db_backend sqlite
155 %define db_backend postgresql
160 %{?build_x86_64:%define x86_64 1}
162 # check what distribution we are
163 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
164 %define _dist %(grep Red /etc/redhat-release)
166 %if %{fc1} || %{fc4} || %{fc5}
167 %define _dist %(grep Fedora /etc/redhat-release)
169 %if %{centos4} || %{centos3}
170 %define _dist %(grep CentOS /etc/redhat-release)
172 %if %{fc3} && ! %{rhel4} && ! %{centos4}
173 %define _dist %(grep Fedora /etc/redhat-release)
175 %if %{wb3} && ! %{rhel3} && ! %{centos3}
176 %define _dist %(grep White /etc/whitebox-release)
178 %if %{su9} || %{su10}
179 %define _dist %(grep -i SuSE /etc/SuSE-release)
182 %define _dist %(grep Mand /etc/mandrake-release)
184 Distribution: %{_dist}
186 # Should we build gconsole, possible only if gnome >= 2.0 available
192 # specifically disallow gconsole if desired
193 %{?nobuild_gconsole:%define gconsole 0}
195 # Should we build wxconsole, only wxWidgets >=2.6 is supported
196 # currently only SuSE 10 and FC4
198 %{?build_wxconsole:%define wxconsole 1}
200 # should we turn on python support
202 %{?build_python:%define python 1}
204 BuildRequires: gcc, gcc-c++, make, autoconf
205 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
206 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
207 BuildRequires: openssl-devel
209 BuildRequires: python, python-devel
210 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
213 BuildRequires: pkgconfig
216 BuildRequires: libtermcap-devel
217 BuildRequires: glibc-devel >= 2.2
220 BuildRequires: termcap
221 BuildRequires: glibc-devel >= 2.3
223 %if %{su9} && %{gconsole}
224 BuildRequires: libgnome >= 2.0
225 BuildRequires: gtk2-devel >= 2.0
226 BuildRequires: libgnomeui-devel >= 2.0
227 BuildRequires: ORBit2-devel
228 BuildRequires: libart_lgpl-devel >= 2.0
229 BuildRequires: libbonobo-devel >= 2.0
230 BuildRequires: libbonoboui-devel >= 2.0
231 BuildRequires: bonobo-activation-devel
232 BuildRequires: gconf2-devel
233 BuildRequires: linc-devel
234 BuildRequires: freetype2-devel
237 BuildRequires: termcap
238 BuildRequires: glibc-devel >= 2.3
240 %if %{su10} && %{gconsole}
241 BuildRequires: libgnome >= 2.12
242 BuildRequires: gtk2-devel >= 2.8
243 BuildRequires: libgnomeui-devel >= 2.12
244 BuildRequires: ORBit2-devel
245 BuildRequires: libart_lgpl-devel >= 2.3
246 BuildRequires: libbonobo-devel >= 2.10
247 BuildRequires: libbonoboui-devel >= 2.10
248 BuildRequires: bonobo-activation-devel
249 BuildRequires: gconf2-devel
250 BuildRequires: freetype2-devel
251 BuildRequires: cairo-devel
252 BuildRequires: fontconfig-devel >= 2.3
253 BuildRequires: gnome-vfs2-devel >= 2.12
254 BuildRequires: libpng-devel
257 BuildRequires: libtermcap-devel
258 BuildRequires: libstdc++-static-devel
259 BuildRequires: glibc-static-devel
260 BuildRequires: glibc-devel >= 2.3
262 %if %{mdk} && !%{mdv} && %{gconsole}
263 BuildRequires: gtk2-devel >= 2.0
264 BuildRequires: libgnomeui2-devel >= 2.0
265 BuildRequires: libORBit2-devel
266 BuildRequires: libart_lgpl-devel >= 2.0
267 BuildRequires: libbonobo2_0-devel
268 BuildRequires: libbonoboui2_0-devel
269 BuildRequires: libbonobo-activation-devel
270 BuildRequires: libGConf2-devel
271 BuildRequires: freetype2-devel
273 %if %{mdv} && %{gconsole}
274 BuildRequires: gtk2-devel >= 2.8
275 BuildRequires: libgnomeui2-devel >= 2.10
276 BuildRequires: libORBit2-devel
277 BuildRequires: libart_lgpl-devel >= 2.3
278 BuildRequires: libbonobo2_0-devel
279 BuildRequires: libbonoboui2_0-devel
280 BuildRequires: libbonobo-activation-devel
281 BuildRequires: libGConf2-devel
282 BuildRequires: freetype2-devel
285 BuildRequires: libtermcap-devel
286 BuildRequires: glibc-devel >= 2.3
288 %if %{fc3} && %{gconsole}
289 BuildRequires: gtk2-devel >= 2.4
290 BuildRequires: libgnomeui-devel >= 2.8
291 BuildRequires: ORBit2-devel
292 BuildRequires: libart_lgpl-devel >= 2.3
293 BuildRequires: libbonobo-devel >= 2.8
294 BuildRequires: libbonoboui-devel >= 2.8
295 BuildRequires: bonobo-activation-devel
296 BuildRequires: GConf2-devel
297 BuildRequires: freetype-devel
300 BuildRequires: libtermcap-devel
301 BuildRequires: glibc-devel >= 2.3
303 %if %{fc4} && %{gconsole}
304 BuildRequires: gtk2-devel >= 2.6
305 BuildRequires: libgnomeui-devel >= 2.10
306 BuildRequires: ORBit2-devel
307 BuildRequires: libart_lgpl-devel >= 2.3
308 BuildRequires: libbonobo-devel >= 2.8
309 BuildRequires: libbonoboui-devel >= 2.8
310 BuildRequires: bonobo-activation-devel
311 BuildRequires: GConf2-devel
312 BuildRequires: freetype-devel
315 BuildRequires: libtermcap-devel
316 BuildRequires: glibc-devel >= 2.4
318 %if %{fc5} && %{gconsole}
319 BuildRequires: gtk2-devel >= 2.8
320 BuildRequires: libgnomeui-devel >= 2.14
321 BuildRequires: ORBit2-devel
322 BuildRequires: libart_lgpl-devel >= 2.3
323 BuildRequires: libbonobo-devel >= 2.14
324 BuildRequires: libbonoboui-devel >= 2.14
325 BuildRequires: GConf2-devel
326 BuildRequires: freetype-devel
328 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
329 BuildRequires: libtermcap-devel
330 BuildRequires: glibc-devel >= 2.3
332 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
333 BuildRequires: gtk2-devel >= 2.0
334 BuildRequires: libgnomeui-devel >= 2.0
335 BuildRequires: ORBit2-devel
336 BuildRequires: libart_lgpl-devel >= 2.0
337 BuildRequires: libbonobo-devel >= 2.0
338 BuildRequires: libbonoboui-devel >= 2.0
339 BuildRequires: bonobo-activation-devel
340 BuildRequires: GConf2-devel
341 BuildRequires: linc-devel
342 BuildRequires: freetype-devel
345 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
346 BuildRequires: mysql-devel >= 3.23
349 %if %{mysql} && %{mysql4}
350 BuildRequires: mysql-devel >= 4.0
353 %if %{mysql} && %{mysql5}
354 BuildRequires: mysql-devel >= 5.0
357 %if %{postgresql} && %{wb3}
358 BuildRequires: rh-postgresql-devel >= 7
361 %if %{postgresql} && ! %{wb3}
362 BuildRequires: postgresql-devel >= 7
366 BuildRequires: wxGTK-devel >= 2.6
390 Summary: Bacula - The Network Backup Solution
391 Group: System Environment/Daemons
392 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
393 Conflicts: bacula-client
394 Obsoletes: bacula-rescue
395 Requires: ncurses, libstdc++, zlib, openssl, mtx
398 Requires: glibc >= 2.2
401 %if %{su9} || %{su10}
402 Requires: glibc >= 2.3
405 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
406 Requires: glibc >= 2.3
410 Requires: glibc >= 2.4
414 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
415 Requires: mysql >= 3.23
416 Requires: mysql-server >= 3.23
418 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
419 Requires: mysql >= 4.0
420 Requires: mysql-server >= 4.0
422 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
423 Requires: mysql >= 5.0
424 Requires: mysql-server >= 5.0
427 %if %{mysql} && %{su9} && ! %{mysql4}
428 Requires: mysql >= 3.23
429 Requires: mysql-client >= 3.23
431 %if %{mysql} && %{su9} && %{mysql4}
432 Requires: mysql >= 4.0
433 Requires: mysql-client >= 4.0
435 %if %{mysql} && %{su10} && %{mysql4}
436 Requires: mysql >= 4.0
437 Requires: mysql-client >= 4.0
439 %if %{mysql} && %{su10} && %{mysql5}
440 Requires: mysql >= 5.0
441 Requires: mysql-client >= 5.0
444 %if %{mysql} && %{mdk} && ! %{mysql4}
445 Requires: mysql >= 3.23
446 Requires: mysql-client >= 3.23
448 %if %{mysql} && %{mdk} && %{mysql4}
449 Requires: mysql >= 4.0
450 Requires: mysql-client >= 4.0
453 %if %{postgresql} && %{wb3}
454 Requires: rh-postgresql >= 7
455 Requires: rh-postgresql-server >= 7
457 %if %{postgresql} && ! %{wb3}
458 Requires: postgresql >= 7
459 Requires: postgresql-server >= 7
469 %description postgresql
473 Requires: python >= %{pyver}
487 This build requires MySQL to be installed separately as the catalog database.
490 This build requires PostgreSQL to be installed separately as the catalog database.
493 This build incorporates sqlite as the catalog database, statically compiled.
497 Summary: Bacula - The Network Backup Solution
498 Group: System Environment/Daemons
502 This is Bacula's version of mtx tape utilities for Linux distributions that
503 do not provide their own mtx package
506 Summary: Bacula - The Network Backup Solution
507 Group: System Environment/Daemons
509 Conflicts: bacula-mysql
510 Conflicts: bacula-sqlite
511 Conflicts: bacula-postgresql
512 Obsoletes: bacula-rescue
513 Requires: libstdc++, zlib, openssl
516 Requires: glibc >= 2.2
519 %if %{su9} || %{su10}
520 Requires: glibc >= 2.3
523 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
524 Requires: glibc >= 2.3
528 Requires: glibc >= 2.4
533 Requires: python >= %{pyver}
547 This is the File daemon (Client) only package. It includes the command line
552 Summary: Bacula - The Network Backup Solution
553 Group: System Environment/Daemons
555 %description updatedb
566 This package installs scripts for updating older versions of the bacula
571 Summary: Bacula - The Network Backup Solution
572 Group: System Environment/Daemons
573 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
576 %if %{gconsole} && %{su9}
577 Requires: gtk2 >= 2.0
578 Requires: libgnome >= 2.0
579 Requires: libgnomeui >= 2.0
580 Requires: glibc >= 2.3
582 Requires: libart_lgpl >= 2.0
583 Requires: libbonobo >= 2.0
584 Requires: libbonoboui >= 2.0
585 Requires: bonobo-activation
590 %if %{gconsole} && %{su10}
591 Requires: gtk2 >= 2.8
592 Requires: libgnome >= 2.12
593 Requires: libgnomeui >= 2.12
594 Requires: glibc >= 2.3
596 Requires: libart_lgpl >= 2.3
597 Requires: libbonobo >= 2.10
598 Requires: libbonoboui >= 2.10
599 Requires: bonobo-activation
603 Requires: fontconfig >= 2.3
604 Requires: gnome-vfs2 >= 2.12
607 %if %{gconsole} && %{mdk} && !%{mdv}
608 Requires: gtk2 >= 2.0
609 Requires: libgnomeui2
610 Requires: glibc >= 2.3
612 Requires: libart_lgpl >= 2.0
613 Requires: libbonobo >= 2.0
614 Requires: libbonoboui >= 2.0
618 %if %{gconsole} && %{mdv}
619 Requires: gtk2 >= 2.8
620 Requires: libgnomeui2
621 Requires: glibc >= 2.3
623 Requires: libart_lgpl >= 2.3
624 Requires: libbonobo >= 2.10
625 Requires: libbonoboui >= 2.10
629 %if %{gconsole} && %{fc3}
630 Requires: gtk2 >= 2.4
631 Requires: libgnomeui >= 2.8
632 Requires: glibc >= 2.3
634 Requires: libart_lgpl >= 2.3
635 Requires: libbonobo >= 2.8
636 Requires: libbonoboui >= 2.8
637 Requires: bonobo-activation
641 %if %{gconsole} && %{fc4}
642 Requires: gtk2 >= 2.6
643 Requires: libgnomeui >= 2.10
644 Requires: glibc >= 2.3
646 Requires: libart_lgpl >= 2.3
647 Requires: libbonobo >= 2.8
648 Requires: libbonoboui >= 2.8
649 Requires: bonobo-activation
653 %if %{gconsole} && %{fc5}
654 Requires: gtk2 >= 2.8
655 Requires: libgnomeui >= 2.14
656 Requires: glibc >= 2.4
658 Requires: libart_lgpl >= 2.3
659 Requires: libbonobo >= 2.14
660 Requires: libbonoboui >= 2.14
664 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
665 Requires: gtk2 >= 2.0
666 Requires: libgnomeui >= 2.0
667 Requires: glibc >= 2.3
669 Requires: libart_lgpl >= 2.0
670 Requires: libbonobo >= 2.0
671 Requires: libbonoboui >= 2.0
672 Requires: bonobo-activation
677 %if %{gconsole} && %{su9}
680 %if %{gconsole} && %{su10}
683 %if %{gconsole} && ! %{su9} && ! %{su10}
688 %description gconsole
699 This is the Gnome Console package. It is an add-on to the client or
705 Summary: Bacula - The Network Backup Solution
706 Group: System Environment/Daemons
707 Requires: wxGTK >= 2.6, libstdc++, openssl
710 %if %{wxconsole} && %{su10}
711 Requires: gtk2 >= 2.8
714 %if %{wxconsole} && %{fc3}
715 Requires: gtk2 >= 2.4
718 %if %{wxconsole} && %{fc4}
719 Requires: gtk2 >= 2.6
722 %if %{wxconsole} && %{fc5}
723 Requires: gtk2 >= 2.8
727 %description wxconsole
738 This is the WXWindows Console package. It is an add-on to the client or
752 %if %{su9} || %{su10}
753 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
764 # patches for the bundled sqlite scripts
765 # as of 1.38.0 first 3 patches no longer needed
767 # patch the make_sqlite_tables script for installation bindir
768 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
770 # patch the create_sqlite_database script for installation bindir
771 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
773 # patch the make_catalog_backup script for installation bindir
774 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
776 # patch the update_sqlite_tables script for installation bindir
777 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
779 # patch the bacula-dir init script to remove sqlite service
780 %if %{sqlite} && %{su9}
781 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
783 %if %{sqlite} && %{su10}
784 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
787 # 64 bit lib location hacks
789 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
791 %if %{mysql} && %{x86_64}
792 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
794 # this MAY be necessary for python support - waiting for feedback to enable
795 #%if %{python} && %{x86_64}
796 #export LDFLAGS="${LDFLAGS} -L/usr/lib64/python-%{pyver}"
801 --sbindir=/usr/sbin \
802 --sysconfdir=/etc/bacula \
803 --with-scriptdir=/etc/bacula \
804 --enable-smartalloc \
805 --enable-client-only \
815 --sbindir=/usr/sbin \
816 --sysconfdir=/etc/bacula \
817 --with-scriptdir=/etc/bacula \
818 --enable-smartalloc \
822 %if %{gconsole} && ! %{rh8}
823 --enable-tray-monitor \
829 --with-sqlite=${cwd}/%{depkgs}/sqlite \
835 --enable-wx-console \
840 --with-working-dir=%{working_dir} \
841 --with-pid-dir=/var/run \
842 --with-subsys-dir=/var/lock/subsys \
843 --with-dir-user=%{director_daemon_user} \
844 --with-dir-group=%{daemon_group} \
845 --with-sd-user=%{storage_daemon_user} \
846 --with-sd-group=%{storage_daemon_group} \
847 --with-fd-user=%{file_daemon_user} \
848 --with-fd-group=%{daemon_group} \
849 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
850 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
851 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
852 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
853 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
854 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
862 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
863 mkdir -p $RPM_BUILD_ROOT/etc/init.d
864 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
865 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
866 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
867 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
868 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
870 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
872 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
873 %if %{gconsole} && ! %{su9} && ! %{su10}
874 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
875 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
876 mkdir -p $RPM_BUILD_ROOT/usr/bin
880 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
884 prefix=$RPM_BUILD_ROOT/usr \
885 sbindir=$RPM_BUILD_ROOT/usr/sbin \
886 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
887 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
888 working_dir=$RPM_BUILD_ROOT%{working_dir} \
893 prefix=$RPM_BUILD_ROOT/usr \
894 sbindir=$RPM_BUILD_ROOT/usr/sbin \
895 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
896 working_dir=$RPM_BUILD_ROOT%{working_dir} \
897 mandir=$RPM_BUILD_ROOT/usr/man \
901 # fixme - make installs the mysql scripts for sqlite build
903 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
904 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
905 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
908 # fixme - make installs the mysql scripts for postgresql build
910 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
911 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
914 # fixme - make installs gconsole script for build without gconsole
916 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
919 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
921 # install the init scripts
922 %if %{su9} || %{su10}
923 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
924 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
925 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
928 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
929 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
930 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
932 %if ! %{su9} && ! %{su10} && ! %{mdk}
933 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
934 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
935 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
937 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
939 # install the menu stuff
940 %if %{gconsole} && %{su9}
941 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
942 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
943 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
944 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
946 %if %{gconsole} && %{su10}
947 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
948 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
949 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
950 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
952 %if %{wxconsole} && %{su10}
953 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
954 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
956 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
961 %if %{gconsole} && %{iftrick}
962 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
963 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
964 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
965 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
966 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
968 %if %{gconsole} && ! %{rh8}
969 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
970 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
972 %if %{wxconsole} && %{iftrick}
973 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
974 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
975 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
976 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
977 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
982 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
983 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
984 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
987 # install the logrotate file
988 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
990 # install the updatedb scripts
991 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
993 # install the logwatch scripts
994 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
995 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
996 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
997 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
998 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
999 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1001 # install the rescue files
1002 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
1003 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
1004 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
1005 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
1006 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
1007 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
1008 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
1009 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
1010 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
1011 rm -f src/filed/static-bacula-fd
1014 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
1015 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
1018 # now clean up permissions that are left broken by the install
1019 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
1020 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
1021 %if %{gconsole} && ! %{rh8}
1022 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
1023 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
1027 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1030 # MySQL specific files
1032 %defattr(-, root, root)
1033 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
1034 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
1035 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
1036 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
1037 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1038 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1039 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1040 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1045 %defattr(-,root,root)
1046 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1047 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1048 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1049 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1050 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1051 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1052 %{sqlite_bindir}/libsqlite.a
1053 %{sqlite_bindir}/sqlite.h
1054 %{sqlite_bindir}/sqlite
1059 %defattr(-,root,root)
1060 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1061 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1062 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1063 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1064 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1065 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1068 # The rest is DB backend independent
1069 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1070 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1071 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1072 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1073 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1074 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1075 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1076 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1077 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1078 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1079 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1080 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1081 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1082 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1083 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1084 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1085 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1086 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1087 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1088 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1089 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1090 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1091 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1093 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1094 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1096 /etc/logrotate.d/bacula
1097 /etc/log.d/scripts/services/bacula
1098 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1099 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1100 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1101 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1102 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1103 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1104 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1105 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1107 /usr/sbin/bacula-dir
1115 /usr/sbin/btraceback
1124 # test for bacula database older than version 8
1125 # note: this ASSUMES no password has been set for bacula database
1126 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1131 # test for bacula database older than version 8
1132 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1133 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1138 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1141 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1142 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1143 echo "You appear to be running database version $DB_VER. You must first update"
1144 echo "your database to version 8 and then install this upgrade. The alternative"
1145 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1146 echo "catalog information, then do the upgrade. Information on updating a"
1147 echo "database older than version 8 can be found in the release notes."
1155 # check for and copy /etc/bacula/console.conf to bconsole.conf
1156 if [ -s /etc/bacula/console.conf ];then
1157 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1160 # create the daemon users and groups
1161 # first create the groups if they don't exist
1162 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1163 if [ -z "$HAVE_BACULA" ]; then
1164 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1165 echo "The group %{daemon_group} has been added to %{group_file}."
1166 echo "See the manual chapter \"Running Bacula\" for details."
1168 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1169 if [ -z "$HAVE_BACULA" ]; then
1170 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1171 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1172 echo "See the manual chapter \"Running Bacula\" for details."
1174 # now create the users if they do not exist
1175 # we do not use the -g option allowing the primary group to be set to system default
1176 # this will be a unique group on redhat type systems or the group users on some systems
1177 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1178 if [ -z "$HAVE_BACULA" ]; then
1179 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1180 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1181 echo "See the manual chapter \"Running Bacula\" for details."
1183 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1184 if [ -z "$HAVE_BACULA" ]; then
1185 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1186 echo "The user %{director_daemon_user} has been added to %{user_file}."
1187 echo "See the manual chapter \"Running Bacula\" for details."
1189 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1190 if [ -z "$HAVE_BACULA" ]; then
1191 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1192 echo "The user %{file_daemon_user} has been added to %{user_file}."
1193 echo "See the manual chapter \"Running Bacula\" for details."
1195 # now we add the supplementary groups, this is ok to call even if the users already exist
1196 # we only do this if the user is NOT root
1197 IS_ROOT=%{director_daemon_user}
1198 if [ "$IS_ROOT" != "root" ]; then
1199 %{usermod} -G %{daemon_group} %{director_daemon_user}
1201 IS_ROOT=%{storage_daemon_user}
1202 if [ "$IS_ROOT" != "root" ]; then
1203 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1205 IS_ROOT=%{file_daemon_user}
1206 if [ "$IS_ROOT" != "root" ]; then
1207 %{usermod} -G %{daemon_group} %{file_daemon_user}
1221 if [ "$1" -ge 1 ] ; then
1222 /sbin/chkconfig --add bacula-dir
1223 /sbin/chkconfig --add bacula-fd
1224 /sbin/chkconfig --add bacula-sd
1228 # test for an existing database
1229 # note: this ASSUMES no password has been set for bacula database
1230 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1232 # grant privileges and create tables if they do not exist
1233 if [ -z "$DB_VER" ]; then
1234 echo "Hmm, doesn't look like you have an existing database."
1235 echo "Granting privileges for MySQL user bacula..."
1236 /etc/bacula/grant_mysql_privileges
1237 echo "Creating MySQL bacula database..."
1238 /etc/bacula/create_mysql_database
1239 echo "Creating bacula tables..."
1240 /etc/bacula/make_mysql_tables
1242 # check to see if we need to upgrade a 1.36 or lower database
1243 elif [ "$DB_VER" -lt "9" ]; then
1244 echo "This release requires an upgrade to your bacula database."
1245 echo "Backing up your current database..."
1246 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1247 echo "Upgrading bacula database ..."
1248 /etc/bacula/update_mysql_tables
1249 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1255 # test for an existing database
1256 if [ -s %{working_dir}/bacula.db ]; then
1257 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1258 # check to see if we need to upgrade a 1.36 or lower database
1259 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1260 echo "This release requires an upgrade to your bacula database."
1261 echo "Backing up your current database..."
1262 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1263 echo "Upgrading bacula database ..."
1264 /etc/bacula/update_sqlite_tables
1265 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1268 # create the database and tables
1269 echo "Hmm, doesn't look like you have an existing database."
1270 echo "Creating SQLite database..."
1271 /etc/bacula/create_sqlite_database
1272 echo "Creating the SQLite tables..."
1273 /etc/bacula/make_sqlite_tables
1278 # test for an existing database
1279 # note: this ASSUMES no password has been set for bacula database
1280 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1282 # grant privileges and create tables if they do not exist
1283 if [ -z "$DB_VER" ]; then
1284 echo "Hmm, doesn't look like you have an existing database."
1285 echo "Creating PostgreSQL bacula database..."
1286 /etc/bacula/create_postgresql_database
1287 echo "Creating bacula tables..."
1288 /etc/bacula/make_postgresql_tables
1289 echo "Granting privileges for PostgreSQL user bacula..."
1290 /etc/bacula/grant_postgresql_privileges
1292 # check to see if we need to upgrade a 1.36 or lower database
1293 elif [ "$DB_VER" -lt "9" ]; then
1294 echo "This release requires an upgrade to your bacula database."
1295 echo "Backing up your current database..."
1296 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1297 echo "Upgrading bacula database ..."
1298 /etc/bacula/update_postgresql_tables
1299 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1304 # generate passwords if needed
1305 if [ -d /etc/bacula ]; then
1307 for file in *.conf; do
1308 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
1309 need_password=`grep $string $file 2>/dev/null`
1310 if [ -n "$need_password" ]; then
1311 pass=`openssl rand -base64 33`
1312 sed "s-$string-$pass-g" $file > $file.new
1313 cp -f $file.new $file; rm -f $file.new
1331 /sbin/chkconfig --del bacula-dir
1332 /sbin/chkconfig --del bacula-fd
1333 /sbin/chkconfig --del bacula-sd
1338 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1339 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1340 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1341 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1346 %defattr(-,root,root)
1347 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1348 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1349 /etc/init.d/bacula-fd
1350 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1352 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1353 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1355 /etc/logrotate.d/bacula
1357 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1358 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1359 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1362 /usr/sbin/btraceback
1363 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1364 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1370 # create the daemon group and user
1371 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1372 if [ -z "$HAVE_BACULA" ]; then
1373 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1374 echo "The group %{daemon_group} has been added to %{group_file}."
1375 echo "See the manual chapter \"Running Bacula\" for details."
1377 # we do not use the -g option allowing the primary group to be set to system default
1378 # this will be a unique group on redhat type systems or the group users on some systems
1379 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1380 if [ -z "$HAVE_BACULA" ]; then
1381 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1382 echo "The user %{file_daemon_user} has been added to %{user_file}."
1383 echo "See the manual chapter \"Running Bacula\" for details."
1385 # now we add the supplementary group, this is ok to call even if the user already exists
1386 # we only do this if the user is NOT root
1387 IS_ROOT=%{file_daemon_user}
1388 if [ "$IS_ROOT" != "root" ]; then
1389 %{usermod} -G %{daemon_group} %{file_daemon_user}
1394 if [ "$1" -ge 1 ] ; then
1395 /sbin/chkconfig --add bacula-fd
1398 # generate passwords if needed
1399 if [ -d /etc/bacula ]; then
1401 for file in *.conf; do
1402 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
1403 need_password=`grep $string $file 2>/dev/null`
1404 if [ -n "$need_password" ]; then
1405 pass=`openssl rand -base64 33`
1406 sed "s-$string-$pass-g" $file > $file.new
1407 cp -f $file.new $file; rm -f $file.new
1416 /sbin/chkconfig --del bacula-fd
1420 %defattr(-,root,%{daemon_group})
1421 /etc/bacula/updatedb/*
1424 # create the daemon group
1425 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1426 if [ -z "$HAVE_BACULA" ]; then
1427 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1428 echo "The group %{daemon_group} has been added to %{group_file}."
1429 echo "See the manual chapter \"Running Bacula\" for details."
1433 echo "The database update scripts were installed to /etc/bacula/updatedb"
1437 %defattr(-,root,root)
1438 /usr/sbin/gnome-console
1439 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1440 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1441 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1442 /usr/share/pixmaps/bacula.png
1443 /usr/share/applications/bacula.desktop
1446 %if %{gconsole} && ! %{rh8}
1447 /usr/sbin/bacula-tray-monitor
1448 %config(noreplace) /etc/bacula/tray-monitor.conf
1449 /usr/share/pixmaps/bacula-tray-monitor.xpm
1450 /usr/share/applications/bacula-tray-monitor.desktop
1453 %if %{gconsole} && ! %{su9} && ! %{su10}
1454 # add the console helper files
1455 %config(noreplace,missingok) /etc/pam.d/gnome-console
1456 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1457 /usr/bin/gnome-console
1462 # create the daemon group
1463 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1464 if [ -z "$HAVE_BACULA" ]; then
1465 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1466 echo "The group %{daemon_group} has been added to %{group_file}."
1467 echo "See the manual chapter \"Running Bacula\" for details."
1471 # generate passwords if needed
1472 if [ -d /etc/bacula ]; then
1474 for file in *.conf; do
1475 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
1476 need_password=`grep $string $file 2>/dev/null`
1477 if [ -n "$need_password" ]; then
1478 pass=`openssl rand -base64 33`
1479 sed "s-$string-$pass-g" $file > $file.new
1480 cp -f $file.new $file; rm -f $file.new
1489 %defattr(-,root,root)
1491 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1492 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1493 /usr/share/pixmaps/wxwin16x16.xpm
1494 /usr/share/applications/wxconsole.desktop
1497 %if %{wxconsole} && ! %{su9} && ! %{su10}
1498 # add the console helper files
1499 %config(noreplace,missingok) /etc/pam.d/wxconsole
1500 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1506 # create the daemon group
1507 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1508 if [ -z "$HAVE_BACULA" ]; then
1509 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1510 echo "The group %{daemon_group} has been added to %{group_file}."
1511 echo "See the manual chapter \"Running Bacula\" for details."
1515 # generate passwords if needed
1516 if [ -d /etc/bacula ]; then
1518 for file in *.conf; do
1519 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
1520 need_password=`grep $string $file 2>/dev/null`
1521 if [ -n "$need_password" ]; then
1522 pass=`openssl rand -base64 33`
1523 sed "s-$string-$pass-g" $file > $file.new
1524 cp -f $file.new $file; rm -f $file.new
1532 * Mon Jul 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - add python build support
1534 - fix LDFLAGS declarations
1535 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1536 - add requires for standard compiler toolchain
1537 - move version and release tags up
1539 - add docs_version tag
1540 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1541 - update rescuever to 1.8.6
1542 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - update depkgs to 25Jun06
1544 - add mysql5 build tag
1545 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - 1.38.10 bump rescue version
1547 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - fix usermod statements
1550 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 - add -g param back to useradd statements Bug 605
1552 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1553 - redundant code cleanup
1554 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1555 - add wxconsole package
1556 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1558 - dependency update for Mandriva
1559 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1561 - remove -n option from useradd scripts
1562 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1564 - fix problem specifying more than one primary group for user bacula
1565 - add build switch to not build gconsole regardless of platform
1566 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1567 - add centos3 build tag
1568 - fix link error of static-fd on Mandrake with --disable-nls
1569 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1570 - add fc4 dependencies
1571 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1572 - add SuSE 10.0 build
1573 - remove specific permission in attrib macros
1574 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1576 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1577 - refix compat for _dist on SLES9 which seems to have been removed
1578 - added note regarding Aleksandar's use of specific permissions in attrib macros
1579 - need to review and add specific fc4 build currently using fc3 Requires
1580 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1582 - Reorganize files and pre/post sections to remove repetitions
1583 - Always build separate mtx package
1584 - Fix file ownerships for /etc/bacula and Bacula's working dir
1585 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1586 - Disable GNOME on RH7
1587 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1588 - Red Hat and look alikes have mtx RPM, do not build/package our version
1589 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1590 - minor edit to _dist for SLES9 compatibility
1591 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1593 - kern changed location of pdf files and html manual in docs package
1594 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1596 - add docs (from prebuilt tarball) and rescue packages back in
1597 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1598 - remove 3 of 4 sqlite script patches as not needed
1599 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1601 - remove docs and rescue sections (remove static fd)
1602 - add dvd-freespace and dvd-writepart files
1603 - update depkgs to 22Jun05
1604 - change database update to 8 to 9
1605 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1606 - minor cleanups before 1.38 changes
1607 - add popt and popt-devel build dependencies
1608 - add tetex and tetex-dvips dependencies for doc build
1609 - replace deprecated Copyright tag with License
1610 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1611 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1612 - conflict with sqlite packages. remove readline dependency.
1613 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1614 - release 1.36.3 update docs
1615 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1616 - add centos4 build tag
1617 - add x86_64 build tag
1618 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1619 - add rhel4 build tag
1620 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1621 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1622 - add rhel3 build tag
1623 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1624 - fix tray-monitor.conf for noreplace
1625 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1626 - fix distribution check for Fedora and Whitebox
1627 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1628 - add logwatch script
1630 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1631 - add build for Fedora Core 3 (linc now included in ORDit2)
1632 - add mysql4 define for Mandrake 10.1
1633 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1634 - fix {group_file} variable in post scripts
1635 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1636 - add distribution checking and custom Distribution tag
1637 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1638 - ASSIGNMENT OF COPYRIGHT
1639 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1640 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1641 - all right, title and interest in and to the copyright in this software RPM
1642 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1643 - free of all liens, encumbrances or any known claims against said copyright.
1644 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1646 - thanks to Daniel Widyono
1647 - update description for rescue package to describe cdrom creation
1648 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1649 - update depkgs to 29Oct04
1650 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1651 - add cdrom rescue to bacula-rescue package
1652 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1653 - misc fixes from 1.36.0 suse feedback
1654 - fix situation where sqlite database exists but sqlite has been removed.
1655 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1656 - remove tray-monitor from RH8 build
1657 - fix permissions on tray-monitor files
1658 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1659 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1660 - change database update to 7 to 8 upgrade,
1661 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1662 - build in 30Jul04, add freetype dependancy to gnome package.
1663 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1664 - add documentation to console for groupadd
1665 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1666 - add support for running daemons as root.bacula
1667 - correct for change in location of floppy rescue files in 1.35.2
1668 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1669 - updated depgkgs to 30Jul04
1670 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1671 - really, really fix symlink creation for gconsole
1672 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1673 - fix symlink creation in gconsole post install
1674 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1675 - fixed error in gconsole post script
1676 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1677 - add check for gconsole symlink before trying to create it
1678 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1679 - fix some minor permissions issues on doc files that CVS won't let us fix
1680 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1681 - add pkgconfig to BuildRequires
1682 - clean up gnome1/2 menu entries for appropriate packages
1683 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1684 - tightened up doc distribution
1685 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1686 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1687 - rpm's horrible bug that prevents nested conditional macros prevents me
1688 - from implementing these 2 separate approaches within the conditionals which
1689 - create the separate server packages.
1690 - the solution adopted is to remove the gnome-console files from the server packages
1691 - so bacula-gconsole is now an add on for both client and server packages.
1692 - this also now allows the server packages to be install on machines without
1693 - an X-server and we can still maintain a single spec file.
1694 - added tests to make sure we have defined platform and database macros.
1695 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1696 - corrected mysql prerequisites for suse
1697 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1698 - replaced all cp commands with cp -p
1699 - removed addition of a+x permissions on gnome-console
1700 - corrected permissions on init scripts
1701 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1702 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1704 - various cleanup patches from Michael K. Johnson:
1705 - corrected post install routines for nicer chkconfig
1706 - removed chmod changes in post routines and moved to install section
1707 - removed interactive nature of post routine for rescue package
1708 - added description of building rescue disks to the description of rescue package
1709 - added clean of build root to beginning of install
1710 - removed specifying attr in all file lists
1711 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1712 - added bconsole to client package
1713 - added gconsole package as add-on to client
1714 - removed spurious dependancies on updatedb package (!cut/paste)
1715 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1716 - added updatedb package
1717 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1718 - added postgresql package
1719 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1720 - corrected the if else logic in the dependancy sections
1721 - changes for 1.34 release
1722 - /etc/bacula/console is now /etc/bacula/bconsole
1723 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1724 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1725 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1726 - added new /etc/bacula/drop_mysql_database
1727 - added new /etc/bacula/drop_sqlite_database
1728 - added new /etc/bacula/grant_sqlite_privileges
1729 - added new generic bacula database scripts in /etc/bacula
1730 - added pre-install sections to check for database versions older than 6
1731 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1732 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1733 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1734 - added testing for existing databases before executing any of the database creation scripts
1735 - added defines working_dir and sqlite_bindir in place of hard coded paths
1736 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1737 - added build configuration for SuSE.
1738 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1739 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1740 - added patch for create_sqlite_database to fix the installed bindir
1741 - added execute of create_sqlite_database to post of sqlite package
1742 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1743 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1744 - added bacula-fd as Requires for rescue package
1745 - added build tag for Fedora Core 1
1746 - cleaned up dependancies for all builds
1747 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1748 - removed rh_version from package names
1749 - added platform build configuration section to beginning of file
1750 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1751 - removed make_static_bacula script from rescue package install
1752 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1753 - Added define at top of file for depkgs version
1754 - Added rescue sub-package
1755 - Moved requires statements into proper sub-package locations
1756 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1757 - Corrected Requires for Gnome 1.4/2.0 builds
1758 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1759 - Added separate source declaration for depkgs
1760 - added patch for make_catalog_backup script
1761 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1762 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1763 - Added rh_version to sub-package names
1764 - Added installed but missing file /etc/bacula/gconsole
1765 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1766 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1767 - Update spec for version 1.31 and combine client
1768 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>