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
125 Requires: readline, perl, atk, ncurses, pango, libstdc++
126 Requires: libxml2, zlib
128 Requires: gtk+ >= 1.2
129 Requires: gnome-libs >= 1.4
130 Requires: glibc >= 2.2
137 Requires: gtk2 >= 2.0
138 Requires: libgnomeui >= 2.0
139 Requires: glibc >= 2.3
141 Requires: libart_lgpl >= 2.0
142 Requires: libbonobo >= 2.0
143 Requires: libbonoboui >= 2.0
144 Requires: bonobo-activation
149 %if ! %{rh7} && ! %{su9}
150 Requires: gtk2 >= 2.0
151 Requires: libgnomeui >= 2.0
152 Requires: glibc >= 2.3
154 Requires: libart_lgpl >= 2.0
155 Requires: libbonobo >= 2.0
156 Requires: libbonoboui >= 2.0
157 Requires: bonobo-activation
163 Requires: mysql >= 3.23
164 Requires: mysql-server >= 3.23
166 %if %{postgresql} && %{wb3}
167 Requires: rh-postgresql >= 7
168 Requires: rh-postgresql-server >= 7
170 %if %{postgresql} && ! %{wb3}
171 Requires: postgresql >= 7
172 Requires: postgresql-server >= 7
182 %description postgresql
185 Bacula - It comes by night and sucks the vital essence from your computers.
187 Bacula is a set of computer programs that permit you (or the system
188 administrator) to manage backup, recovery, and verification of computer
189 data across a network of computers of different kinds. In technical terms,
190 it is a network client/server based backup program. Bacula is relatively
191 easy to use and efficient, while offering many advanced storage management
192 features that make it easy to find and recover lost or damaged files.
193 Bacula source code has been released under the GPL version 2 license.
196 This build requires MySQL to be installed separately as the catalog database.
199 This build requires PostgreSQL to be installed separately as the catalog database.
202 This build incorporates sqlite as the catalog database, statically compiled.
206 Summary: Bacula - The Network Backup Solution
207 Group: System Environment/Daemons
209 Requires: readline, perl, libstdc++, zlib
211 Requires: gtk+ >= 1.2
212 Requires: gnome-libs >= 1.4
213 Requires: glibc >= 2.2
215 Requires: gtk2 >= 2.0
216 Requires: libgnomeui >= 2.0
217 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.
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 or bacula-client package for
256 your platform installed and configured before installing this package.
260 Summary: Bacula - The Network Backup Solution
261 Group: System Environment/Daemons
262 Requires: coreutils, util-linux, libc5, bacula-fd
264 %description updatedb
265 Bacula - It comes by night and sucks the vital essence from your computers.
267 Bacula is a set of computer programs that permit you (or the system
268 administrator) to manage backup, recovery, and verification of computer
269 data across a network of computers of different kinds. In technical terms,
270 it is a network client/server based backup program. Bacula is relatively
271 easy to use and efficient, while offering many advanced storage management
272 features that make it easy to find and recover lost or damaged files.
273 Bacula source code has been released under the GPL version 2 license.
275 This package installs scripts for updating older versions of the bacula
286 export LDFLAGS="-L/usr/lib/termcap"
297 # patches for the bundled sqlite scripts
299 # patch the make_sqlite_tables script for installation bindir
300 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
302 # patch the create_sqlite_database script for installation bindir
303 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
305 # patch the make_catalog_backup script for installation bindir
306 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
308 # patch the update_sqlite_tables script for installation bindir
309 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
313 --sbindir=/usr/sbin \
314 --sysconfdir=/etc/bacula \
315 --with-scriptdir=/etc/bacula \
316 --enable-smartalloc \
323 --with-sqlite=${cwd}/../depkgs/sqlite \
328 --with-working-dir=%{working_dir} \
329 --with-pid-dir=/var/run \
330 --with-subsys-dir=/var/lock/subsys
334 strip static-bacula-fd
340 mkdir -p $RPM_BUILD_ROOT/etc/init.d
341 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
342 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
343 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
344 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
345 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
346 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
347 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
350 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
354 prefix=$RPM_BUILD_ROOT/usr \
355 sbindir=$RPM_BUILD_ROOT/usr/sbin \
356 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
357 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
358 working_dir=$RPM_BUILD_ROOT%{working_dir} \
363 prefix=$RPM_BUILD_ROOT/usr \
364 sbindir=$RPM_BUILD_ROOT/usr/sbin \
365 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
366 working_dir=$RPM_BUILD_ROOT%{working_dir} \
367 mandir=$RPM_BUILD_ROOT/usr/man \
371 # fixme - make installs the mysql scripts for sqlite build
373 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
374 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
375 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
378 # fixme - make installs the mysql scripts for postgresql build
380 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
381 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
384 # install the init scripts
386 cp platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
387 cp platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
388 cp platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
390 cp platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
391 cp platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
392 cp platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
395 # install the menu stuff
396 cp scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
397 cp scripts/bacula.desktop.gnome1 $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
398 cp scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
402 cp ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
403 cp ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
404 cp ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
407 # install the logrotate file
408 cp scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
410 # install the rescue stuff
411 # these are the rescue scripts
412 cp rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
413 cp rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
414 cp rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
415 cp rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
416 cp rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
417 cp rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
418 cp rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
419 cp rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
420 cp rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
422 # this is the static file daemon
423 cp src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
425 # this is the tom's root boot disk
426 cp ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
428 # install the updatedb scripts
429 cp updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
432 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
437 %defattr(-,root,root)
439 %attr(0754,root,root) /etc/bacula/bacula
440 %attr(0754,root,root) /etc/bacula/bconsole
441 %attr(0754,root,root) /etc/bacula/fd
442 %attr(0754,root,root) /etc/bacula/gconsole
443 %attr(0754,root,root) /etc/bacula/create_mysql_database
444 %attr(0754,root,root) /etc/bacula/drop_mysql_database
445 %attr(0754,root,root) /etc/bacula/make_mysql_tables
446 %attr(0754,root,root) /etc/bacula/drop_mysql_tables
447 %attr(0754,root,root) /etc/bacula/update_mysql_tables
448 %attr(0754,root,root) /etc/bacula/grant_mysql_privileges
449 %attr(0754,root,root) /etc/bacula/create_bacula_database
450 %attr(0754,root,root) /etc/bacula/drop_bacula_database
451 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
452 %attr(0754,root,root) /etc/bacula/make_bacula_tables
453 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
454 %attr(0754,root,root) /etc/bacula/update_bacula_tables
455 %attr(0754,root,root) /etc/bacula/make_catalog_backup
456 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
457 %attr(0754,root,root) /etc/bacula/startmysql
458 %attr(0754,root,root) /etc/bacula/stopmysql
459 %attr(0754,root,root) /etc/bacula/mtx-changer
460 %attr(0754,root,root) /etc/init.d/bacula-dir
461 %attr(0754,root,root) /etc/init.d/bacula-fd
462 %attr(0754,root,root) /etc/init.d/bacula-sd
464 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
465 %attr(0644,root,root) /usr/man/man1/*
466 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
467 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
468 %attr(0644,root,root) /usr/share/applications/bacula.desktop
469 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
470 %attr(0644,root,root) /etc/logrotate.d/bacula
472 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
473 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
474 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
475 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
476 %attr(0640,root,root) /etc/bacula/query.sql
477 %attr(0640,root,root) %dir %{working_dir}
479 %attr(0750,root,root) /usr/sbin/*
480 %attr(0750,root,root) /etc/bacula/btraceback.gdb
483 # test for bacula database older than version 6
484 # note: this ASSUMES no password has been set for bacula database
485 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
487 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
488 echo "This bacula upgrade will update a bacula database from version 6 to 7."
489 echo "You appear to be running database version $DB_VER. You must first update"
490 echo "your database to version 6 and then install this upgrade. The alternative"
491 echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
492 echo "catalog information, then do the upgrade. Information on updating a"
493 echo "database older than version 6 can be found in the release notes."
496 # check for and copy /etc/bacula/console.conf to bconsole.conf
497 if [ -s /etc/bacula/console.conf ];then
498 cp /etc/bacula/console.conf /etc/bacula/bconsole.conf
502 # delete then add our links
503 /sbin/chkconfig --del bacula-dir
504 /sbin/chkconfig --del bacula-fd
505 /sbin/chkconfig --del bacula-sd
506 /sbin/chkconfig --add bacula-dir
507 /sbin/chkconfig --add bacula-fd
508 /sbin/chkconfig --add bacula-sd
510 # add execute permissions for console
511 chmod 0755 /usr/sbin/gnome-console
513 # test for an existing database
514 # note: this ASSUMES no password has been set for bacula database
515 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
517 # grant privileges and create tables if they do not exist
518 if [ -z "$DB_VER" ]; then
519 echo "Hmm, doesn't look like you have an existing database."
520 echo "Granting privileges for MySQL user bacula..."
521 /etc/bacula/grant_mysql_privileges
522 echo "Creating MySQL bacula database..."
523 /etc/bacula/create_mysql_database
524 echo "Creating bacula tables..."
525 /etc/bacula/make_mysql_tables
527 # check to see if we need to upgrade a 1.32 or lower database
528 elif [ "$DB_VER" -lt "7" ]; then
529 echo "This release requires an upgrade to your bacula database."
530 echo "Backing up your current database..."
531 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
532 echo "Upgrading bacula database ..."
533 /etc/bacula/update_mysql_tables
534 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
540 /sbin/chkconfig --del bacula-dir
541 /sbin/chkconfig --del bacula-fd
542 /sbin/chkconfig --del bacula-sd
549 %defattr(-,root,root)
551 %attr(0754,root,root) /etc/bacula/bacula
552 %attr(0754,root,root) /etc/bacula/bconsole
553 %attr(0754,root,root) /etc/bacula/fd
554 %attr(0754,root,root) /etc/bacula/gconsole
555 %attr(0754,root,root) /etc/bacula/create_bacula_database
556 %attr(0754,root,root) /etc/bacula/drop_bacula_database
557 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
558 %attr(0754,root,root) /etc/bacula/make_bacula_tables
559 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
560 %attr(0754,root,root) /etc/bacula/update_bacula_tables
561 %attr(0754,root,root) /etc/bacula/create_sqlite_database
562 %attr(0754,root,root) /etc/bacula/drop_sqlite_database
563 %attr(0754,root,root) /etc/bacula/grant_sqlite_privileges
564 %attr(0754,root,root) /etc/bacula/make_sqlite_tables
565 %attr(0754,root,root) /etc/bacula/drop_sqlite_tables
566 %attr(0754,root,root) /etc/bacula/update_sqlite_tables
567 %attr(0754,root,root) /etc/bacula/make_catalog_backup
568 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
569 %attr(0754,root,root) /etc/bacula/mtx-changer
570 %attr(0754,root,root) /etc/init.d/bacula-dir
571 %attr(0754,root,root) /etc/init.d/bacula-fd
572 %attr(0754,root,root) /etc/init.d/bacula-sd
574 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
575 %attr(0644,root,root) /usr/man/man1/*
576 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
577 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
578 %attr(0644,root,root) /usr/share/applications/bacula.desktop
579 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
580 %attr(0644,root,root) /etc/logrotate.d/bacula
582 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
583 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
584 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
585 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
586 %attr(0640,root,root) /etc/bacula/query.sql
587 %attr(0640,root,root) %{sqlite_bindir}/libsqlite.a
588 %attr(0640,root,root) %{sqlite_bindir}/sqlite.h
589 %attr(0640,root,root) %dir %{working_dir}
591 %attr(0750,root,root) /usr/sbin/*
592 %attr(0750,root,root) %{sqlite_bindir}/sqlite
593 %attr(0750,root,root) /etc/bacula/btraceback.gdb
596 # test for bacula database older than version 6
597 if [ -s %{working_dir}/bacula.db ];then
598 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
599 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
600 echo "This bacula upgrade will update a bacula database from version 6 to 7."
601 echo "You appear to be running database version $DB_VER. You must first update"
602 echo "your database to version 6 and then install this upgrade. The alternative"
603 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
604 echo "catalog information, then do the upgrade. Information on updating a"
605 echo "database older than version 6 can be found in the release notes."
609 # check for and copy /etc/bacula/console.conf to bconsole.conf
610 if [ -s /etc/bacula/console.conf ];then
611 cp /etc/bacula/console.conf /etc/bacula/bconsole.conf
615 # delete then add our links
616 /sbin/chkconfig --del bacula-dir
617 /sbin/chkconfig --del bacula-fd
618 /sbin/chkconfig --del bacula-sd
619 /sbin/chkconfig --add bacula-dir
620 /sbin/chkconfig --add bacula-fd
621 /sbin/chkconfig --add bacula-sd
623 # add execute permission for console
624 chmod 0755 /usr/sbin/gnome-console
626 # test for an existing database
627 if [ -s %{working_dir}/bacula.db ]; then
628 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
629 # check to see if we need to upgrade a 1.32 or lower database
630 if [ "$DB_VER" -lt "7" ]; then
631 echo "This release requires an upgrade to your bacula database."
632 echo "Backing up your current database..."
633 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
634 echo "Upgrading bacula database ..."
635 /etc/bacula/update_sqlite_tables
636 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
639 # create the database and tables
640 echo "Hmm, doesn't look like you have an existing database."
641 echo "Creating SQLite database..."
642 /etc/bacula/create_sqlite_database
643 echo "Creating the SQLite tables..."
644 /etc/bacula/make_sqlite_tables
649 /sbin/chkconfig --del bacula-dir
650 /sbin/chkconfig --del bacula-fd
651 /sbin/chkconfig --del bacula-sd
658 %defattr(-,root,root)
660 %attr(0754,root,root) /etc/bacula/bacula
661 %attr(0754,root,root) /etc/bacula/bconsole
662 %attr(0754,root,root) /etc/bacula/fd
663 %attr(0754,root,root) /etc/bacula/gconsole
664 %attr(0754,root,root) /etc/bacula/create_postgresql_database
665 %attr(0754,root,root) /etc/bacula/drop_postgresql_database
666 %attr(0754,root,root) /etc/bacula/make_postgresql_tables
667 %attr(0754,root,root) /etc/bacula/drop_postgresql_tables
668 %attr(0754,root,root) /etc/bacula/update_postgresql_tables
669 %attr(0754,root,root) /etc/bacula/grant_postgresql_privileges
670 %attr(0754,root,root) /etc/bacula/create_bacula_database
671 %attr(0754,root,root) /etc/bacula/drop_bacula_database
672 %attr(0754,root,root) /etc/bacula/grant_bacula_privileges
673 %attr(0754,root,root) /etc/bacula/make_bacula_tables
674 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
675 %attr(0754,root,root) /etc/bacula/update_bacula_tables
676 %attr(0754,root,root) /etc/bacula/make_catalog_backup
677 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
678 %attr(0754,root,root) /etc/bacula/mtx-changer
679 %attr(0754,root,root) /etc/init.d/bacula-dir
680 %attr(0754,root,root) /etc/init.d/bacula-fd
681 %attr(0754,root,root) /etc/init.d/bacula-sd
683 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
684 %attr(0644,root,root) /usr/man/man1/*
685 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
686 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
687 %attr(0644,root,root) /usr/share/applications/bacula.desktop
688 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
689 %attr(0644,root,root) /etc/logrotate.d/bacula
691 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
692 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
693 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
694 %attr(0640,root,root) %config(noreplace) /etc/bacula/bconsole.conf
695 %attr(0640,root,root) /etc/bacula/query.sql
696 %attr(0640,root,root) %dir %{working_dir}
698 %attr(0750,root,root) /usr/sbin/*
699 %attr(0750,root,root) /etc/bacula/btraceback.gdb
702 # delete then add our links
703 /sbin/chkconfig --del bacula-dir
704 /sbin/chkconfig --del bacula-fd
705 /sbin/chkconfig --del bacula-sd
706 /sbin/chkconfig --add bacula-dir
707 /sbin/chkconfig --add bacula-fd
708 /sbin/chkconfig --add bacula-sd
710 # add execute permissions for console
711 chmod 0755 /usr/sbin/gnome-console
713 # test for an existing database
714 # note: this ASSUMES no password has been set for bacula database
715 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
717 # grant privileges and create tables if they do not exist
718 if [ -z "$DB_VER" ]; then
719 echo "Hmm, doesn't look like you have an existing database."
720 echo "Granting privileges for PostgreSQL user bacula..."
721 /etc/bacula/grant_postgresql_privileges
722 echo "Creating PostgreSQL bacula database..."
723 /etc/bacula/create_postgresql_database
724 echo "Creating bacula tables..."
725 /etc/bacula/make_postgresql_tables
729 /sbin/chkconfig --del bacula-dir
730 /sbin/chkconfig --del bacula-fd
731 /sbin/chkconfig --del bacula-sd
736 %defattr(-,root,root)
738 %attr(0754,root,root) /etc/bacula/fd
739 %attr(0754,root,root) /etc/init.d/bacula-fd
741 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
742 %attr(0644,root,root) /etc/logrotate.d/bacula
744 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
745 %attr(0640,root,root) %dir %{working_dir}
747 %attr(0750,root,root) /usr/sbin/bacula-fd
748 %attr(0750,root,root) /usr/sbin/btraceback
749 %attr(0750,root,root) /etc/bacula/btraceback.gdb
750 %attr(0750,root,root) /usr/sbin/bsmtp
754 # delete then add our links
755 /sbin/chkconfig --del bacula-fd
756 /sbin/chkconfig --add bacula-fd
760 /sbin/chkconfig --del bacula-fd
763 %defattr(-,root,root)
764 %attr(0644,root,root) /etc/bacula/rescue/backup.etc.list
765 %attr(0754,root,root) /etc/bacula/rescue/format_floppy
766 %attr(0754,root,root) /etc/bacula/rescue/getdiskinfo
767 %attr(0754,root,root) /etc/bacula/rescue/make_rescue_disk
768 %attr(0754,root,root) /etc/bacula/rescue/restore_bacula
769 %attr(0754,root,root) /etc/bacula/rescue/restore_etc
770 %attr(0754,root,root) /etc/bacula/rescue/run_grub
771 %attr(0754,root,root) /etc/bacula/rescue/run_lilo
772 %attr(0644,root,root) /etc/bacula/rescue/sfdisk.bz2
773 %attr(0754,root,root) /etc/bacula/rescue/bacula-fd
774 /etc/bacula/rescue/tomsrtbt/*
777 # link our current installed conf file to the rescue directory
778 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
781 echo "Ready to create the rescue files for this system."
782 echo "Press <enter> to continue..."
787 echo "Running getdiskinfo..."
788 cd /etc/bacula/rescue
793 echo "To create a boot disk run \"./install.s\" from the /etc/bacula/rescue/tomsrtbt/"
794 echo "directory. To make the bacula rescue disk run"
795 echo "\"./make_rescue_disk --copy-static-bacula --copy-etc-files\" "
796 echo "from the /etc/bacula/rescue directory. To recreate the rescue"
797 echo "information for this system run ./getdiskinfo again."
801 # remove the files created after the initial rpm installation
802 rm -f /etc/bacula/rescue/bacula-fd.conf
803 rm -f /etc/bacula/rescue/partition.*
804 rm -f /etc/bacula/rescue/format.*
805 rm -f /etc/bacula/rescue/mount_drives
806 rm -f /etc/bacula/rescue/start_network
807 rm -f /etc/bacula/rescue/sfdisk
808 rm -rf /etc/bacula/rescue/diskinfo/*
811 %defattr(-,root,root)
812 %attr(0644,root,root) /etc/bacula/updatedb/*
815 echo "The database update scripts were installed to /etc/bacula/updatedb"
818 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
819 - added updatedb package
820 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
821 - added postgresql package
822 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
823 - corrected the if else logic in the dependancy sections
824 - changes for 1.34 release
825 - /etc/bacula/console is now /etc/bacula/bconsole
826 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
827 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
828 - /usr/sbin/smtp is now /usr/sbin/bsmtp
829 - added new /etc/bacula/drop_mysql_database
830 - added new /etc/bacula/drop_sqlite_database
831 - added new /etc/bacula/grant_sqlite_privileges
832 - added new generic bacula database scripts in /etc/bacula
833 - added pre-install sections to check for database versions older than 6
834 - added check for /etc/bacula/console.conf and copy to bconsole.conf
835 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
836 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
837 - added testing for existing databases before executing any of the database creation scripts
838 - added defines working_dir and sqlite_bindir in place of hard coded paths
839 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
840 - added build configuration for SuSE.
841 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
842 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
843 - added patch for create_sqlite_database to fix the installed bindir
844 - added execute of create_sqlite_database to post of sqlite package
845 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
846 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
847 - added bacula-fd as Requires for rescue package
848 - added build tag for Fedora Core 1
849 - cleaned up dependancies for all builds
850 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
851 - removed rh_version from package names
852 - added platform build configuration section to beginning of file
853 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
854 - removed make_static_bacula script from rescue package install
855 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
856 - Added define at top of file for depkgs version
857 - Added rescue sub-package
858 - Moved requires statements into proper sub-package locations
859 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
860 - Corrected Requires for Gnome 1.4/2.0 builds
861 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
862 - Added separate Source declaration for depkgs
863 - added patch for make_catalog_backup script
864 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
865 - Misc changes to mysql/sqlite build and rh7/8 menu differences
866 - Added rh_version to sub-package names
867 - Added installed but missing file /etc/bacula/gconsole
868 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
869 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
870 - Update spec for version 1.31 and combine client
871 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>