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 Source3: Release_Notes-%{version}-%{release}.tar.gz
61 BuildRoot: %{_tmppath}/%{name}-root
62 URL: http://www.bacula.org/
63 Vendor: The Bacula Team
64 Distribution: The Bacula Team
65 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
66 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
67 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
69 BuildRequires: libtermcap-devel
70 BuildRequires: gtk+-devel >= 1.2
71 BuildRequires: gnome-libs-devel >= 1.4
72 BuildRequires: glibc-devel >= 2.2
73 BuildRequires: ORBit-devel
74 BuildRequires: bonobo-devel
75 BuildRequires: GConf-devel
78 BuildRequires: termcap
79 BuildRequires: gtk2-devel >= 2.0
80 BuildRequires: libgnomeui-devel >= 2.0
81 BuildRequires: glibc-devel >= 2.3
82 BuildRequires: ORBit2-devel
83 BuildRequires: libart_lgpl-devel >= 2.0
84 BuildRequires: libbonobo-devel >= 2.0
85 BuildRequires: libbonoboui-devel >= 2.0
86 BuildRequires: bonobo-activation-devel
87 BuildRequires: gconf2-devel
88 BuildRequires: linc-devel
90 %if ! %{rh7} && ! %{su9}
91 BuildRequires: libtermcap-devel
92 BuildRequires: gtk2-devel >= 2.0
93 BuildRequires: libgnomeui-devel >= 2.0
94 BuildRequires: glibc-devel >= 2.3
95 BuildRequires: ORBit2-devel
96 BuildRequires: libart_lgpl-devel >= 2.0
97 BuildRequires: libbonobo-devel >= 2.0
98 BuildRequires: libbonoboui-devel >= 2.0
99 BuildRequires: bonobo-activation-devel
100 BuildRequires: GConf2-devel
101 BuildRequires: linc-devel
105 BuildRequires: mysql-devel >= 3.23
108 %if %{postgresql} && %{wb3}
109 BuildRequires: rh-postgresql-devel >= 7
112 %if %{postgresql} && ! %{wb3}
113 BuildRequires: postgresql-devel >= 7
117 Bacula - It comes by night and sucks the vital essence from your computers.
119 Bacula is a set of computer programs that permit you (or the system
120 administrator) to manage backup, recovery, and verification of computer
121 data across a network of computers of different kinds. In technical terms,
122 it is a network client/server based backup program. Bacula is relatively
123 easy to use and efficient, while offering many advanced storage management
124 features that make it easy to find and recover lost or damaged files.
125 Bacula source code has been released under the GPL version 2 license.
137 Summary: Bacula - The Network Backup Solution
138 Group: System Environment/Daemons
139 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
140 Conflicts: bacula-client
141 Requires: readline, ncurses, libstdc++, zlib
143 Requires: glibc >= 2.2
147 Requires: glibc >= 2.3
150 %if ! %{rh7} && ! %{su9}
151 Requires: glibc >= 2.3
154 %if %{mysql} && ! %{su9}
155 Requires: mysql >= 3.23
156 Requires: mysql-server >= 3.23
158 %if %{mysql} && %{su9}
159 Requires: mysql >= 3.23
160 Requires: mysql-client >= 3.23
162 %if %{postgresql} && %{wb3}
163 Requires: rh-postgresql >= 7
164 Requires: rh-postgresql-server >= 7
166 %if %{postgresql} && ! %{wb3}
167 Requires: postgresql >= 7
168 Requires: postgresql-server >= 7
178 %description postgresql
181 Bacula - It comes by night and sucks the vital essence from your computers.
183 Bacula is a set of computer programs that permit you (or the system
184 administrator) to manage backup, recovery, and verification of computer
185 data across a network of computers of different kinds. In technical terms,
186 it is a network client/server based backup program. Bacula is relatively
187 easy to use and efficient, while offering many advanced storage management
188 features that make it easy to find and recover lost or damaged files.
189 Bacula source code has been released under the GPL version 2 license.
192 This build requires MySQL to be installed separately as the catalog database.
195 This build requires PostgreSQL to be installed separately as the catalog database.
198 This build incorporates sqlite as the catalog database, statically compiled.
202 Summary: Bacula - The Network Backup Solution
203 Group: System Environment/Daemons
205 Requires: readline, libstdc++, zlib
208 Requires: glibc >= 2.2
212 Requires: glibc >= 2.3
215 %if ! %{rh7} && ! %{su9}
216 Requires: glibc >= 2.3
221 Bacula - It comes by night and sucks the vital essence from your computers.
223 Bacula is a set of computer programs that permit you (or the system
224 administrator) to manage backup, recovery, and verification of computer
225 data across a network of computers of different kinds. In technical terms,
226 it is a network client/server based backup program. Bacula is relatively
227 easy to use and efficient, while offering many advanced storage management
228 features that make it easy to find and recover lost or damaged files.
229 Bacula source code has been released under the GPL version 2 license.
231 This is the File daemon (Client) only package. It includes the command line
236 Summary: Bacula - The Network Backup Solution
237 Group: System Environment/Daemons
238 Requires: coreutils, util-linux, libc5, bacula-fd
241 Bacula - It comes by night and sucks the vital essence from your computers.
243 Bacula is a set of computer programs that permit you (or the system
244 administrator) to manage backup, recovery, and verification of computer
245 data across a network of computers of different kinds. In technical terms,
246 it is a network client/server based backup program. Bacula is relatively
247 easy to use and efficient, while offering many advanced storage management
248 features that make it easy to find and recover lost or damaged files.
249 Bacula source code has been released under the GPL version 2 license.
251 This package installs scripts for disaster recovery and builds rescue
252 floppy disks for bare metal recovery. This package includes tomsrtbt
253 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
254 to build a boot floppy disk.
256 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
257 bacula-client package for your platform installed and configured before
258 installing this package.
260 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
261 directory (this is done when the package is first installed),
262 then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
263 directory. To make the bacula rescue disk run
264 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
265 from the /etc/bacula/rescue directory. To recreate the rescue
266 information for this system run ./getdiskinfo again.
270 Summary: Bacula - The Network Backup Solution
271 Group: System Environment/Daemons
273 %description updatedb
274 Bacula - It comes by night and sucks the vital essence from your computers.
276 Bacula is a set of computer programs that permit you (or the system
277 administrator) to manage backup, recovery, and verification of computer
278 data across a network of computers of different kinds. In technical terms,
279 it is a network client/server based backup program. Bacula is relatively
280 easy to use and efficient, while offering many advanced storage management
281 features that make it easy to find and recover lost or damaged files.
282 Bacula source code has been released under the GPL version 2 license.
284 This package installs scripts for updating older versions of the bacula
288 Summary: Bacula - The Network Backup Solution
289 Group: System Environment/Daemons
290 Requires: readline, atk, libstdc++, zlib, pango, libxml2, bacula-fd
293 Requires: gtk+ >= 1.2
294 Requires: gnome-libs >= 1.4
295 Requires: glibc >= 2.2
301 Requires: gtk2 >= 2.0
302 Requires: libgnomeui >= 2.0
303 Requires: glibc >= 2.3
305 Requires: libart_lgpl >= 2.0
306 Requires: libbonobo >= 2.0
307 Requires: libbonoboui >= 2.0
308 Requires: bonobo-activation
312 %if ! %{rh7} && ! %{su9}
313 Requires: gtk2 >= 2.0
314 Requires: libgnomeui >= 2.0
315 Requires: glibc >= 2.3
317 Requires: libart_lgpl >= 2.0
318 Requires: libbonobo >= 2.0
319 Requires: libbonoboui >= 2.0
320 Requires: bonobo-activation
330 %description gconsole
331 Bacula - It comes by night and sucks the vital essence from your computers.
333 Bacula is a set of computer programs that permit you (or the system
334 administrator) to manage backup, recovery, and verification of computer
335 data across a network of computers of different kinds. In technical terms,
336 it is a network client/server based backup program. Bacula is relatively
337 easy to use and efficient, while offering many advanced storage management
338 features that make it easy to find and recover lost or damaged files.
339 Bacula source code has been released under the GPL version 2 license.
341 This is the Gnome Console package. It is an add-on to the client or
353 export LDFLAGS="-L/usr/lib/termcap"
364 # patches for the bundled sqlite scripts
366 # patch the make_sqlite_tables script for installation bindir
367 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
369 # patch the create_sqlite_database script for installation bindir
370 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
372 # patch the make_catalog_backup script for installation bindir
373 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
375 # patch the update_sqlite_tables script for installation bindir
376 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
380 --sbindir=/usr/sbin \
381 --sysconfdir=/etc/bacula \
382 --with-scriptdir=/etc/bacula \
383 --enable-smartalloc \
390 --with-sqlite=${cwd}/../depkgs/sqlite \
395 --with-working-dir=%{working_dir} \
396 --with-pid-dir=/var/run \
397 --with-subsys-dir=/var/lock/subsys
401 strip static-bacula-fd
407 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
408 mkdir -p $RPM_BUILD_ROOT/etc/init.d
409 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
410 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
412 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
414 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
416 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
417 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
418 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
420 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
421 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
425 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
429 prefix=$RPM_BUILD_ROOT/usr \
430 sbindir=$RPM_BUILD_ROOT/usr/sbin \
431 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
432 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
433 working_dir=$RPM_BUILD_ROOT%{working_dir} \
438 prefix=$RPM_BUILD_ROOT/usr \
439 sbindir=$RPM_BUILD_ROOT/usr/sbin \
440 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
441 working_dir=$RPM_BUILD_ROOT%{working_dir} \
442 mandir=$RPM_BUILD_ROOT/usr/man \
446 # setup the manual for the doc dir and correct some broken CVS permissions
448 cp -p doc/html-manual/*.html html-manual/
449 cp -p doc/html-manual/*.jpg html-manual/
450 cp -p doc/html-manual/*.gif html-manual/
451 cp -p doc/html-manual/*.css html-manual/
452 chmod 644 html-manual/*
453 chmod 644 doc/bacula.pdf
455 # fixme - make installs the mysql scripts for sqlite build
457 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
458 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
459 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
462 # fixme - make installs the mysql scripts for postgresql build
464 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
465 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
468 # install the init scripts
470 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
471 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
472 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
474 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
475 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
476 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
478 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
480 # install the menu stuff
482 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
483 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
486 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
487 cp -p scripts/bacula.desktop.gnome1.consolehelper $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
488 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
489 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
491 %if %{rh8} || %{rh9} || %{wb3} || %{fc1}
492 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
493 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
494 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
495 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
500 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
501 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
502 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
505 # install the logrotate file
506 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
508 # install the rescue stuff
509 # these are the rescue scripts
510 cp -p rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
511 cp -p rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
512 cp -p rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
513 cp -p rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
514 cp -p rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
515 cp -p rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
516 cp -p rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
517 cp -p rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
518 cp -p rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
520 # this is the static file daemon
521 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
523 # this is the tom's root boot disk
524 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
526 # install the updatedb scripts
527 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
529 # now clean up permissions that are left broken by the install
530 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
531 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
534 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
539 %defattr(-,root,root)
544 /etc/bacula/create_mysql_database
545 /etc/bacula/drop_mysql_database
546 /etc/bacula/make_mysql_tables
547 /etc/bacula/drop_mysql_tables
548 /etc/bacula/update_mysql_tables
549 /etc/bacula/grant_mysql_privileges
550 /etc/bacula/create_bacula_database
551 /etc/bacula/drop_bacula_database
552 /etc/bacula/grant_bacula_privileges
553 /etc/bacula/make_bacula_tables
554 /etc/bacula/drop_bacula_tables
555 /etc/bacula/update_bacula_tables
556 /etc/bacula/make_catalog_backup
557 /etc/bacula/delete_catalog_backup
558 /etc/bacula/startmysql
559 /etc/bacula/stopmysql
560 /etc/bacula/mtx-changer
561 /etc/init.d/bacula-dir
562 /etc/init.d/bacula-fd
563 /etc/init.d/bacula-sd
565 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
568 /etc/logrotate.d/bacula
570 %config(noreplace) /etc/bacula/bacula-dir.conf
571 %config(noreplace) /etc/bacula/bacula-fd.conf
572 %config(noreplace) /etc/bacula/bacula-sd.conf
573 %config(noreplace) /etc/bacula/bconsole.conf
574 /etc/bacula/query.sql
593 /usr/sbin/static-bacula-fd
594 /etc/bacula/btraceback.gdb
597 # test for bacula database older than version 6
598 # note: this ASSUMES no password has been set for bacula database
599 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
601 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
602 echo "This bacula upgrade will update a bacula database from version 6 to 7."
603 echo "You appear to be running database version $DB_VER. You must first update"
604 echo "your database to version 6 and then install this upgrade. The alternative"
605 echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
606 echo "catalog information, then do the upgrade. Information on updating a"
607 echo "database older than version 6 can be found in the release notes."
610 # check for and copy /etc/bacula/console.conf to bconsole.conf
611 if [ -s /etc/bacula/console.conf ];then
612 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
618 if [ "$1" -ge 1 ] ; then
619 /sbin/chkconfig --add bacula-dir
620 /sbin/chkconfig --add bacula-fd
621 /sbin/chkconfig --add bacula-sd
624 # test for an existing database
625 # note: this ASSUMES no password has been set for bacula database
626 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
628 # grant privileges and create tables if they do not exist
629 if [ -z "$DB_VER" ]; then
630 echo "Hmm, doesn't look like you have an existing database."
631 echo "Granting privileges for MySQL user bacula..."
632 /etc/bacula/grant_mysql_privileges
633 echo "Creating MySQL bacula database..."
634 /etc/bacula/create_mysql_database
635 echo "Creating bacula tables..."
636 /etc/bacula/make_mysql_tables
638 # check to see if we need to upgrade a 1.32 or lower database
639 elif [ "$DB_VER" -lt "7" ]; then
640 echo "This release requires an upgrade to your bacula database."
641 echo "Backing up your current database..."
642 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
643 echo "Upgrading bacula database ..."
644 /etc/bacula/update_mysql_tables
645 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
652 /sbin/chkconfig --del bacula-dir
653 /sbin/chkconfig --del bacula-fd
654 /sbin/chkconfig --del bacula-sd
662 %defattr(-,root,root)
667 /etc/bacula/create_bacula_database
668 /etc/bacula/drop_bacula_database
669 /etc/bacula/grant_bacula_privileges
670 /etc/bacula/make_bacula_tables
671 /etc/bacula/drop_bacula_tables
672 /etc/bacula/update_bacula_tables
673 /etc/bacula/create_sqlite_database
674 /etc/bacula/drop_sqlite_database
675 /etc/bacula/grant_sqlite_privileges
676 /etc/bacula/make_sqlite_tables
677 /etc/bacula/drop_sqlite_tables
678 /etc/bacula/update_sqlite_tables
679 /etc/bacula/make_catalog_backup
680 /etc/bacula/delete_catalog_backup
681 /etc/bacula/mtx-changer
682 /etc/init.d/bacula-dir
683 /etc/init.d/bacula-fd
684 /etc/init.d/bacula-sd
686 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
689 /etc/logrotate.d/bacula
691 %config(noreplace) /etc/bacula/bacula-dir.conf
692 %config(noreplace) /etc/bacula/bacula-fd.conf
693 %config(noreplace) /etc/bacula/bacula-sd.conf
694 %config(noreplace) /etc/bacula/bconsole.conf
695 /etc/bacula/query.sql
696 %{sqlite_bindir}/libsqlite.a
697 %{sqlite_bindir}/sqlite.h
716 /usr/sbin/static-bacula-fd
717 %{sqlite_bindir}/sqlite
718 /etc/bacula/btraceback.gdb
721 # test for bacula database older than version 6
722 if [ -s %{working_dir}/bacula.db ];then
723 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
724 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
725 echo "This bacula upgrade will update a bacula database from version 6 to 7."
726 echo "You appear to be running database version $DB_VER. You must first update"
727 echo "your database to version 6 and then install this upgrade. The alternative"
728 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
729 echo "catalog information, then do the upgrade. Information on updating a"
730 echo "database older than version 6 can be found in the release notes."
734 # check for and copy /etc/bacula/console.conf to bconsole.conf
735 if [ -s /etc/bacula/console.conf ];then
736 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
741 if [ "$1" -ge 1 ] ; then
742 /sbin/chkconfig --add bacula-dir
743 /sbin/chkconfig --add bacula-fd
744 /sbin/chkconfig --add bacula-sd
747 # test for an existing database
748 if [ -s %{working_dir}/bacula.db ]; then
749 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
750 # check to see if we need to upgrade a 1.32 or lower database
751 if [ "$DB_VER" -lt "7" ]; then
752 echo "This release requires an upgrade to your bacula database."
753 echo "Backing up your current database..."
754 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
755 echo "Upgrading bacula database ..."
756 /etc/bacula/update_sqlite_tables
757 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
760 # create the database and tables
761 echo "Hmm, doesn't look like you have an existing database."
762 echo "Creating SQLite database..."
763 /etc/bacula/create_sqlite_database
764 echo "Creating the SQLite tables..."
765 /etc/bacula/make_sqlite_tables
771 /sbin/chkconfig --del bacula-dir
772 /sbin/chkconfig --del bacula-fd
773 /sbin/chkconfig --del bacula-sd
781 %defattr(-,root,root)
786 /etc/bacula/create_postgresql_database
787 /etc/bacula/drop_postgresql_database
788 /etc/bacula/make_postgresql_tables
789 /etc/bacula/drop_postgresql_tables
790 /etc/bacula/update_postgresql_tables
791 /etc/bacula/grant_postgresql_privileges
792 /etc/bacula/create_bacula_database
793 /etc/bacula/drop_bacula_database
794 /etc/bacula/grant_bacula_privileges
795 /etc/bacula/make_bacula_tables
796 /etc/bacula/drop_bacula_tables
797 /etc/bacula/update_bacula_tables
798 /etc/bacula/make_catalog_backup
799 /etc/bacula/delete_catalog_backup
800 /etc/bacula/mtx-changer
801 /etc/init.d/bacula-dir
802 /etc/init.d/bacula-fd
803 /etc/init.d/bacula-sd
805 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
808 /etc/logrotate.d/bacula
810 %config(noreplace) /etc/bacula/bacula-dir.conf
811 %config(noreplace) /etc/bacula/bacula-fd.conf
812 %config(noreplace) /etc/bacula/bacula-sd.conf
813 %config(noreplace) /etc/bacula/bconsole.conf
814 /etc/bacula/query.sql
833 /usr/sbin/static-bacula-fd
834 /etc/bacula/btraceback.gdb
838 if [ "$1" -ge 1 ] ; then
839 /sbin/chkconfig --add bacula-dir
840 /sbin/chkconfig --add bacula-fd
841 /sbin/chkconfig --add bacula-sd
844 # test for an existing database
845 # note: this ASSUMES no password has been set for bacula database
846 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
848 # grant privileges and create tables if they do not exist
849 if [ -z "$DB_VER" ]; then
850 echo "Hmm, doesn't look like you have an existing database."
851 echo "Granting privileges for PostgreSQL user bacula..."
852 /etc/bacula/grant_postgresql_privileges
853 echo "Creating PostgreSQL bacula database..."
854 /etc/bacula/create_postgresql_database
855 echo "Creating bacula tables..."
856 /etc/bacula/make_postgresql_tables
862 /sbin/chkconfig --del bacula-dir
863 /sbin/chkconfig --del bacula-fd
864 /sbin/chkconfig --del bacula-sd
870 %defattr(-,root,root)
874 /etc/init.d/bacula-fd
876 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
877 /etc/logrotate.d/bacula
879 %config(noreplace) /etc/bacula/bacula-fd.conf
880 %config(noreplace) /etc/bacula/bconsole.conf
885 /etc/bacula/btraceback.gdb
892 if [ "$1" -ge 1 ] ; then
893 /sbin/chkconfig --add bacula-fd
899 /sbin/chkconfig --del bacula-fd
903 %defattr(-,root,root)
904 /etc/bacula/rescue/backup.etc.list
905 /etc/bacula/rescue/format_floppy
906 /etc/bacula/rescue/getdiskinfo
907 /etc/bacula/rescue/make_rescue_disk
908 /etc/bacula/rescue/restore_bacula
909 /etc/bacula/rescue/restore_etc
910 /etc/bacula/rescue/run_grub
911 /etc/bacula/rescue/run_lilo
912 /etc/bacula/rescue/sfdisk.bz2
913 /etc/bacula/rescue/bacula-fd
914 /etc/bacula/rescue/tomsrtbt/*
917 # link our current installed conf file to the rescue directory
918 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
921 echo "Creating rescue files for this system..."
922 cd /etc/bacula/rescue
926 # remove the files created after the initial rpm installation
927 rm -f /etc/bacula/rescue/bacula-fd.conf
928 rm -f /etc/bacula/rescue/partition.*
929 rm -f /etc/bacula/rescue/format.*
930 rm -f /etc/bacula/rescue/mount_drives
931 rm -f /etc/bacula/rescue/start_network
932 rm -f /etc/bacula/rescue/sfdisk
933 rm -rf /etc/bacula/rescue/diskinfo/*
936 %defattr(-,root,root)
937 /etc/bacula/updatedb/*
940 echo "The database update scripts were installed to /etc/bacula/updatedb"
943 %defattr(-,root,root)
944 /usr/sbin/gnome-console
946 %config(noreplace) /etc/bacula/gnome-console.conf
947 /usr/share/pixmaps/bacula.png
949 /usr/share/gnome/apps/System/bacula.desktop
951 /usr/share/applications/bacula.desktop
955 # add the console helper files
956 %config(noreplace,missingok) /etc/pam.d/gnome-console
957 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
960 # add gnome-console consolehelper link
961 ln -sf /usr/bin/consolehelper /usr/bin/gnome-console
965 # remove gnome-console consolehelper link
966 rm -f /usr/bin/gnome-console
970 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
971 - fix symlink creation in gconsole post install
972 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
973 - fixed error in gconsole post script
974 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
975 - add check for gconsole symlink before trying to create it
976 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
977 - fix some minor permissions issues on doc files that CVS won't let us fix
978 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
979 - add pkgconfig to BuildRequires
980 - clean up gnome1/2 menu entries for appropriate packages
981 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
982 - tightened up doc distribution
983 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
984 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
985 - rpm's horrible bug that prevents nested conditional macros prevents me
986 - from implementing these 2 separate approaches within the conditionals which
987 - create the separate server packages.
988 - the solution adopted is to remove the gnome-console files from the server packages
989 - so bacula-gconsole is now an add on for both client and server packages.
990 - this also now allows the server packages to be install on machines without
991 - an X-server and we can still maintain a single spec file.
992 - added tests to make sure we have defined platform and database macros.
993 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
994 - corrected mysql prerequisites for suse
995 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
996 - replaced all cp commands with cp -p
997 - removed addition of a+x permissions on gnome-console
998 - corrected permissions on init scripts
999 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1000 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1002 - various cleanup patches from Michael K. Johnson:
1003 - corrected post install routines for nicer chkconfig
1004 - removed chmod changes in post routines and moved to install section
1005 - removed interactive nature of post routine for rescue package
1006 - added description of building rescue disks to the description of rescue package
1007 - added clean of build root to beginning of install
1008 - removed specifying attr in all file lists
1009 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1010 - added bconsole to client package
1011 - added gconsole package as add-on to client
1012 - removed spurious dependancies on updatedb package (!cut/paste)
1013 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1014 - added updatedb package
1015 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1016 - added postgresql package
1017 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1018 - corrected the if else logic in the dependancy sections
1019 - changes for 1.34 release
1020 - /etc/bacula/console is now /etc/bacula/bconsole
1021 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1022 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1023 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1024 - added new /etc/bacula/drop_mysql_database
1025 - added new /etc/bacula/drop_sqlite_database
1026 - added new /etc/bacula/grant_sqlite_privileges
1027 - added new generic bacula database scripts in /etc/bacula
1028 - added pre-install sections to check for database versions older than 6
1029 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1030 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1031 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1032 - added testing for existing databases before executing any of the database creation scripts
1033 - added defines working_dir and sqlite_bindir in place of hard coded paths
1034 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1035 - added build configuration for SuSE.
1036 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1037 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1038 - added patch for create_sqlite_database to fix the installed bindir
1039 - added execute of create_sqlite_database to post of sqlite package
1040 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1041 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1042 - added bacula-fd as Requires for rescue package
1043 - added build tag for Fedora Core 1
1044 - cleaned up dependancies for all builds
1045 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1046 - removed rh_version from package names
1047 - added platform build configuration section to beginning of file
1048 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1049 - removed make_static_bacula script from rescue package install
1050 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1051 - Added define at top of file for depkgs version
1052 - Added rescue sub-package
1053 - Moved requires statements into proper sub-package locations
1054 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1055 - Corrected Requires for Gnome 1.4/2.0 builds
1056 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1057 - Added separate source declaration for depkgs
1058 - added patch for make_catalog_backup script
1059 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1060 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1061 - Added rh_version to sub-package names
1062 - Added installed but missing file /etc/bacula/gconsole
1063 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1064 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1065 - Update spec for version 1.31 and combine client
1066 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>