1 # Platform Build Configuration
3 # basic defines for every build
4 %define depkgs ../depkgs
5 %define depkgs_version 24Jul03
6 %define tomsrtbt tomsrtbt-2.0.103
7 %define sqlite_bindir /usr/lib/sqlite
8 %define working_dir /var/bacula
10 # platform defines - set one below or define the build_xxx on the command line
13 %{?build_rh7:%define rh7 1}
15 %{?build_rh8:%define rh8 1}
17 %{?build_rh9:%define rh9 1}
20 %{?build_fc1:%define fc1 1}
21 # Whitebox Enterprise build
22 # this should also work for RHEL
24 %{?build_wb3:%define wb3 1}
26 # this is known to build on SuSE 8.2 and 9.0
28 %{?build_su9:%define su9 1}
30 # test for a platform definition
31 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9}
32 %{error: You must specify a platform. Please examine the spec file.}
37 # set for database support desired or define the build_xxx on the command line
39 %{?build_mysql:%define mysql 1}
41 %{?build_sqlite:%define sqlite 1}
43 %{?build_postgresql:%define postgresql 1}
45 # test for a database definition
46 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
47 %{error: You must specify database support. Please examine the spec file.}
51 Summary: Bacula - The Network Backup Solution
55 Group: System Environment/Daemons
57 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
58 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
59 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
60 BuildRoot: %{_tmppath}/%{name}-root
61 URL: http://www.bacula.org/
62 Vendor: The Bacula Team
63 Distribution: The Bacula Team
64 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
65 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
66 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
68 BuildRequires: libtermcap-devel
69 BuildRequires: gtk+-devel >= 1.2
70 BuildRequires: gnome-libs-devel >= 1.4
71 BuildRequires: glibc-devel >= 2.2
72 BuildRequires: ORBit-devel
73 BuildRequires: bonobo-devel
74 BuildRequires: GConf-devel
77 BuildRequires: termcap
78 BuildRequires: gtk2-devel >= 2.0
79 BuildRequires: libgnomeui-devel >= 2.0
80 BuildRequires: glibc-devel >= 2.3
81 BuildRequires: ORBit2-devel
82 BuildRequires: libart_lgpl-devel >= 2.0
83 BuildRequires: libbonobo-devel >= 2.0
84 BuildRequires: libbonoboui-devel >= 2.0
85 BuildRequires: bonobo-activation-devel
86 BuildRequires: gconf2-devel
87 BuildRequires: linc-devel
89 %if ! %{rh7} && ! %{su9}
90 BuildRequires: libtermcap-devel
91 BuildRequires: gtk2-devel >= 2.0
92 BuildRequires: libgnomeui-devel >= 2.0
93 BuildRequires: glibc-devel >= 2.3
94 BuildRequires: ORBit2-devel
95 BuildRequires: libart_lgpl-devel >= 2.0
96 BuildRequires: libbonobo-devel >= 2.0
97 BuildRequires: libbonoboui-devel >= 2.0
98 BuildRequires: bonobo-activation-devel
99 BuildRequires: GConf2-devel
100 BuildRequires: linc-devel
104 BuildRequires: mysql-devel >= 3.23
107 %if %{postgresql} && %{wb3}
108 BuildRequires: rh-postgresql-devel >= 7
111 %if %{postgresql} && ! %{wb3}
112 BuildRequires: postgresql-devel >= 7
116 Bacula - It comes by night and sucks the vital essence from your computers.
118 Bacula is a set of computer programs that permit you (or the system
119 administrator) to manage backup, recovery, and verification of computer
120 data across a network of computers of different kinds. In technical terms,
121 it is a network client/server based backup program. Bacula is relatively
122 easy to use and efficient, while offering many advanced storage management
123 features that make it easy to find and recover lost or damaged files.
124 Bacula source code has been released under the GPL version 2 license.
136 Summary: Bacula - The Network Backup Solution
137 Group: System Environment/Daemons
138 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
139 Conflicts: bacula-client
140 Requires: readline, perl, ncurses, libstdc++, zlib
142 Requires: glibc >= 2.2
146 Requires: glibc >= 2.3
149 %if ! %{rh7} && ! %{su9}
150 Requires: glibc >= 2.3
153 %if %{mysql} && ! %{su9}
154 Requires: mysql >= 3.23
155 Requires: mysql-server >= 3.23
157 %if %{mysql} && %{su9}
158 Requires: mysql >= 3.23
159 Requires: mysql-client >= 3.23
161 %if %{postgresql} && %{wb3}
162 Requires: rh-postgresql >= 7
163 Requires: rh-postgresql-server >= 7
165 %if %{postgresql} && ! %{wb3}
166 Requires: postgresql >= 7
167 Requires: postgresql-server >= 7
177 %description postgresql
180 Bacula - It comes by night and sucks the vital essence from your computers.
182 Bacula is a set of computer programs that permit you (or the system
183 administrator) to manage backup, recovery, and verification of computer
184 data across a network of computers of different kinds. In technical terms,
185 it is a network client/server based backup program. Bacula is relatively
186 easy to use and efficient, while offering many advanced storage management
187 features that make it easy to find and recover lost or damaged files.
188 Bacula source code has been released under the GPL version 2 license.
191 This build requires MySQL to be installed separately as the catalog database.
194 This build requires PostgreSQL to be installed separately as the catalog database.
197 This build incorporates sqlite as the catalog database, statically compiled.
201 Summary: Bacula - The Network Backup Solution
202 Group: System Environment/Daemons
204 Requires: readline, perl, libstdc++, zlib
207 Requires: glibc >= 2.2
211 Requires: glibc >= 2.3
214 %if ! %{rh7} && ! %{su9}
215 Requires: glibc >= 2.3
220 Bacula - It comes by night and sucks the vital essence from your computers.
222 Bacula is a set of computer programs that permit you (or the system
223 administrator) to manage backup, recovery, and verification of computer
224 data across a network of computers of different kinds. In technical terms,
225 it is a network client/server based backup program. Bacula is relatively
226 easy to use and efficient, while offering many advanced storage management
227 features that make it easy to find and recover lost or damaged files.
228 Bacula source code has been released under the GPL version 2 license.
230 This is the File daemon (Client) only package. It includes the command line
235 Summary: Bacula - The Network Backup Solution
236 Group: System Environment/Daemons
237 Requires: coreutils, util-linux, libc5, bacula-fd
240 Bacula - It comes by night and sucks the vital essence from your computers.
242 Bacula is a set of computer programs that permit you (or the system
243 administrator) to manage backup, recovery, and verification of computer
244 data across a network of computers of different kinds. In technical terms,
245 it is a network client/server based backup program. Bacula is relatively
246 easy to use and efficient, while offering many advanced storage management
247 features that make it easy to find and recover lost or damaged files.
248 Bacula source code has been released under the GPL version 2 license.
250 This package installs scripts for disaster recovery and builds rescue
251 floppy disks for bare metal recovery. This package includes tomsrtbt
252 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
253 to build a boot floppy disk.
255 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
256 bacula-client package for your platform installed and configured before
257 installing this package.
259 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
260 directory (this is done when the package is first installed),
261 then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
262 directory. To make the bacula rescue disk run
263 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
264 from the /etc/bacula/rescue directory. To recreate the rescue
265 information for this system run ./getdiskinfo again.
269 Summary: Bacula - The Network Backup Solution
270 Group: System Environment/Daemons
272 %description updatedb
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 updating older versions of the bacula
287 Summary: Bacula - The Network Backup Solution
288 Group: System Environment/Daemons
289 Requires: readline, atk, libstdc++, zlib, pango, libxml2, bacula-fd
292 Requires: gtk+ >= 1.2
293 Requires: gnome-libs >= 1.4
294 Requires: glibc >= 2.2
300 Requires: gtk2 >= 2.0
301 Requires: libgnomeui >= 2.0
302 Requires: glibc >= 2.3
304 Requires: libart_lgpl >= 2.0
305 Requires: libbonobo >= 2.0
306 Requires: libbonoboui >= 2.0
307 Requires: bonobo-activation
311 %if ! %{rh7} && ! %{su9}
312 Requires: gtk2 >= 2.0
313 Requires: libgnomeui >= 2.0
314 Requires: glibc >= 2.3
316 Requires: libart_lgpl >= 2.0
317 Requires: libbonobo >= 2.0
318 Requires: libbonoboui >= 2.0
319 Requires: bonobo-activation
329 %description gconsole
330 Bacula - It comes by night and sucks the vital essence from your computers.
332 Bacula is a set of computer programs that permit you (or the system
333 administrator) to manage backup, recovery, and verification of computer
334 data across a network of computers of different kinds. In technical terms,
335 it is a network client/server based backup program. Bacula is relatively
336 easy to use and efficient, while offering many advanced storage management
337 features that make it easy to find and recover lost or damaged files.
338 Bacula source code has been released under the GPL version 2 license.
340 This is the Gnome Console package. It is an add-on to the client or
351 export LDFLAGS="-L/usr/lib/termcap"
362 # patches for the bundled sqlite scripts
364 # patch the make_sqlite_tables script for installation bindir
365 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
367 # patch the create_sqlite_database script for installation bindir
368 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
370 # patch the make_catalog_backup script for installation bindir
371 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
373 # patch the update_sqlite_tables script for installation bindir
374 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
378 --sbindir=/usr/sbin \
379 --sysconfdir=/etc/bacula \
380 --with-scriptdir=/etc/bacula \
381 --enable-smartalloc \
388 --with-sqlite=${cwd}/../depkgs/sqlite \
393 --with-working-dir=%{working_dir} \
394 --with-pid-dir=/var/run \
395 --with-subsys-dir=/var/lock/subsys
399 strip static-bacula-fd
405 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
406 mkdir -p $RPM_BUILD_ROOT/etc/init.d
407 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
408 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
409 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
410 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
411 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
412 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
413 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
415 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
416 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
420 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
424 prefix=$RPM_BUILD_ROOT/usr \
425 sbindir=$RPM_BUILD_ROOT/usr/sbin \
426 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
427 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
428 working_dir=$RPM_BUILD_ROOT%{working_dir} \
433 prefix=$RPM_BUILD_ROOT/usr \
434 sbindir=$RPM_BUILD_ROOT/usr/sbin \
435 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
436 working_dir=$RPM_BUILD_ROOT%{working_dir} \
437 mandir=$RPM_BUILD_ROOT/usr/man \
441 # fixme - make installs the mysql scripts for sqlite build
443 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
444 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
445 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
448 # fixme - make installs the mysql scripts for postgresql build
450 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
451 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
454 # install the init scripts
456 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
457 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
458 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
460 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
461 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
462 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
464 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
466 # install the menu stuff
468 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
469 cp -p scripts/bacula.desktop.gnome1.xsu $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
470 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
472 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
473 cp -p scripts/bacula.desktop.gnome1.consolehelper $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
474 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
475 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
476 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
481 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
482 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
483 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
486 # install the logrotate file
487 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
489 # install the rescue stuff
490 # these are the rescue scripts
491 cp -p rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
492 cp -p rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
493 cp -p rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
494 cp -p rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
495 cp -p rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
496 cp -p rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
497 cp -p rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
498 cp -p rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
499 cp -p rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
501 # this is the static file daemon
502 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
504 # this is the tom's root boot disk
505 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
507 # install the updatedb scripts
508 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
510 # now clean up permissions that are left broken by the install
511 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
512 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
515 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
520 %defattr(-,root,root)
525 /etc/bacula/create_mysql_database
526 /etc/bacula/drop_mysql_database
527 /etc/bacula/make_mysql_tables
528 /etc/bacula/drop_mysql_tables
529 /etc/bacula/update_mysql_tables
530 /etc/bacula/grant_mysql_privileges
531 /etc/bacula/create_bacula_database
532 /etc/bacula/drop_bacula_database
533 /etc/bacula/grant_bacula_privileges
534 /etc/bacula/make_bacula_tables
535 /etc/bacula/drop_bacula_tables
536 /etc/bacula/update_bacula_tables
537 /etc/bacula/make_catalog_backup
538 /etc/bacula/delete_catalog_backup
539 /etc/bacula/startmysql
540 /etc/bacula/stopmysql
541 /etc/bacula/mtx-changer
542 /etc/init.d/bacula-dir
543 /etc/init.d/bacula-fd
544 /etc/init.d/bacula-sd
546 %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
549 /etc/logrotate.d/bacula
551 %config(noreplace) /etc/bacula/bacula-dir.conf
552 %config(noreplace) /etc/bacula/bacula-fd.conf
553 %config(noreplace) /etc/bacula/bacula-sd.conf
554 %config(noreplace) /etc/bacula/bconsole.conf
555 /etc/bacula/query.sql
574 /usr/sbin/static-bacula-fd
575 /etc/bacula/btraceback.gdb
578 # test for bacula database older than version 6
579 # note: this ASSUMES no password has been set for bacula database
580 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
582 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
583 echo "This bacula upgrade will update a bacula database from version 6 to 7."
584 echo "You appear to be running database version $DB_VER. You must first update"
585 echo "your database to version 6 and then install this upgrade. The alternative"
586 echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
587 echo "catalog information, then do the upgrade. Information on updating a"
588 echo "database older than version 6 can be found in the release notes."
591 # check for and copy /etc/bacula/console.conf to bconsole.conf
592 if [ -s /etc/bacula/console.conf ];then
593 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
599 if [ "$1" -ge 1 ] ; then
600 /sbin/chkconfig --add bacula-dir
601 /sbin/chkconfig --add bacula-fd
602 /sbin/chkconfig --add bacula-sd
605 # test for an existing database
606 # note: this ASSUMES no password has been set for bacula database
607 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
609 # grant privileges and create tables if they do not exist
610 if [ -z "$DB_VER" ]; then
611 echo "Hmm, doesn't look like you have an existing database."
612 echo "Granting privileges for MySQL user bacula..."
613 /etc/bacula/grant_mysql_privileges
614 echo "Creating MySQL bacula database..."
615 /etc/bacula/create_mysql_database
616 echo "Creating bacula tables..."
617 /etc/bacula/make_mysql_tables
619 # check to see if we need to upgrade a 1.32 or lower database
620 elif [ "$DB_VER" -lt "7" ]; then
621 echo "This release requires an upgrade to your bacula database."
622 echo "Backing up your current database..."
623 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
624 echo "Upgrading bacula database ..."
625 /etc/bacula/update_mysql_tables
626 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
633 /sbin/chkconfig --del bacula-dir
634 /sbin/chkconfig --del bacula-fd
635 /sbin/chkconfig --del bacula-sd
643 %defattr(-,root,root)
648 /etc/bacula/create_bacula_database
649 /etc/bacula/drop_bacula_database
650 /etc/bacula/grant_bacula_privileges
651 /etc/bacula/make_bacula_tables
652 /etc/bacula/drop_bacula_tables
653 /etc/bacula/update_bacula_tables
654 /etc/bacula/create_sqlite_database
655 /etc/bacula/drop_sqlite_database
656 /etc/bacula/grant_sqlite_privileges
657 /etc/bacula/make_sqlite_tables
658 /etc/bacula/drop_sqlite_tables
659 /etc/bacula/update_sqlite_tables
660 /etc/bacula/make_catalog_backup
661 /etc/bacula/delete_catalog_backup
662 /etc/bacula/mtx-changer
663 /etc/init.d/bacula-dir
664 /etc/init.d/bacula-fd
665 /etc/init.d/bacula-sd
667 %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
670 /etc/logrotate.d/bacula
672 %config(noreplace) /etc/bacula/bacula-dir.conf
673 %config(noreplace) /etc/bacula/bacula-fd.conf
674 %config(noreplace) /etc/bacula/bacula-sd.conf
675 %config(noreplace) /etc/bacula/bconsole.conf
676 /etc/bacula/query.sql
677 %{sqlite_bindir}/libsqlite.a
678 %{sqlite_bindir}/sqlite.h
697 /usr/sbin/static-bacula-fd
698 %{sqlite_bindir}/sqlite
699 /etc/bacula/btraceback.gdb
702 # test for bacula database older than version 6
703 if [ -s %{working_dir}/bacula.db ];then
704 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
705 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
706 echo "This bacula upgrade will update a bacula database from version 6 to 7."
707 echo "You appear to be running database version $DB_VER. You must first update"
708 echo "your database to version 6 and then install this upgrade. The alternative"
709 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
710 echo "catalog information, then do the upgrade. Information on updating a"
711 echo "database older than version 6 can be found in the release notes."
715 # check for and copy /etc/bacula/console.conf to bconsole.conf
716 if [ -s /etc/bacula/console.conf ];then
717 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
722 if [ "$1" -ge 1 ] ; then
723 /sbin/chkconfig --add bacula-dir
724 /sbin/chkconfig --add bacula-fd
725 /sbin/chkconfig --add bacula-sd
728 # test for an existing database
729 if [ -s %{working_dir}/bacula.db ]; then
730 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
731 # check to see if we need to upgrade a 1.32 or lower database
732 if [ "$DB_VER" -lt "7" ]; then
733 echo "This release requires an upgrade to your bacula database."
734 echo "Backing up your current database..."
735 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
736 echo "Upgrading bacula database ..."
737 /etc/bacula/update_sqlite_tables
738 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
741 # create the database and tables
742 echo "Hmm, doesn't look like you have an existing database."
743 echo "Creating SQLite database..."
744 /etc/bacula/create_sqlite_database
745 echo "Creating the SQLite tables..."
746 /etc/bacula/make_sqlite_tables
752 /sbin/chkconfig --del bacula-dir
753 /sbin/chkconfig --del bacula-fd
754 /sbin/chkconfig --del bacula-sd
762 %defattr(-,root,root)
767 /etc/bacula/create_postgresql_database
768 /etc/bacula/drop_postgresql_database
769 /etc/bacula/make_postgresql_tables
770 /etc/bacula/drop_postgresql_tables
771 /etc/bacula/update_postgresql_tables
772 /etc/bacula/grant_postgresql_privileges
773 /etc/bacula/create_bacula_database
774 /etc/bacula/drop_bacula_database
775 /etc/bacula/grant_bacula_privileges
776 /etc/bacula/make_bacula_tables
777 /etc/bacula/drop_bacula_tables
778 /etc/bacula/update_bacula_tables
779 /etc/bacula/make_catalog_backup
780 /etc/bacula/delete_catalog_backup
781 /etc/bacula/mtx-changer
782 /etc/init.d/bacula-dir
783 /etc/init.d/bacula-fd
784 /etc/init.d/bacula-sd
786 %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
789 /etc/logrotate.d/bacula
791 %config(noreplace) /etc/bacula/bacula-dir.conf
792 %config(noreplace) /etc/bacula/bacula-fd.conf
793 %config(noreplace) /etc/bacula/bacula-sd.conf
794 %config(noreplace) /etc/bacula/bconsole.conf
795 /etc/bacula/query.sql
814 /usr/sbin/static-bacula-fd
815 /etc/bacula/btraceback.gdb
819 if [ "$1" -ge 1 ] ; then
820 /sbin/chkconfig --add bacula-dir
821 /sbin/chkconfig --add bacula-fd
822 /sbin/chkconfig --add bacula-sd
825 # test for an existing database
826 # note: this ASSUMES no password has been set for bacula database
827 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
829 # grant privileges and create tables if they do not exist
830 if [ -z "$DB_VER" ]; then
831 echo "Hmm, doesn't look like you have an existing database."
832 echo "Granting privileges for PostgreSQL user bacula..."
833 /etc/bacula/grant_postgresql_privileges
834 echo "Creating PostgreSQL bacula database..."
835 /etc/bacula/create_postgresql_database
836 echo "Creating bacula tables..."
837 /etc/bacula/make_postgresql_tables
843 /sbin/chkconfig --del bacula-dir
844 /sbin/chkconfig --del bacula-fd
845 /sbin/chkconfig --del bacula-sd
851 %defattr(-,root,root)
855 /etc/init.d/bacula-fd
857 %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
858 /etc/logrotate.d/bacula
860 %config(noreplace) /etc/bacula/bacula-fd.conf
861 %config(noreplace) /etc/bacula/bconsole.conf
866 /etc/bacula/btraceback.gdb
873 if [ "$1" -ge 1 ] ; then
874 /sbin/chkconfig --add bacula-fd
880 /sbin/chkconfig --del bacula-fd
884 %defattr(-,root,root)
885 /etc/bacula/rescue/backup.etc.list
886 /etc/bacula/rescue/format_floppy
887 /etc/bacula/rescue/getdiskinfo
888 /etc/bacula/rescue/make_rescue_disk
889 /etc/bacula/rescue/restore_bacula
890 /etc/bacula/rescue/restore_etc
891 /etc/bacula/rescue/run_grub
892 /etc/bacula/rescue/run_lilo
893 /etc/bacula/rescue/sfdisk.bz2
894 /etc/bacula/rescue/bacula-fd
895 /etc/bacula/rescue/tomsrtbt/*
898 # link our current installed conf file to the rescue directory
899 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
902 echo "Creating rescue files for this system..."
903 cd /etc/bacula/rescue
907 # remove the files created after the initial rpm installation
908 rm -f /etc/bacula/rescue/bacula-fd.conf
909 rm -f /etc/bacula/rescue/partition.*
910 rm -f /etc/bacula/rescue/format.*
911 rm -f /etc/bacula/rescue/mount_drives
912 rm -f /etc/bacula/rescue/start_network
913 rm -f /etc/bacula/rescue/sfdisk
914 rm -rf /etc/bacula/rescue/diskinfo/*
917 %defattr(-,root,root)
918 /etc/bacula/updatedb/*
921 echo "The database update scripts were installed to /etc/bacula/updatedb"
924 %defattr(-,root,root)
925 /usr/sbin/gnome-console
927 %config(noreplace) /etc/bacula/gnome-console.conf
928 /usr/share/pixmaps/bacula.png
929 /usr/share/gnome/apps/System/bacula.desktop
930 /usr/share/applications/bacula.desktop
933 # add the console helper files
934 %config(noreplace,missingok) /etc/pam.d/gnome-console
935 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
938 # add gnome-console consolehelper link
939 ln -s /usr/bin/consolehelper /usr/bin/gnome-console
942 # remove gnome-console consolehelper link
943 rm -f /usr/bin/gnome-console
947 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
948 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
949 - rpm's horrible bug that prevents nested conditional macros prevents me
950 - from implementing these 2 separate approaches within the conditionals which
951 - create the separate server packages.
952 - the solution adopted is to remove the gnome-console files from the server packages
953 - so bacula-gconsole is now an add on for both client and server packages.
954 - this also now allows the server packages to be install on machines without
955 - an X-server and we can still maintain a single spec file.
956 - added tests to make sure we have defined platform and database macros.
957 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
958 - corrected mysql prerequisites for suse
959 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
960 - replaced all cp commands with cp -p
961 - removed addition of a+x permissions on gnome-console
962 - corrected permissions on init scripts
963 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
964 - corrected creation of sqlite_bindir in install from !mysql to sqlite
966 - various cleanup patches from Michael K. Johnson:
967 - corrected post install routines for nicer chkconfig
968 - removed chmod changes in post routines and moved to install section
969 - removed interactive nature of post routine for rescue package
970 - added description of building rescue disks to the description of rescue package
971 - added clean of build root to beginning of install
972 - removed specifying attr in all file lists
973 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
974 - added bconsole to client package
975 - added gconsole package as add-on to client
976 - removed spurious dependancies on updatedb package (!cut/paste)
977 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
978 - added updatedb package
979 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
980 - added postgresql package
981 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
982 - corrected the if else logic in the dependancy sections
983 - changes for 1.34 release
984 - /etc/bacula/console is now /etc/bacula/bconsole
985 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
986 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
987 - /usr/sbin/smtp is now /usr/sbin/bsmtp
988 - added new /etc/bacula/drop_mysql_database
989 - added new /etc/bacula/drop_sqlite_database
990 - added new /etc/bacula/grant_sqlite_privileges
991 - added new generic bacula database scripts in /etc/bacula
992 - added pre-install sections to check for database versions older than 6
993 - added check for /etc/bacula/console.conf and copy to bconsole.conf
994 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
995 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
996 - added testing for existing databases before executing any of the database creation scripts
997 - added defines working_dir and sqlite_bindir in place of hard coded paths
998 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
999 - added build configuration for SuSE.
1000 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1001 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1002 - added patch for create_sqlite_database to fix the installed bindir
1003 - added execute of create_sqlite_database to post of sqlite package
1004 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1005 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1006 - added bacula-fd as Requires for rescue package
1007 - added build tag for Fedora Core 1
1008 - cleaned up dependancies for all builds
1009 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1010 - removed rh_version from package names
1011 - added platform build configuration section to beginning of file
1012 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1013 - removed make_static_bacula script from rescue package install
1014 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1015 - Added define at top of file for depkgs version
1016 - Added rescue sub-package
1017 - Moved requires statements into proper sub-package locations
1018 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1019 - Corrected Requires for Gnome 1.4/2.0 builds
1020 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1021 - Added separate source declaration for depkgs
1022 - added patch for make_catalog_backup script
1023 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1024 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1025 - Added rh_version to sub-package names
1026 - Added installed but missing file /etc/bacula/gconsole
1027 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1028 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1029 - Update spec for version 1.31 and combine client
1030 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>