1 # Platform Build Configuration
3 # basic defines for every build
4 %define depkgs ../depkgs
5 %define depkgs_version 08Mar04
6 %define tomsrtbt tomsrtbt-2.0.103
7 %define sqlite_bindir /usr/lib/sqlite
8 %define working_dir /var/bacula
9 %define daemon_user root
10 %define daemon_group bacula
11 %define group_file /etc/group
12 %define groupadd /usr/sbin/groupadd
14 # platform defines - set one below or define the build_xxx on the command line
17 %{?build_rh7:%define rh7 1}
19 %{?build_rh8:%define rh8 1}
21 %{?build_rh9:%define rh9 1}
24 %{?build_fc1:%define fc1 1}
25 # Whitebox Enterprise build
26 # this should also work for RHEL
28 %{?build_wb3:%define wb3 1}
30 # this is known to build on SuSE 8.2 and 9.0
32 %{?build_su9:%define su9 1}
35 %{?build_mdk:%define mdk 1}
37 # test for a platform definition
38 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
39 %{error: You must specify a platform. Please examine the spec file.}
44 # set for database support desired or define the build_xxx on the command line
46 %{?build_mysql:%define mysql 1}
48 %{?build_sqlite:%define sqlite 1}
50 %{?build_postgresql:%define postgresql 1}
52 # test for a database definition
53 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
54 %{error: You must specify database support. Please examine the spec file.}
58 Summary: Bacula - The Network Backup Solution
62 Group: System Environment/Daemons
64 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
65 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
66 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
67 Source3: Release_Notes-%{version}-%{release}.tar.gz
68 BuildRoot: %{_tmppath}/%{name}-root
69 URL: http://www.bacula.org/
70 Vendor: The Bacula Team
71 Distribution: The Bacula Team
72 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
73 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
74 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
76 BuildRequires: libtermcap-devel
77 BuildRequires: gtk+-devel >= 1.2
78 BuildRequires: gnome-libs-devel >= 1.4
79 BuildRequires: glibc-devel >= 2.2
80 BuildRequires: ORBit-devel
81 BuildRequires: bonobo-devel
82 BuildRequires: GConf-devel
83 BuildRequires: freetype-devel
86 BuildRequires: termcap
87 BuildRequires: gtk2-devel >= 2.0
88 BuildRequires: libgnomeui-devel >= 2.0
89 BuildRequires: glibc-devel >= 2.3
90 BuildRequires: ORBit2-devel
91 BuildRequires: libart_lgpl-devel >= 2.0
92 BuildRequires: libbonobo-devel >= 2.0
93 BuildRequires: libbonoboui-devel >= 2.0
94 BuildRequires: bonobo-activation-devel
95 BuildRequires: gconf2-devel
96 BuildRequires: linc-devel
97 BuildRequires: freetype2-devel
100 BuildRequires: libtermcap-devel
101 BuildRequires: gtk2-devel >= 2.0
102 BuildRequires: libgnomeui2-devel >= 2.0
103 BuildRequires: glibc-devel >= 2.3
104 BuildRequires: libORBit2-devel
105 BuildRequires: libart_lgpl-devel >= 2.0
106 BuildRequires: libbonobo2_0-devel
107 BuildRequires: libbonoboui2_0-devel
108 BuildRequires: libbonobo-activation-devel
109 BuildRequires: libGConf2-devel
110 BuildRequires: libstdc++-static-devel
111 BuildRequires: glibc-static-devel
112 BuildRequires: freetype2-devel
114 %if ! %{rh7} && ! %{su9} && ! %{mdk}
115 BuildRequires: libtermcap-devel
116 BuildRequires: gtk2-devel >= 2.0
117 BuildRequires: libgnomeui-devel >= 2.0
118 BuildRequires: glibc-devel >= 2.3
119 BuildRequires: ORBit2-devel
120 BuildRequires: libart_lgpl-devel >= 2.0
121 BuildRequires: libbonobo-devel >= 2.0
122 BuildRequires: libbonoboui-devel >= 2.0
123 BuildRequires: bonobo-activation-devel
124 BuildRequires: GConf2-devel
125 BuildRequires: linc-devel
126 BuildRequires: freetype-devel
130 BuildRequires: mysql-devel >= 3.23
133 %if %{postgresql} && %{wb3}
134 BuildRequires: rh-postgresql-devel >= 7
137 %if %{postgresql} && ! %{wb3}
138 BuildRequires: postgresql-devel >= 7
142 Bacula - It comes by night and sucks the vital essence from your computers.
144 Bacula is a set of computer programs that permit you (or the system
145 administrator) to manage backup, recovery, and verification of computer
146 data across a network of computers of different kinds. In technical terms,
147 it is a network client/server based backup program. Bacula is relatively
148 easy to use and efficient, while offering many advanced storage management
149 features that make it easy to find and recover lost or damaged files.
150 Bacula source code has been released under the GPL version 2 license.
162 Summary: Bacula - The Network Backup Solution
163 Group: System Environment/Daemons
164 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
165 Conflicts: bacula-client
166 Requires: readline, ncurses, libstdc++, zlib
168 Conflicts: sqlite, sqlite-tools
171 Requires: glibc >= 2.2
175 Requires: glibc >= 2.3
178 %if ! %{rh7} && ! %{su9}
179 Requires: glibc >= 2.3
182 %if %{mysql} && ! %{su9} && ! %{mdk}
183 Requires: mysql >= 3.23
184 Requires: mysql-server >= 3.23
186 %if %{mysql} && %{su9}
187 Requires: mysql >= 3.23
188 Requires: mysql-client >= 3.23
190 %if %{mysql} && %{mdk}
191 Requires: mysql >= 3.23
192 Requires: mysql-client >= 3.23
194 %if %{postgresql} && %{wb3}
195 Requires: rh-postgresql >= 7
196 Requires: rh-postgresql-server >= 7
198 %if %{postgresql} && ! %{wb3}
199 Requires: postgresql >= 7
200 Requires: postgresql-server >= 7
210 %description postgresql
213 Bacula - It comes by night and sucks the vital essence from your computers.
215 Bacula is a set of computer programs that permit you (or the system
216 administrator) to manage backup, recovery, and verification of computer
217 data across a network of computers of different kinds. In technical terms,
218 it is a network client/server based backup program. Bacula is relatively
219 easy to use and efficient, while offering many advanced storage management
220 features that make it easy to find and recover lost or damaged files.
221 Bacula source code has been released under the GPL version 2 license.
224 This build requires MySQL to be installed separately as the catalog database.
227 This build requires PostgreSQL to be installed separately as the catalog database.
230 This build incorporates sqlite as the catalog database, statically compiled.
234 Summary: Bacula - The Network Backup Solution
235 Group: System Environment/Daemons
237 Requires: readline, libstdc++, zlib
240 Requires: glibc >= 2.2
244 Requires: glibc >= 2.3
247 %if ! %{rh7} && ! %{su9}
248 Requires: glibc >= 2.3
253 Bacula - It comes by night and sucks the vital essence from your computers.
255 Bacula is a set of computer programs that permit you (or the system
256 administrator) to manage backup, recovery, and verification of computer
257 data across a network of computers of different kinds. In technical terms,
258 it is a network client/server based backup program. Bacula is relatively
259 easy to use and efficient, while offering many advanced storage management
260 features that make it easy to find and recover lost or damaged files.
261 Bacula source code has been released under the GPL version 2 license.
263 This is the File daemon (Client) only package. It includes the command line
268 Summary: Bacula - The Network Backup Solution
269 Group: System Environment/Daemons
270 Requires: coreutils, util-linux, libc5, bacula-fd
273 Bacula - It comes by night and sucks the vital essence from your computers.
275 Bacula is a set of computer programs that permit you (or the system
276 administrator) to manage backup, recovery, and verification of computer
277 data across a network of computers of different kinds. In technical terms,
278 it is a network client/server based backup program. Bacula is relatively
279 easy to use and efficient, while offering many advanced storage management
280 features that make it easy to find and recover lost or damaged files.
281 Bacula source code has been released under the GPL version 2 license.
283 This package installs scripts for disaster recovery and builds rescue
284 floppy disks for bare metal recovery. This package includes tomsrtbt
285 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
286 to build a boot floppy disk.
288 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
289 bacula-client package for your platform installed and configured before
290 installing this package.
292 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
293 directory (this is done when the package is first installed),
294 then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
295 directory. To make the bacula rescue disk run
296 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
297 from the /etc/bacula/rescue directory. To recreate the rescue
298 information for this system run ./getdiskinfo again.
302 Summary: Bacula - The Network Backup Solution
303 Group: System Environment/Daemons
305 %description updatedb
306 Bacula - It comes by night and sucks the vital essence from your computers.
308 Bacula is a set of computer programs that permit you (or the system
309 administrator) to manage backup, recovery, and verification of computer
310 data across a network of computers of different kinds. In technical terms,
311 it is a network client/server based backup program. Bacula is relatively
312 easy to use and efficient, while offering many advanced storage management
313 features that make it easy to find and recover lost or damaged files.
314 Bacula source code has been released under the GPL version 2 license.
316 This package installs scripts for updating older versions of the bacula
320 Summary: Bacula - The Network Backup Solution
321 Group: System Environment/Daemons
322 Requires: readline, atk, libstdc++, zlib, pango, libxml2, bacula-fd
325 Requires: gtk+ >= 1.2
326 Requires: gnome-libs >= 1.4
327 Requires: glibc >= 2.2
334 Requires: gtk2 >= 2.0
335 Requires: libgnomeui >= 2.0
336 Requires: glibc >= 2.3
338 Requires: libart_lgpl >= 2.0
339 Requires: libbonobo >= 2.0
340 Requires: libbonoboui >= 2.0
341 Requires: bonobo-activation
347 Requires: gtk2 >= 2.0
348 Requires: libgnomeui2
349 Requires: glibc >= 2.3
351 Requires: libart_lgpl >= 2.0
352 Requires: libbonobo >= 2.0
353 Requires: libbonoboui >= 2.0
357 %if ! %{rh7} && ! %{su9} && ! %{mdk}
358 Requires: gtk2 >= 2.0
359 Requires: libgnomeui >= 2.0
360 Requires: glibc >= 2.3
362 Requires: libart_lgpl >= 2.0
363 Requires: libbonobo >= 2.0
364 Requires: libbonoboui >= 2.0
365 Requires: bonobo-activation
376 %description gconsole
377 Bacula - It comes by night and sucks the vital essence from your computers.
379 Bacula is a set of computer programs that permit you (or the system
380 administrator) to manage backup, recovery, and verification of computer
381 data across a network of computers of different kinds. In technical terms,
382 it is a network client/server based backup program. Bacula is relatively
383 easy to use and efficient, while offering many advanced storage management
384 features that make it easy to find and recover lost or damaged files.
385 Bacula source code has been released under the GPL version 2 license.
387 This is the Gnome Console package. It is an add-on to the client or
399 export LDFLAGS="-L/usr/lib/termcap"
410 # patches for the bundled sqlite scripts
412 # patch the make_sqlite_tables script for installation bindir
413 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
415 # patch the create_sqlite_database script for installation bindir
416 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
418 # patch the make_catalog_backup script for installation bindir
419 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
421 # patch the update_sqlite_tables script for installation bindir
422 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
426 --sbindir=/usr/sbin \
427 --sysconfdir=/etc/bacula \
428 --with-scriptdir=/etc/bacula \
429 --enable-smartalloc \
432 %if ! %{rh7} && ! %{rh8}
433 --enable-tray-monitor \
439 --with-sqlite=${cwd}/../depkgs/sqlite \
444 --with-working-dir=%{working_dir} \
445 --with-pid-dir=/var/run \
446 --with-subsys-dir=/var/lock/subsys \
447 --with-dir-user=%{daemon_user} \
448 --with-dir-group=%{daemon_group} \
449 --with-sd-user=%{daemon_user} \
450 --with-sd-group=%{daemon_group} \
451 --with-fd-user=%{daemon_user} \
452 --with-fd-group=%{daemon_group}
456 strip static-bacula-fd
462 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
463 mkdir -p $RPM_BUILD_ROOT/etc/init.d
464 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
465 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
467 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
469 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
471 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
472 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
473 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
475 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
476 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
477 mkdir -p $RPM_BUILD_ROOT/usr/bin
481 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
485 prefix=$RPM_BUILD_ROOT/usr \
486 sbindir=$RPM_BUILD_ROOT/usr/sbin \
487 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
488 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
489 working_dir=$RPM_BUILD_ROOT%{working_dir} \
494 prefix=$RPM_BUILD_ROOT/usr \
495 sbindir=$RPM_BUILD_ROOT/usr/sbin \
496 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
497 working_dir=$RPM_BUILD_ROOT%{working_dir} \
498 mandir=$RPM_BUILD_ROOT/usr/man \
502 # setup the manual for the doc dir and correct some broken CVS permissions
504 cp -p doc/html-manual/*.html html-manual/
505 cp -p doc/html-manual/*.jpg html-manual/
506 cp -p doc/html-manual/*.gif html-manual/
507 cp -p doc/html-manual/*.css html-manual/
508 chmod 644 html-manual/*
509 chmod 644 doc/bacula.pdf
511 # fixme - make installs the mysql scripts for sqlite build
513 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
514 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
515 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
518 # fixme - make installs the mysql scripts for postgresql build
520 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
521 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
524 # install the init scripts
526 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
527 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
528 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
531 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
532 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
533 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
535 %if ! %{su9} && ! %{mdk}
536 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
537 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
538 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
540 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
542 # install the menu stuff
544 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
545 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
546 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
547 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
550 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
551 cp -p scripts/bacula.desktop.gnome1.consolehelper $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
552 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
553 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
554 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
556 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
557 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
558 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
559 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
560 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
561 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
563 %if ! %{rh7} && ! %{rh8}
564 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
565 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
570 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
571 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
572 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
575 # install the logrotate file
576 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
578 # install the rescue stuff
579 # these are the rescue scripts
580 cp -p rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
581 cp -p rescue/linux/floppy/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
582 cp -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
583 cp -p rescue/linux/floppy/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
584 cp -p rescue/linux/floppy/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
585 cp -p rescue/linux/floppy/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
586 cp -p rescue/linux/floppy/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
587 cp -p rescue/linux/floppy/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
588 cp -p rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
590 # this is the static file daemon
591 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
593 # this is the tom's root boot disk
594 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
596 # install the updatedb scripts
597 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
599 # now clean up permissions that are left broken by the install
600 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
601 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
602 %if ! %{rh7} && ! %{rh8}
603 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
604 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
608 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
613 %defattr(-,root,root)
617 /etc/bacula/create_mysql_database
618 /etc/bacula/drop_mysql_database
619 /etc/bacula/make_mysql_tables
620 /etc/bacula/drop_mysql_tables
621 /etc/bacula/update_mysql_tables
622 /etc/bacula/grant_mysql_privileges
623 /etc/bacula/create_bacula_database
624 /etc/bacula/drop_bacula_database
625 /etc/bacula/grant_bacula_privileges
626 /etc/bacula/make_bacula_tables
627 /etc/bacula/drop_bacula_tables
628 /etc/bacula/update_bacula_tables
629 /etc/bacula/make_catalog_backup
630 /etc/bacula/delete_catalog_backup
631 /etc/bacula/startmysql
632 /etc/bacula/stopmysql
633 /etc/bacula/mtx-changer
634 /etc/bacula/btraceback.dbx
635 /etc/bacula/btraceback.gdb
636 /etc/init.d/bacula-dir
637 /etc/init.d/bacula-fd
638 /etc/init.d/bacula-sd
640 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
643 /etc/logrotate.d/bacula
645 %config(noreplace) /etc/bacula/bacula-dir.conf
646 %config(noreplace) /etc/bacula/bacula-fd.conf
647 %config(noreplace) /etc/bacula/bacula-sd.conf
648 %config(noreplace) /etc/bacula/bconsole.conf
649 /etc/bacula/query.sql
668 /usr/sbin/static-bacula-fd
671 # test for bacula database older than version 7
672 # note: this ASSUMES no password has been set for bacula database
673 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
675 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
676 echo "This bacula upgrade will update a bacula database from version 7 to 8."
677 echo "You appear to be running database version $DB_VER. You must first update"
678 echo "your database to version 7 and then install this upgrade. The alternative"
679 echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
680 echo "catalog information, then do the upgrade. Information on updating a"
681 echo "database older than version 7 can be found in the release notes."
684 # check for and copy /etc/bacula/console.conf to bconsole.conf
685 if [ -s /etc/bacula/console.conf ];then
686 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
692 if [ "$1" -ge 1 ] ; then
693 /sbin/chkconfig --add bacula-dir
694 /sbin/chkconfig --add bacula-fd
695 /sbin/chkconfig --add bacula-sd
698 # test for an existing database
699 # note: this ASSUMES no password has been set for bacula database
700 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
702 # grant privileges and create tables if they do not exist
703 if [ -z "$DB_VER" ]; then
704 echo "Hmm, doesn't look like you have an existing database."
705 echo "Granting privileges for MySQL user bacula..."
706 /etc/bacula/grant_mysql_privileges
707 echo "Creating MySQL bacula database..."
708 /etc/bacula/create_mysql_database
709 echo "Creating bacula tables..."
710 /etc/bacula/make_mysql_tables
712 # check to see if we need to upgrade a 1.34 or lower database
713 elif [ "$DB_VER" -lt "8" ]; then
714 echo "This release requires an upgrade to your bacula database."
715 echo "Backing up your current database..."
716 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
717 echo "Upgrading bacula database ..."
718 /etc/bacula/update_mysql_tables
719 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
723 # create the daemon group
724 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
725 if [ -z $HAVE_BACULA ]; then
726 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
727 echo "The group %{daemon_group} has been added to %{groupfile}."
728 echo "See the manual chapter Running Bacula for details."
734 /sbin/chkconfig --del bacula-dir
735 /sbin/chkconfig --del bacula-fd
736 /sbin/chkconfig --del bacula-sd
744 %defattr(-,root,root)
748 /etc/bacula/create_bacula_database
749 /etc/bacula/drop_bacula_database
750 /etc/bacula/grant_bacula_privileges
751 /etc/bacula/make_bacula_tables
752 /etc/bacula/drop_bacula_tables
753 /etc/bacula/update_bacula_tables
754 /etc/bacula/create_sqlite_database
755 /etc/bacula/drop_sqlite_database
756 /etc/bacula/grant_sqlite_privileges
757 /etc/bacula/make_sqlite_tables
758 /etc/bacula/drop_sqlite_tables
759 /etc/bacula/update_sqlite_tables
760 /etc/bacula/make_catalog_backup
761 /etc/bacula/delete_catalog_backup
762 /etc/bacula/mtx-changer
763 /etc/bacula/btraceback.dbx
764 /etc/bacula/btraceback.gdb
765 /etc/init.d/bacula-dir
766 /etc/init.d/bacula-fd
767 /etc/init.d/bacula-sd
769 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
772 /etc/logrotate.d/bacula
774 %config(noreplace) /etc/bacula/bacula-dir.conf
775 %config(noreplace) /etc/bacula/bacula-fd.conf
776 %config(noreplace) /etc/bacula/bacula-sd.conf
777 %config(noreplace) /etc/bacula/bconsole.conf
778 /etc/bacula/query.sql
779 %{sqlite_bindir}/libsqlite.a
780 %{sqlite_bindir}/sqlite.h
799 /usr/sbin/static-bacula-fd
800 %{sqlite_bindir}/sqlite
804 # test for bacula database older than version 7
805 if [ -s %{working_dir}/bacula.db ];then
806 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
807 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
808 echo "This bacula upgrade will update a bacula database from version 7 to 8."
809 echo "You appear to be running database version $DB_VER. You must first update"
810 echo "your database to version 7 and then install this upgrade. The alternative"
811 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
812 echo "catalog information, then do the upgrade. Information on updating a"
813 echo "database older than version 7 can be found in the release notes."
817 # check for and copy /etc/bacula/console.conf to bconsole.conf
818 if [ -s /etc/bacula/console.conf ];then
819 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
824 if [ "$1" -ge 1 ] ; then
825 /sbin/chkconfig --add bacula-dir
826 /sbin/chkconfig --add bacula-fd
827 /sbin/chkconfig --add bacula-sd
830 # test for an existing database
831 if [ -s %{working_dir}/bacula.db ]; then
832 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
833 # check to see if we need to upgrade a 1.34 or lower database
834 if [ "$DB_VER" -lt "8" ]; then
835 echo "This release requires an upgrade to your bacula database."
836 echo "Backing up your current database..."
837 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
838 echo "Upgrading bacula database ..."
839 /etc/bacula/update_sqlite_tables
840 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
843 # create the database and tables
844 echo "Hmm, doesn't look like you have an existing database."
845 echo "Creating SQLite database..."
846 /etc/bacula/create_sqlite_database
847 echo "Creating the SQLite tables..."
848 /etc/bacula/make_sqlite_tables
851 # create the daemon group
852 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
853 if [ -z $HAVE_BACULA ]; then
854 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
855 echo "The group %{daemon_group} has been added to %{groupfile}."
856 echo "See the manual chapter Running Bacula for details."
862 /sbin/chkconfig --del bacula-dir
863 /sbin/chkconfig --del bacula-fd
864 /sbin/chkconfig --del bacula-sd
872 %defattr(-,root,root)
876 /etc/bacula/create_postgresql_database
877 /etc/bacula/drop_postgresql_database
878 /etc/bacula/make_postgresql_tables
879 /etc/bacula/drop_postgresql_tables
880 /etc/bacula/update_postgresql_tables
881 /etc/bacula/grant_postgresql_privileges
882 /etc/bacula/create_bacula_database
883 /etc/bacula/drop_bacula_database
884 /etc/bacula/grant_bacula_privileges
885 /etc/bacula/make_bacula_tables
886 /etc/bacula/drop_bacula_tables
887 /etc/bacula/update_bacula_tables
888 /etc/bacula/make_catalog_backup
889 /etc/bacula/delete_catalog_backup
890 /etc/bacula/mtx-changer
891 /etc/bacula/btraceback.dbx
892 /etc/bacula/btraceback.gdb
893 /etc/init.d/bacula-dir
894 /etc/init.d/bacula-fd
895 /etc/init.d/bacula-sd
897 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
900 /etc/logrotate.d/bacula
902 %config(noreplace) /etc/bacula/bacula-dir.conf
903 %config(noreplace) /etc/bacula/bacula-fd.conf
904 %config(noreplace) /etc/bacula/bacula-sd.conf
905 %config(noreplace) /etc/bacula/bconsole.conf
906 /etc/bacula/query.sql
925 /usr/sbin/static-bacula-fd
928 # test for bacula database older than version 7
929 # note: this ASSUMES no password has been set for bacula database
930 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
932 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
933 echo "This bacula upgrade will update a bacula database from version 7 to 8."
934 echo "You appear to be running database version $DB_VER. You must first update"
935 echo "your database to version 7 and then install this upgrade. The alternative"
936 echo "is to use /etc/bacula/drop_postgresql_tables to delete all your your current"
937 echo "catalog information, then do the upgrade. Information on updating a"
938 echo "database older than version 7 can be found in the release notes."
944 if [ "$1" -ge 1 ] ; then
945 /sbin/chkconfig --add bacula-dir
946 /sbin/chkconfig --add bacula-fd
947 /sbin/chkconfig --add bacula-sd
950 # test for an existing database
951 # note: this ASSUMES no password has been set for bacula database
952 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
954 # grant privileges and create tables if they do not exist
955 if [ -z "$DB_VER" ]; then
956 echo "Hmm, doesn't look like you have an existing database."
957 echo "Granting privileges for PostgreSQL user bacula..."
958 /etc/bacula/grant_postgresql_privileges
959 echo "Creating PostgreSQL bacula database..."
960 /etc/bacula/create_postgresql_database
961 echo "Creating bacula tables..."
962 /etc/bacula/make_postgresql_tables
964 # check to see if we need to upgrade a 1.34 or lower database
965 elif [ "$DB_VER" -lt "8" ]; then
966 echo "This release requires an upgrade to your bacula database."
967 echo "Backing up your current database..."
968 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
969 echo "Upgrading bacula database ..."
970 /etc/bacula/update_postgresql_tables
971 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
975 # create the daemon group
976 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
977 if [ -z $HAVE_BACULA ]; then
978 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
979 echo "The group %{daemon_group} has been added to %{groupfile}."
980 echo "See the manual chapter Running Bacula for details."
987 /sbin/chkconfig --del bacula-dir
988 /sbin/chkconfig --del bacula-fd
989 /sbin/chkconfig --del bacula-sd
995 %defattr(-,root,root)
998 /etc/init.d/bacula-fd
1000 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
1001 /etc/logrotate.d/bacula
1003 %config(noreplace) /etc/bacula/bacula-fd.conf
1004 %config(noreplace) /etc/bacula/bconsole.conf
1008 /usr/sbin/btraceback
1009 /etc/bacula/btraceback.gdb
1010 /etc/bacula/btraceback.dbx
1017 if [ "$1" -ge 1 ] ; then
1018 /sbin/chkconfig --add bacula-fd
1021 # create the daemon group
1022 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
1023 if [ -z $HAVE_BACULA ]; then
1024 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1025 echo "The group %{daemon_group} has been added to %{groupfile}."
1026 echo "See the manual chapter Running Bacula for details."
1032 /sbin/chkconfig --del bacula-fd
1036 %defattr(-,root,root)
1037 /etc/bacula/rescue/backup.etc.list
1038 /etc/bacula/rescue/format_floppy
1039 /etc/bacula/rescue/getdiskinfo
1040 /etc/bacula/rescue/make_rescue_disk
1041 /etc/bacula/rescue/restore_bacula
1042 /etc/bacula/rescue/restore_etc
1043 /etc/bacula/rescue/run_grub
1044 /etc/bacula/rescue/run_lilo
1045 /etc/bacula/rescue/sfdisk.bz2
1046 /etc/bacula/rescue/bacula-fd
1047 /etc/bacula/rescue/tomsrtbt/*
1050 # link our current installed conf file to the rescue directory
1051 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
1054 echo "Creating rescue files for this system..."
1055 cd /etc/bacula/rescue
1059 # remove the files created after the initial rpm installation
1060 rm -f /etc/bacula/rescue/bacula-fd.conf
1061 rm -f /etc/bacula/rescue/partition.*
1062 rm -f /etc/bacula/rescue/format.*
1063 rm -f /etc/bacula/rescue/mount_drives
1064 rm -f /etc/bacula/rescue/start_network
1065 rm -f /etc/bacula/rescue/sfdisk
1066 rm -rf /etc/bacula/rescue/diskinfo/*
1069 %defattr(-,root,root)
1070 /etc/bacula/updatedb/*
1073 echo "The database update scripts were installed to /etc/bacula/updatedb"
1076 %defattr(-,root,root)
1077 /usr/sbin/gnome-console
1078 /etc/bacula/gconsole
1079 %config(noreplace) /etc/bacula/gnome-console.conf
1080 /usr/share/pixmaps/bacula.png
1083 /usr/share/gnome/apps/System/bacula.desktop
1085 /usr/share/applications/bacula.desktop
1088 %if ! %{rh7} && ! %{rh8}
1089 /usr/sbin/bacula-tray-monitor
1090 /etc/bacula/tray-monitor.conf
1091 /usr/share/pixmaps/bacula-tray-monitor.xpm
1092 /usr/share/applications/bacula-tray-monitor.desktop
1096 # add the console helper files
1097 %config(noreplace,missingok) /etc/pam.d/gnome-console
1098 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1099 /usr/bin/gnome-console
1104 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1105 - remove tray-monitor from RH8 build
1106 - fix permissions on tray-monitor files
1107 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1108 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1109 - change database update to 7 to 8 upgrade,
1110 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1111 - build in 30Jul04, add freetype dependancy to gnome package.
1112 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1113 - add documentation to console for groupadd
1114 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1115 - add support for running daemons as root.bacula
1116 - correct for change in location of floppy rescue files in 1.35.2
1117 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1118 - updated depgkgs to 30Jul04
1119 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1120 - really, really fix symlink creation for gconsole
1121 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1122 - fix symlink creation in gconsole post install
1123 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1124 - fixed error in gconsole post script
1125 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1126 - add check for gconsole symlink before trying to create it
1127 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1128 - fix some minor permissions issues on doc files that CVS won't let us fix
1129 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1130 - add pkgconfig to BuildRequires
1131 - clean up gnome1/2 menu entries for appropriate packages
1132 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1133 - tightened up doc distribution
1134 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1135 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1136 - rpm's horrible bug that prevents nested conditional macros prevents me
1137 - from implementing these 2 separate approaches within the conditionals which
1138 - create the separate server packages.
1139 - the solution adopted is to remove the gnome-console files from the server packages
1140 - so bacula-gconsole is now an add on for both client and server packages.
1141 - this also now allows the server packages to be install on machines without
1142 - an X-server and we can still maintain a single spec file.
1143 - added tests to make sure we have defined platform and database macros.
1144 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1145 - corrected mysql prerequisites for suse
1146 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1147 - replaced all cp commands with cp -p
1148 - removed addition of a+x permissions on gnome-console
1149 - corrected permissions on init scripts
1150 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1151 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1153 - various cleanup patches from Michael K. Johnson:
1154 - corrected post install routines for nicer chkconfig
1155 - removed chmod changes in post routines and moved to install section
1156 - removed interactive nature of post routine for rescue package
1157 - added description of building rescue disks to the description of rescue package
1158 - added clean of build root to beginning of install
1159 - removed specifying attr in all file lists
1160 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1161 - added bconsole to client package
1162 - added gconsole package as add-on to client
1163 - removed spurious dependancies on updatedb package (!cut/paste)
1164 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1165 - added updatedb package
1166 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1167 - added postgresql package
1168 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1169 - corrected the if else logic in the dependancy sections
1170 - changes for 1.34 release
1171 - /etc/bacula/console is now /etc/bacula/bconsole
1172 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1173 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1174 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1175 - added new /etc/bacula/drop_mysql_database
1176 - added new /etc/bacula/drop_sqlite_database
1177 - added new /etc/bacula/grant_sqlite_privileges
1178 - added new generic bacula database scripts in /etc/bacula
1179 - added pre-install sections to check for database versions older than 6
1180 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1181 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1182 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1183 - added testing for existing databases before executing any of the database creation scripts
1184 - added defines working_dir and sqlite_bindir in place of hard coded paths
1185 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1186 - added build configuration for SuSE.
1187 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1188 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1189 - added patch for create_sqlite_database to fix the installed bindir
1190 - added execute of create_sqlite_database to post of sqlite package
1191 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1192 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1193 - added bacula-fd as Requires for rescue package
1194 - added build tag for Fedora Core 1
1195 - cleaned up dependancies for all builds
1196 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1197 - removed rh_version from package names
1198 - added platform build configuration section to beginning of file
1199 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1200 - removed make_static_bacula script from rescue package install
1201 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1202 - Added define at top of file for depkgs version
1203 - Added rescue sub-package
1204 - Moved requires statements into proper sub-package locations
1205 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1206 - Corrected Requires for Gnome 1.4/2.0 builds
1207 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1208 - Added separate source declaration for depkgs
1209 - added patch for make_catalog_backup script
1210 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1211 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1212 - Added rh_version to sub-package names
1213 - Added installed but missing file /etc/bacula/gconsole
1214 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1215 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1216 - Update spec for version 1.31 and combine client
1217 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>