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
23 %{?build_wb3:%define wb3 1}
26 %{?build_su9:%define su9 1}
29 # set for database support desired
31 %{?build_mysql:%define mysql 1}
33 %{?build_sqlite:%define sqlite 1}
35 %{?build_postgresql:%define postgresql 1}
37 Summary: Bacula - The Network Backup Solution
41 Group: System Environment/Daemons
43 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
44 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
45 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
46 BuildRoot: %{_tmppath}/%{name}-root
47 URL: http://www.bacula.org/
48 Vendor: The Bacula Team
49 Distribution: The Bacula Team
50 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
51 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
52 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
54 BuildRequires: libtermcap-devel
55 BuildRequires: gtk+-devel >= 1.2
56 BuildRequires: gnome-libs-devel >= 1.4
57 BuildRequires: glibc-devel >= 2.2
58 BuildRequires: ORBit-devel
59 BuildRequires: bonobo-devel
60 BuildRequires: GConf-devel
63 BuildRequires: termcap
64 BuildRequires: gtk2-devel >= 2.0
65 BuildRequires: libgnomeui-devel >= 2.0
66 BuildRequires: glibc-devel >= 2.3
67 BuildRequires: ORBit2-devel
68 BuildRequires: libart_lgpl-devel >= 2.0
69 BuildRequires: libbonobo-devel >= 2.0
70 BuildRequires: libbonoboui-devel >= 2.0
71 BuildRequires: bonobo-activation-devel
72 BuildRequires: gconf2-devel
73 BuildRequires: linc-devel
75 %if ! %{rh7} && ! %{su9}
76 BuildRequires: libtermcap-devel
77 BuildRequires: gtk2-devel >= 2.0
78 BuildRequires: libgnomeui-devel >= 2.0
79 BuildRequires: glibc-devel >= 2.3
80 BuildRequires: ORBit2-devel
81 BuildRequires: libart_lgpl-devel >= 2.0
82 BuildRequires: libbonobo-devel >= 2.0
83 BuildRequires: libbonoboui-devel >= 2.0
84 BuildRequires: bonobo-activation-devel
85 BuildRequires: GConf2-devel
86 BuildRequires: linc-devel
90 BuildRequires: mysql-devel >= 3.23
93 %if %{postgresql} && %{wb3}
94 BuildRequires: rh-postgresql-devel >= 7
97 %if %{postgresql} && ! %{wb3}
98 BuildRequires: postgresql-devel >= 7
102 Bacula - It comes by night and sucks the vital essence from your computers.
104 Bacula is a set of computer programs that permit you (or the system
105 administrator) to manage backup, recovery, and verification of computer
106 data across a network of computers of different kinds. In technical terms,
107 it is a network client/server based backup program. Bacula is relatively
108 easy to use and efficient, while offering many advanced storage management
109 features that make it easy to find and recover lost or damaged files.
110 Bacula source code has been released under the GPL version 2 license.
122 Summary: Bacula - The Network Backup Solution
123 Group: System Environment/Daemons
124 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
125 Conflicts: bacula-client, bacula-gconsole
126 Requires: readline, perl, atk, ncurses, pango, libstdc++
127 Requires: libxml2, zlib
129 Requires: gtk+ >= 1.2
130 Requires: gnome-libs >= 1.4
131 Requires: glibc >= 2.2
138 Requires: gtk2 >= 2.0
139 Requires: libgnomeui >= 2.0
140 Requires: glibc >= 2.3
142 Requires: libart_lgpl >= 2.0
143 Requires: libbonobo >= 2.0
144 Requires: libbonoboui >= 2.0
145 Requires: bonobo-activation
150 %if ! %{rh7} && ! %{su9}
151 Requires: gtk2 >= 2.0
152 Requires: libgnomeui >= 2.0
153 Requires: glibc >= 2.3
155 Requires: libart_lgpl >= 2.0
156 Requires: libbonobo >= 2.0
157 Requires: libbonoboui >= 2.0
158 Requires: bonobo-activation
164 Requires: mysql >= 3.23
165 Requires: mysql-server >= 3.23
167 %if %{postgresql} && %{wb3}
168 Requires: rh-postgresql >= 7
169 Requires: rh-postgresql-server >= 7
171 %if %{postgresql} && ! %{wb3}
172 Requires: postgresql >= 7
173 Requires: postgresql-server >= 7
183 %description postgresql
186 Bacula - It comes by night and sucks the vital essence from your computers.
188 Bacula is a set of computer programs that permit you (or the system
189 administrator) to manage backup, recovery, and verification of computer
190 data across a network of computers of different kinds. In technical terms,
191 it is a network client/server based backup program. Bacula is relatively
192 easy to use and efficient, while offering many advanced storage management
193 features that make it easy to find and recover lost or damaged files.
194 Bacula source code has been released under the GPL version 2 license.
197 This build requires MySQL to be installed separately as the catalog database.
200 This build requires PostgreSQL to be installed separately as the catalog database.
203 This build incorporates sqlite as the catalog database, statically compiled.
207 Summary: Bacula - The Network Backup Solution
208 Group: System Environment/Daemons
210 Requires: readline, perl, libstdc++, zlib
213 Requires: glibc >= 2.2
217 Requires: glibc >= 2.3
220 %if ! %{rh7} && ! %{su9}
221 Requires: glibc >= 2.3
226 Bacula - It comes by night and sucks the vital essence from your computers.
228 Bacula is a set of computer programs that permit you (or the system
229 administrator) to manage backup, recovery, and verification of computer
230 data across a network of computers of different kinds. In technical terms,
231 it is a network client/server based backup program. Bacula is relatively
232 easy to use and efficient, while offering many advanced storage management
233 features that make it easy to find and recover lost or damaged files.
234 Bacula source code has been released under the GPL version 2 license.
236 This is the File daemon (Client) only package. It includes the command line
241 Summary: Bacula - The Network Backup Solution
242 Group: System Environment/Daemons
243 Requires: coreutils, util-linux, libc5, bacula-fd
246 Bacula - It comes by night and sucks the vital essence from your computers.
248 Bacula is a set of computer programs that permit you (or the system
249 administrator) to manage backup, recovery, and verification of computer
250 data across a network of computers of different kinds. In technical terms,
251 it is a network client/server based backup program. Bacula is relatively
252 easy to use and efficient, while offering many advanced storage management
253 features that make it easy to find and recover lost or damaged files.
254 Bacula source code has been released under the GPL version 2 license.
256 This package installs scripts for disaster recovery and builds rescue
257 floppy disks for bare metal recovery. This package includes tomsrtbt
258 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
259 to build a boot floppy disk.
261 You need to have the bacula-sqlite, bacula-mysql or bacula-client package for
262 your platform installed and configured before installing this package.
266 Summary: Bacula - The Network Backup Solution
267 Group: System Environment/Daemons
269 %description updatedb
270 Bacula - It comes by night and sucks the vital essence from your computers.
272 Bacula is a set of computer programs that permit you (or the system
273 administrator) to manage backup, recovery, and verification of computer
274 data across a network of computers of different kinds. In technical terms,
275 it is a network client/server based backup program. Bacula is relatively
276 easy to use and efficient, while offering many advanced storage management
277 features that make it easy to find and recover lost or damaged files.
278 Bacula source code has been released under the GPL version 2 license.
280 This package installs scripts for updating older versions of the bacula
284 Summary: Bacula - The Network Backup Solution
285 Group: System Environment/Daemons
286 Requires: readline, libstdc++, zlib, pango, bacula-client
287 Conflicts: bacula-server
290 Requires: gtk+ >= 1.2
291 Requires: gnome-libs >= 1.4
292 Requires: glibc >= 2.2
298 Requires: gtk2 >= 2.0
299 Requires: libgnomeui >= 2.0
300 Requires: glibc >= 2.3
302 Requires: libart_lgpl >= 2.0
303 Requires: libbonobo >= 2.0
304 Requires: libbonoboui >= 2.0
305 Requires: bonobo-activation
309 %if ! %{rh7} && ! %{su9}
310 Requires: gtk2 >= 2.0
311 Requires: libgnomeui >= 2.0
312 Requires: glibc >= 2.3
314 Requires: libart_lgpl >= 2.0
315 Requires: libbonobo >= 2.0
316 Requires: libbonoboui >= 2.0
317 Requires: bonobo-activation
322 %description gconsole
323 Bacula - It comes by night and sucks the vital essence from your computers.
325 Bacula is a set of computer programs that permit you (or the system
326 administrator) to manage backup, recovery, and verification of computer
327 data across a network of computers of different kinds. In technical terms,
328 it is a network client/server based backup program. Bacula is relatively
329 easy to use and efficient, while offering many advanced storage management
330 features that make it easy to find and recover lost or damaged files.
331 Bacula source code has been released under the GPL version 2 license.
333 This is the Gnome Console package. It is an add-on to the client package.
343 export LDFLAGS="-L/usr/lib/termcap"
354 # patches for the bundled sqlite scripts
356 # patch the make_sqlite_tables script for installation bindir
357 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
359 # patch the create_sqlite_database script for installation bindir
360 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
362 # patch the make_catalog_backup script for installation bindir
363 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
365 # patch the update_sqlite_tables script for installation bindir
366 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
370 --sbindir=/usr/sbin \
371 --sysconfdir=/etc/bacula \
372 --with-scriptdir=/etc/bacula \
373 --enable-smartalloc \
380 --with-sqlite=${cwd}/../depkgs/sqlite \
385 --with-working-dir=%{working_dir} \
386 --with-pid-dir=/var/run \
387 --with-subsys-dir=/var/lock/subsys
391 strip static-bacula-fd
397 mkdir -p $RPM_BUILD_ROOT/etc/init.d
398 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
399 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
400 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
401 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
402 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
403 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
404 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
407 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
411 prefix=$RPM_BUILD_ROOT/usr \
412 sbindir=$RPM_BUILD_ROOT/usr/sbin \
413 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
414 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
415 working_dir=$RPM_BUILD_ROOT%{working_dir} \
420 prefix=$RPM_BUILD_ROOT/usr \
421 sbindir=$RPM_BUILD_ROOT/usr/sbin \
422 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
423 working_dir=$RPM_BUILD_ROOT%{working_dir} \
424 mandir=$RPM_BUILD_ROOT/usr/man \
428 # fixme - make installs the mysql scripts for sqlite build
430 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
431 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
432 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
435 # fixme - make installs the mysql scripts for postgresql build
437 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
438 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
441 # install the init scripts
443 cp platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
444 cp platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
445 cp platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
447 cp platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
448 cp platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
449 cp platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
452 # install the menu stuff
453 cp scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
454 cp scripts/bacula.desktop.gnome1 $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
455 cp scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
459 cp ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
460 cp ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
461 cp ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
464 # install the logrotate file
465 cp scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
467 # install the rescue stuff
468 # these are the rescue scripts
469 cp rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
470 cp rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
471 cp rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
472 cp rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
473 cp rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
474 cp rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
475 cp rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
476 cp rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
477 cp rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
479 # this is the static file daemon
480 cp src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
482 # this is the tom's root boot disk
483 cp ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
485 # install the updatedb scripts
486 cp updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
489 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
494 %defattr(-,root,root)
496 %attr(0754,root,root) /etc/bacula/bacula
497 %attr(0754,root,root) /etc/bacula/bconsole
498 %attr(0754,root,root) /etc/bacula/fd
499 %attr(0754,root,root) /etc/bacula/gconsole
500 %attr(0754,root,root) /etc/bacula/create_mysql_database
501 %attr(0754,root,root) /etc/bacula/drop_mysql_database
502 %attr(0754,root,root) /etc/bacula/make_mysql_tables
503 %attr(0754,root,root) /etc/bacula/drop_mysql_tables
504 %attr(0754,root,root) /etc/bacula/update_mysql_tables
505 %attr(0754,root,root) /etc/bacula/grant_mysql_privileges
506 %attr(0754,root,root) /etc/bacula/create_bacula_database
507 %attr(0754,root,root) /etc/bacula/drop_bacula_database
508 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
509 %attr(0754,root,root) /etc/bacula/make_bacula_tables
510 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
511 %attr(0754,root,root) /etc/bacula/update_bacula_tables
512 %attr(0754,root,root) /etc/bacula/make_catalog_backup
513 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
514 %attr(0754,root,root) /etc/bacula/startmysql
515 %attr(0754,root,root) /etc/bacula/stopmysql
516 %attr(0754,root,root) /etc/bacula/mtx-changer
517 %attr(0754,root,root) /etc/init.d/bacula-dir
518 %attr(0754,root,root) /etc/init.d/bacula-fd
519 %attr(0754,root,root) /etc/init.d/bacula-sd
521 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
522 %attr(0644,root,root) /usr/man/man1/*
523 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
524 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
525 %attr(0644,root,root) /usr/share/applications/bacula.desktop
526 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
527 %attr(0644,root,root) /etc/logrotate.d/bacula
529 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
530 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
531 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
532 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
533 %attr(0640,root,root) /etc/bacula/query.sql
534 %attr(0640,root,root) %dir %{working_dir}
536 %attr(0750,root,root) /usr/sbin/*
537 %attr(0750,root,root) /etc/bacula/btraceback.gdb
540 # test for bacula database older than version 6
541 # note: this ASSUMES no password has been set for bacula database
542 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
544 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
545 echo "This bacula upgrade will update a bacula database from version 6 to 7."
546 echo "You appear to be running database version $DB_VER. You must first update"
547 echo "your database to version 6 and then install this upgrade. The alternative"
548 echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
549 echo "catalog information, then do the upgrade. Information on updating a"
550 echo "database older than version 6 can be found in the release notes."
553 # check for and copy /etc/bacula/console.conf to bconsole.conf
554 if [ -s /etc/bacula/console.conf ];then
555 cp /etc/bacula/console.conf /etc/bacula/bconsole.conf
559 # delete then add our links
560 /sbin/chkconfig --del bacula-dir
561 /sbin/chkconfig --del bacula-fd
562 /sbin/chkconfig --del bacula-sd
563 /sbin/chkconfig --add bacula-dir
564 /sbin/chkconfig --add bacula-fd
565 /sbin/chkconfig --add bacula-sd
567 # add execute permissions for console
568 chmod 0755 /usr/sbin/gnome-console
570 # test for an existing database
571 # note: this ASSUMES no password has been set for bacula database
572 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
574 # grant privileges and create tables if they do not exist
575 if [ -z "$DB_VER" ]; then
576 echo "Hmm, doesn't look like you have an existing database."
577 echo "Granting privileges for MySQL user bacula..."
578 /etc/bacula/grant_mysql_privileges
579 echo "Creating MySQL bacula database..."
580 /etc/bacula/create_mysql_database
581 echo "Creating bacula tables..."
582 /etc/bacula/make_mysql_tables
584 # check to see if we need to upgrade a 1.32 or lower database
585 elif [ "$DB_VER" -lt "7" ]; then
586 echo "This release requires an upgrade to your bacula database."
587 echo "Backing up your current database..."
588 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
589 echo "Upgrading bacula database ..."
590 /etc/bacula/update_mysql_tables
591 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
597 /sbin/chkconfig --del bacula-dir
598 /sbin/chkconfig --del bacula-fd
599 /sbin/chkconfig --del bacula-sd
606 %defattr(-,root,root)
608 %attr(0754,root,root) /etc/bacula/bacula
609 %attr(0754,root,root) /etc/bacula/bconsole
610 %attr(0754,root,root) /etc/bacula/fd
611 %attr(0754,root,root) /etc/bacula/gconsole
612 %attr(0754,root,root) /etc/bacula/create_bacula_database
613 %attr(0754,root,root) /etc/bacula/drop_bacula_database
614 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
615 %attr(0754,root,root) /etc/bacula/make_bacula_tables
616 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
617 %attr(0754,root,root) /etc/bacula/update_bacula_tables
618 %attr(0754,root,root) /etc/bacula/create_sqlite_database
619 %attr(0754,root,root) /etc/bacula/drop_sqlite_database
620 %attr(0754,root,root) /etc/bacula/grant_sqlite_privileges
621 %attr(0754,root,root) /etc/bacula/make_sqlite_tables
622 %attr(0754,root,root) /etc/bacula/drop_sqlite_tables
623 %attr(0754,root,root) /etc/bacula/update_sqlite_tables
624 %attr(0754,root,root) /etc/bacula/make_catalog_backup
625 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
626 %attr(0754,root,root) /etc/bacula/mtx-changer
627 %attr(0754,root,root) /etc/init.d/bacula-dir
628 %attr(0754,root,root) /etc/init.d/bacula-fd
629 %attr(0754,root,root) /etc/init.d/bacula-sd
631 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
632 %attr(0644,root,root) /usr/man/man1/*
633 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
634 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
635 %attr(0644,root,root) /usr/share/applications/bacula.desktop
636 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
637 %attr(0644,root,root) /etc/logrotate.d/bacula
639 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
640 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
641 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
642 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
643 %attr(0640,root,root) /etc/bacula/query.sql
644 %attr(0640,root,root) %{sqlite_bindir}/libsqlite.a
645 %attr(0640,root,root) %{sqlite_bindir}/sqlite.h
646 %attr(0640,root,root) %dir %{working_dir}
648 %attr(0750,root,root) /usr/sbin/*
649 %attr(0750,root,root) %{sqlite_bindir}/sqlite
650 %attr(0750,root,root) /etc/bacula/btraceback.gdb
653 # test for bacula database older than version 6
654 if [ -s %{working_dir}/bacula.db ];then
655 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
656 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
657 echo "This bacula upgrade will update a bacula database from version 6 to 7."
658 echo "You appear to be running database version $DB_VER. You must first update"
659 echo "your database to version 6 and then install this upgrade. The alternative"
660 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
661 echo "catalog information, then do the upgrade. Information on updating a"
662 echo "database older than version 6 can be found in the release notes."
666 # check for and copy /etc/bacula/console.conf to bconsole.conf
667 if [ -s /etc/bacula/console.conf ];then
668 cp /etc/bacula/console.conf /etc/bacula/bconsole.conf
672 # delete then add our links
673 /sbin/chkconfig --del bacula-dir
674 /sbin/chkconfig --del bacula-fd
675 /sbin/chkconfig --del bacula-sd
676 /sbin/chkconfig --add bacula-dir
677 /sbin/chkconfig --add bacula-fd
678 /sbin/chkconfig --add bacula-sd
680 # add execute permission for console
681 chmod 0755 /usr/sbin/gnome-console
683 # test for an existing database
684 if [ -s %{working_dir}/bacula.db ]; then
685 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
686 # check to see if we need to upgrade a 1.32 or lower database
687 if [ "$DB_VER" -lt "7" ]; then
688 echo "This release requires an upgrade to your bacula database."
689 echo "Backing up your current database..."
690 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
691 echo "Upgrading bacula database ..."
692 /etc/bacula/update_sqlite_tables
693 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
696 # create the database and tables
697 echo "Hmm, doesn't look like you have an existing database."
698 echo "Creating SQLite database..."
699 /etc/bacula/create_sqlite_database
700 echo "Creating the SQLite tables..."
701 /etc/bacula/make_sqlite_tables
706 /sbin/chkconfig --del bacula-dir
707 /sbin/chkconfig --del bacula-fd
708 /sbin/chkconfig --del bacula-sd
715 %defattr(-,root,root)
717 %attr(0754,root,root) /etc/bacula/bacula
718 %attr(0754,root,root) /etc/bacula/bconsole
719 %attr(0754,root,root) /etc/bacula/fd
720 %attr(0754,root,root) /etc/bacula/gconsole
721 %attr(0754,root,root) /etc/bacula/create_postgresql_database
722 %attr(0754,root,root) /etc/bacula/drop_postgresql_database
723 %attr(0754,root,root) /etc/bacula/make_postgresql_tables
724 %attr(0754,root,root) /etc/bacula/drop_postgresql_tables
725 %attr(0754,root,root) /etc/bacula/update_postgresql_tables
726 %attr(0754,root,root) /etc/bacula/grant_postgresql_privileges
727 %attr(0754,root,root) /etc/bacula/create_bacula_database
728 %attr(0754,root,root) /etc/bacula/drop_bacula_database
729 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
730 %attr(0754,root,root) /etc/bacula/make_bacula_tables
731 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
732 %attr(0754,root,root) /etc/bacula/update_bacula_tables
733 %attr(0754,root,root) /etc/bacula/make_catalog_backup
734 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
735 %attr(0754,root,root) /etc/bacula/mtx-changer
736 %attr(0754,root,root) /etc/init.d/bacula-dir
737 %attr(0754,root,root) /etc/init.d/bacula-fd
738 %attr(0754,root,root) /etc/init.d/bacula-sd
740 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
741 %attr(0644,root,root) /usr/man/man1/*
742 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
743 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
744 %attr(0644,root,root) /usr/share/applications/bacula.desktop
745 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
746 %attr(0644,root,root) /etc/logrotate.d/bacula
748 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
749 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
750 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
751 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
752 %attr(0640,root,root) /etc/bacula/query.sql
753 %attr(0640,root,root) %dir %{working_dir}
755 %attr(0750,root,root) /usr/sbin/*
756 %attr(0750,root,root) /etc/bacula/btraceback.gdb
759 # delete then add our links
760 /sbin/chkconfig --del bacula-dir
761 /sbin/chkconfig --del bacula-fd
762 /sbin/chkconfig --del bacula-sd
763 /sbin/chkconfig --add bacula-dir
764 /sbin/chkconfig --add bacula-fd
765 /sbin/chkconfig --add bacula-sd
767 # add execute permissions for console
768 chmod 0755 /usr/sbin/gnome-console
770 # test for an existing database
771 # note: this ASSUMES no password has been set for bacula database
772 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
774 # grant privileges and create tables if they do not exist
775 if [ -z "$DB_VER" ]; then
776 echo "Hmm, doesn't look like you have an existing database."
777 echo "Granting privileges for PostgreSQL user bacula..."
778 /etc/bacula/grant_postgresql_privileges
779 echo "Creating PostgreSQL bacula database..."
780 /etc/bacula/create_postgresql_database
781 echo "Creating bacula tables..."
782 /etc/bacula/make_postgresql_tables
786 /sbin/chkconfig --del bacula-dir
787 /sbin/chkconfig --del bacula-fd
788 /sbin/chkconfig --del bacula-sd
793 %defattr(-,root,root)
795 %attr(0754,root,root) /etc/bacula/fd
796 %attr(0754,root,root) /etc/bacula/bconsole
797 %attr(0754,root,root) /etc/init.d/bacula-fd
799 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
800 %attr(0644,root,root) /etc/logrotate.d/bacula
802 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
803 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
804 %attr(0640,root,root) %dir %{working_dir}
806 %attr(0750,root,root) /usr/sbin/bacula-fd
807 %attr(0750,root,root) /usr/sbin/btraceback
808 %attr(0750,root,root) /etc/bacula/btraceback.gdb
809 %attr(0750,root,root) /usr/sbin/bsmtp
810 %attr(0750,root,root) /usr/sbin/bconsole
814 # delete then add our links
815 /sbin/chkconfig --del bacula-fd
816 /sbin/chkconfig --add bacula-fd
820 /sbin/chkconfig --del bacula-fd
823 %defattr(-,root,root)
824 %attr(0644,root,root) /etc/bacula/rescue/backup.etc.list
825 %attr(0754,root,root) /etc/bacula/rescue/format_floppy
826 %attr(0754,root,root) /etc/bacula/rescue/getdiskinfo
827 %attr(0754,root,root) /etc/bacula/rescue/make_rescue_disk
828 %attr(0754,root,root) /etc/bacula/rescue/restore_bacula
829 %attr(0754,root,root) /etc/bacula/rescue/restore_etc
830 %attr(0754,root,root) /etc/bacula/rescue/run_grub
831 %attr(0754,root,root) /etc/bacula/rescue/run_lilo
832 %attr(0644,root,root) /etc/bacula/rescue/sfdisk.bz2
833 %attr(0754,root,root) /etc/bacula/rescue/bacula-fd
834 /etc/bacula/rescue/tomsrtbt/*
837 # link our current installed conf file to the rescue directory
838 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
841 echo "Ready to create the rescue files for this system."
842 echo "Press <enter> to continue..."
847 echo "Running getdiskinfo..."
848 cd /etc/bacula/rescue
853 echo "To create a boot disk run \"./install.s\" from the /etc/bacula/rescue/tomsrtbt/"
854 echo "directory. To make the bacula rescue disk run"
855 echo "\"./make_rescue_disk --copy-static-bacula --copy-etc-files\" "
856 echo "from the /etc/bacula/rescue directory. To recreate the rescue"
857 echo "information for this system run ./getdiskinfo again."
861 # remove the files created after the initial rpm installation
862 rm -f /etc/bacula/rescue/bacula-fd.conf
863 rm -f /etc/bacula/rescue/partition.*
864 rm -f /etc/bacula/rescue/format.*
865 rm -f /etc/bacula/rescue/mount_drives
866 rm -f /etc/bacula/rescue/start_network
867 rm -f /etc/bacula/rescue/sfdisk
868 rm -rf /etc/bacula/rescue/diskinfo/*
871 %defattr(-,root,root)
872 %attr(0644,root,root) /etc/bacula/updatedb/*
875 echo "The database update scripts were installed to /etc/bacula/updatedb"
878 %defattr(-,root,root)
879 %attr(0750,root,root) /usr/sbin/gnome-console
880 %attr(0754,root,root) /etc/bacula/gconsole
881 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
882 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
883 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
884 %attr(0644,root,root) /usr/share/applications/bacula.desktop
890 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
891 - added bconsole to client package
892 - added gconsole package as add-on to client
893 - removed spurious dependancies on updatedb package (!cut/paste)
894 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
895 - added updatedb package
896 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
897 - added postgresql package
898 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
899 - corrected the if else logic in the dependancy sections
900 - changes for 1.34 release
901 - /etc/bacula/console is now /etc/bacula/bconsole
902 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
903 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
904 - /usr/sbin/smtp is now /usr/sbin/bsmtp
905 - added new /etc/bacula/drop_mysql_database
906 - added new /etc/bacula/drop_sqlite_database
907 - added new /etc/bacula/grant_sqlite_privileges
908 - added new generic bacula database scripts in /etc/bacula
909 - added pre-install sections to check for database versions older than 6
910 - added check for /etc/bacula/console.conf and copy to bconsole.conf
911 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
912 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
913 - added testing for existing databases before executing any of the database creation scripts
914 - added defines working_dir and sqlite_bindir in place of hard coded paths
915 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
916 - added build configuration for SuSE.
917 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
918 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
919 - added patch for create_sqlite_database to fix the installed bindir
920 - added execute of create_sqlite_database to post of sqlite package
921 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
922 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
923 - added bacula-fd as Requires for rescue package
924 - added build tag for Fedora Core 1
925 - cleaned up dependancies for all builds
926 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
927 - removed rh_version from package names
928 - added platform build configuration section to beginning of file
929 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
930 - removed make_static_bacula script from rescue package install
931 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
932 - Added define at top of file for depkgs version
933 - Added rescue sub-package
934 - Moved requires statements into proper sub-package locations
935 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
936 - Corrected Requires for Gnome 1.4/2.0 builds
937 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
938 - Added separate Source declaration for depkgs
939 - added patch for make_catalog_backup script
940 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
941 - Misc changes to mysql/sqlite build and rh7/8 menu differences
942 - Added rh_version to sub-package names
943 - Added installed but missing file /etc/bacula/gconsole
944 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
945 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
946 - Update spec for version 1.31 and combine client
947 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>