5 Summary: Bacula - The Network Backup Solution
10 Group: Networking/Utilities
12 Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
13 # Source0-md5: 9de593cb206df126a8e27774281c5bf6
14 Source1: http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz
15 # Source1-md5: d5ee50efb28986d564547d5da5de2483
16 Source2: %{name}-manpages.tar.bz2
17 # Source2-md5: e4dae86d6574b360e831efd3913e7f4c
18 Source10: %{name}-dir.init
19 Source11: %{name}-fd.init
20 Source12: %{name}-sd.init
21 Source13: %{name}.logrotate
22 Patch0: %{name}-pidfile.patch
23 URL: http://www.bacula.org/
25 BuildRequires: wxGTK2-devel
26 BuildRequires: openssl-devel
27 BuildRequires: pkgconfig
28 BuildRequires: ncurses-devel
29 BuildRequires: readline-devel
30 BuildRequires: sqlite2-devel
31 BuildRequires: libwrap-devel
32 BuildRequires: zlib-devel
33 BuildRequires: acl-devel
34 BuildRequires: libstdc++-devel
35 BuildRequires: glibc-static
36 BuildRequires: acl-static
37 BuildRequires: libwrap-static
38 BuildRequires: libstdc++-static
39 BuildRequires: sed >= 4.0
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 %define _sysconfdir /etc/%{name}
43 %define _localstatedir /var/lib/%{name}
46 Bacula - It comes by night and sucks the vital essence from your
49 Bacula is a set of computer programs that permit you (or the system
50 administrator) to manage backup, recovery, and verification of
51 computer data across a network of computers of different kinds. In
52 technical terms, it is a network client/server based backup program.
53 Bacula is relatively easy to use and efficient, while offering many
54 advanced storage management features that make it easy to find and
55 recover lost or damaged files.
58 Summary: Common files for bacula package
59 Group: Networking/Utilities
60 Conflicts: bacula-dir < %{epoch}:%{version}-%{release}
61 Conflicts: bacula-fd < %{epoch}:%{version}-%{release}
62 Conflicts: bacula-sd < %{epoch}:%{version}-%{release}
63 Conflicts: bacula-console < %{epoch}:%{version}-%{release}
66 Bacula - It comes by night and sucks the vital essence from your
69 Bacula is a set of computer programs that permit you (or the system
70 administrator) to manage backup, recovery, and verification of
71 computer data across a network of computers of different kinds. In
72 technical terms, it is a network client/server based backup program.
73 Bacula is relatively easy to use and efficient, while offering many
74 advanced storage management features that make it easy to find and
75 recover lost or damaged files.
78 Summary: Bacula Director and Catalog services
79 Group: Networking/Utilities
80 Prereq: bacula-common = %{epoch}:%{version}-%{release}
83 Bacula - It comes by night and sucks the vital essence from your
86 Bacula Director is the program that supervises all the backup,
87 restore, verify and archive operations. The system administrator uses
88 the Bacula Director to schedule backups and to recover files. Catalog
89 services are comprised of the software programs responsible for
90 maintaining the file indexes and volume databases for all files backed
91 up. The Catalog services permit the System Administrator or user to
92 quickly locate and restore any desired file, since it maintains a
93 record of all Volumes used, all Jobs run, and all Files saved. This
94 build requires sqlite to be installed separately as the catalog
98 Summary: Bacula Console
99 Group: Networking/Utilities
100 Prereq: bacula-common = %{epoch}:%{version}-%{release}
103 Bacula - It comes by night and sucks the vital essence from your
106 Bacula Console is the program that allows the administrator or user to
107 communicate with the Bacula Director. This is the text only console
111 Summary: Bacula wxWindows Console
112 Group: Networking/Utilities
113 Prereq: bacula-common = %{epoch}:%{version}-%{release}
115 %description console-wx
116 Bacula - It comes by night and sucks the vital essence from your
119 Bacula Console is the program that allows the administrator or user to
120 communicate with the Bacula Director. This is the wxWindows GUI
124 Summary: Bacula File services (Client)
125 Group: Networking/Utilities
126 Prereq: bacula-common = %{epoch}:%{version}-%{release}
129 Bacula - It comes by night and sucks the vital essence from your
132 Bacula File services (or Client program) is the software program that
133 is installed on the machine to be backed up. It is specific to the
134 operating system on which it runs and is responsible for providing the
135 file attributes and data when requested by the Director. The File
136 services are also responsible for the file system dependent part of
137 restoring the file attributes and data during a recovery operation.
138 This program runs as a daemon on the machine to be backed up, and in
139 some of the documentation, the File daemon is referred to as the
140 Client (for example in Bacula configuration file).
143 Summary: Bacula Storage services
144 Group: Networking/Utilities
145 Prereq: bacula-common = %{epoch}:%{version}-%{release}
148 Bacula - It comes by night and sucks the vital essence from your
151 Bacula Storage services consist of the software programs that perform
152 the storage and recovery of the file attributes and data to the
153 physical backup media or volumes. In other words, the Storage daemon
154 is responsible for reading and writing your tapes (or other storage
155 media, e.g. files). The Storage services runs as a daemon on the
156 machine that has the backup device (usually a tape drive).
159 Summary: Bacula - The Network Backup Solution
160 Group: Networking/Utilities
166 Bacula - It comes by night and sucks the vital essence from your
169 Bacula is a set of computer programs that permit you (or the system
170 administrator) to manage backup, recovery, and verification of
171 computer data across a network of computers of different kinds. In
172 technical terms, it is a network client/server based backup program.
173 Bacula is relatively easy to use and efficient, while offering many
174 advanced storage management features that make it easy to find and
175 recover lost or damaged files. Bacula source code has been released
176 under the GPL version 2 license.
178 This package installs scripts for disaster recovery and builds rescue
179 floppy disks for bare metal recovery. This package includes tomsrtbt
180 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a
181 tool to build a boot floppy disk.
183 To create a boot disk run "./getdiskinfo" from the
184 %{_sysconfdir}/rescue directory (this is done when the package is
185 first installed), then run "./install.s" from the
186 %{_sysconfdir}/rescue/tomsrtbt/ directory. To make the bacula rescue
187 disk run "./make_rescue_disk --copy-static-bacula
188 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
189 recreate the rescue information for this system run ./getdiskinfo
193 Summary: Bacula - The Network Backup Solution
194 Group: Networking/Utilities
196 %description updatedb
197 Bacula - It comes by night and sucks the vital essence from your
200 Bacula is a set of computer programs that permit you (or the system
201 administrator) to manage backup, recovery, and verification of
202 computer data across a network of computers of different kinds. In
203 technical terms, it is a network client/server based backup program.
204 Bacula is relatively easy to use and efficient, while offering many
205 advanced storage management features that make it easy to find and
206 recover lost or damaged files. Bacula source code has been released
207 under the GPL version 2 license.
209 This package installs scripts for updating older versions of the
215 sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure*
216 sed -i -e 's#-lreadline -ltermcap#-lreadline#g' configure*
217 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
218 src/cats/create_* src/cats/delete_* src/cats/drop_* \
219 src/cats/grant_* src/cats/make_* src/cats/update_*
222 CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
224 --with-scriptdir=%{_libexecdir}/%{name} \
227 --enable-smartalloc \
228 --enable-wx-console \
230 --with-tcp-wrappers \
231 --with-working-dir=%{_var}/lib/%{name} \
232 --with-dump-email="root@localhost" \
233 --with-job-email="root@localhost" \
234 --with-smtp-host=localhost \
235 --with-pid-dir=/var/run \
236 --with-subsys-dir=/var/lock/subsys \
239 --with-dir-password="#FAKE#DIR#PASSWORD#PLD#" \
240 --with-fd-password="#FAKE#FD#PASSWORD#PLD#" \
241 --with-sd-password="#FAKE#SD#PASSWORD#PLD#"
246 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,security/console.apps}
249 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rescue/tomsrtbt,updatedb}
250 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_mandir},%{_bindir}}
253 DESTDIR=$RPM_BUILD_ROOT
256 strip src/filed/static-bacula-fd
257 install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
259 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
260 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
261 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
262 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
264 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
266 # install the rescue stuff, these are the rescue scripts
267 install rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
268 install rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
269 install rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
270 install rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
271 install rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
272 install rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
273 install rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
274 install rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
275 install rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
277 # this is the tom's root boot disk
278 install tomsrtbt-*/* $RPM_BUILD_ROOT%{_sysconfdir}/rescue/tomsrtbt/
280 # install the updatedb scripts
281 install updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/updatedb/
284 cp -a man1 man8 $RPM_BUILD_ROOT%{_mandir}
286 install -d html-manual
287 cp -a doc/html-manual/*.{html,jpg,gif,css} html-manual/
290 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
291 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
292 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/gnome*
293 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
295 cat << EOF > $RPM_BUILD_ROOT/etc/security/console.apps/bconsole
297 PROGRAM=%{_sbindir}/bconsole
300 install scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/bconsole
301 ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/bconsole
303 cat << EOF > $RPM_BUILD_ROOT/etc/security/console.apps/wx-console
305 PROGRAM=%{_sbindir}/wx-console
308 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/wx-console
309 ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/wx-console
312 if [ -n "`getgid bacula`" ]; then
313 if [ "`getgid bacula`" != "136" ]; then
314 echo "Error: group bacula doesn't have gid=136. Correct this before installing bacula." 1>&2
318 /usr/sbin/groupadd -g 136 -r -f bacula
320 if [ -n "`id -u bacula 2>/dev/null`" ]; then
321 if [ "`id -u bacula`" != "136" ]; then
322 echo "Error: user bacula doesn't have uid=136. Correct this before installing bacula." 1>&2
326 /usr/sbin/useradd -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula 1>&2
330 if [ "$1" = "0" ]; then
337 [ -s %{_localstatedir}/bacula.db ] && \
338 DB_VER=`echo "select * from Version;" | \
339 %{_bindir}/sqlite %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
340 if [ -z "$DB_VER" ]; then
341 # grant privileges and create tables
342 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
343 %{_libexecdir}/%{name}/create_bacula_database > dev/null
344 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
345 elif [ "$DB_VER" -lt "7" ]; then
346 echo "Backing up bacula tables"
347 echo ".dump" | sqlite %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
349 echo "Upgrading bacula tables"
350 if [ "$DB_VER" -lt "6" ]; then
351 if [ "$DB_VER" -lt "5" ]; then
352 %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
354 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
356 %{_libexecdir}/%{name}/update_bacula_tables
357 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
359 chown -R bacula:bacula %{_localstatedir}
360 chmod -R u+rX,go-rwx %{_localstatedir}/*
362 /sbin/chkconfig --add bacula-dir
363 if [ -f /var/lock/subsys/bacula-dir ]; then
364 /etc/rc.d/init.d/bacula-dir restart 1>&2
366 echo "Run \"/etc/rc.d/init.d/bacula-dir start\" to start Bacula Director daemon."
370 if [ "$1" = "0" ]; then
371 if [ -f /var/lock/subsys/bacula-dir ]; then
372 /etc/rc.d/init.d/bacula-dir stop 1>&2
374 /sbin/chkconfig --del bacula-dir
378 /sbin/chkconfig --add bacula-fd
379 if [ -f /var/lock/subsys/bacula-fd ]; then
380 /etc/rc.d/init.d/bacula-fd restart 1>&2
382 echo "Run \"/etc/rc.d/init.d/bacula-fd start\" to start Bacula File daemon."
386 if [ "$1" = "0" ]; then
387 if [ -f /var/lock/subsys/bacula-fd ]; then
388 /etc/rc.d/init.d/bacula-fd stop 1>&2
390 /sbin/chkconfig --del bacula-fd
394 /sbin/chkconfig --add bacula-sd
395 if [ -f /var/lock/subsys/bacula-sd ]; then
396 /etc/rc.d/init.d/bacula-sd restart 1>&2
398 echo "Run \"/etc/rc.d/init.d/bacula-sd start\" to start Bacula Storage daemon."
402 if [ "$1" = "0" ]; then
403 if [ -f /var/lock/subsys/bacula-sd ]; then
404 /etc/rc.d/init.d/bacula-sd stop 1>&2
406 /sbin/chkconfig --del bacula-sd
410 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
411 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
415 echo "The database update scripts were installed to %{_sysconfdir}/updatedb"
418 rm -rf $RPM_BUILD_ROOT
421 # link our current installed conf file to the rescue directory
422 ln -s %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
425 echo "Creating rescue files for this system..."
426 cd %{_sysconfdir}/rescue
430 # remove the files created after the initial rpm installation
431 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
432 rm -f %{_sysconfdir}/rescue/partition.*
433 rm -f %{_sysconfdir}/rescue/format.*
434 rm -f %{_sysconfdir}/rescue/mount_drives
435 rm -f %{_sysconfdir}/rescue/start_network
436 rm -f %{_sysconfdir}/rescue/sfdisk
437 rm -rf %{_sysconfdir}/rescue/diskinfo/*
440 %defattr(644,root,root,755)
442 %attr(755, root, root) %{_sbindir}/btraceback
443 %attr(755, root, root) %{_sbindir}/bsmtp
444 %dir %{_libexecdir}/%{name}
445 %{_libexecdir}/%{name}/btraceback.gdb
446 %attr(700, bacula, bacula) %dir %{_localstatedir}
449 %defattr(644,root,root,755)
450 %doc ChangeLog CheckList ReleaseNotes kernstodo
451 %doc doc/*.pdf html-manual examples
452 %attr(600, root, root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bacula-dir.conf
453 %ghost %{_sysconfdir}/.pw.sed
454 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
455 %{_mandir}/man8/bacula-dir.8*
456 %{_mandir}/man1/dbcheck.1*
457 %defattr (755, root, root)
458 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
459 %attr(755,root,root) %{_sbindir}/bacula-dir
460 %attr(755,root,root) %{_sbindir}/dbcheck
461 %{_libexecdir}/%{name}/create_sqlite_database
462 %{_libexecdir}/%{name}/drop_sqlite_database
463 %{_libexecdir}/%{name}/drop_sqlite_tables
464 %{_libexecdir}/%{name}/grant_sqlite_privileges
465 %{_libexecdir}/%{name}/make_sqlite_tables
466 %{_libexecdir}/%{name}/update_sqlite_tables*
467 %{_libexecdir}/%{name}/create_bacula_database
468 %{_libexecdir}/%{name}/drop_bacula_database
469 %{_libexecdir}/%{name}/drop_bacula_tables
470 %{_libexecdir}/%{name}/grant_bacula_privileges
471 %{_libexecdir}/%{name}/make_bacula_tables
472 %{_libexecdir}/%{name}/update_bacula_tables
473 %{_libexecdir}/%{name}/make_catalog_backup
474 %{_libexecdir}/%{name}/delete_catalog_backup
475 %attr(644, root, root) %{_libexecdir}/%{name}/query.sql
478 %defattr(644,root,root,755)
479 %attr(600, root, root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bacula-fd.conf
480 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
481 %attr(755,root,root) %{_sbindir}/bacula-fd
482 %attr(644, root, root) %{_mandir}/man8/bacula-fd.8*
485 %defattr(644,root,root,755)
487 %attr(600, root, root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bacula-sd.conf
488 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
489 %attr(755,root,root) %{_sbindir}/bacula-sd
490 %attr(755,root,root) %{_sbindir}/bcopy
491 %attr(755,root,root) %{_sbindir}/bextract
492 %attr(755,root,root) %{_sbindir}/bls
493 %attr(755,root,root) %{_sbindir}/bscan
494 %attr(755,root,root) %{_sbindir}/btape
495 %{_libexecdir}/%{name}/mtx-changer
496 %defattr(644, root,root, 755)
497 %{_mandir}/man8/bacula-sd.8*
498 %{_mandir}/man1/bcopy.1*
499 %{_mandir}/man1/bextract.1*
500 %{_mandir}/man1/bls.1*
501 %{_mandir}/man1/bscan.1*
502 %{_mandir}/man1/btape.1*
505 %defattr(644,root,root,755)
506 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bconsole.conf
507 %attr(755,root,root) %{_sbindir}/bconsole
508 %config(noreplace) /etc/security/console.apps/bconsole
509 %config(noreplace) /etc/pam.d/bconsole
510 %verify(link) %{_bindir}/bconsole
511 %{_mandir}/man1/bconsole.1*
514 %defattr(644,root,root,755)
515 %{_pixmapsdir}/%{name}.png
516 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/wx-console.conf
517 %attr(755,root,root) %{_sbindir}/wx-console
518 %config(noreplace) /etc/security/console.apps/wx-console
519 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/wx-console
520 %verify(link) %{_bindir}/wx-console
521 %{_mandir}/man1/wx-console.1*
524 %defattr(644,root,root,755)
525 %{_sysconfdir}/rescue
528 %defattr(644,root,root,755)
529 %{_sysconfdir}/updatedb