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 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _sysconfdir /etc/%{name}
42 %define _localstatedir /var/lib/%{name}
45 Bacula - It comes by night and sucks the vital essence from your
48 Bacula is a set of computer programs that permit you (or the system
49 administrator) to manage backup, recovery, and verification of
50 computer data across a network of computers of different kinds. In
51 technical terms, it is a network client/server based backup program.
52 Bacula is relatively easy to use and efficient, while offering many
53 advanced storage management features that make it easy to find and
54 recover lost or damaged files.
57 Summary: Common files for bacula package
58 Group: Networking/Utilities
59 Conflicts: bacula-dir < %{epoch}:%{version}-%{release}
60 Conflicts: bacula-fd < %{epoch}:%{version}-%{release}
61 Conflicts: bacula-sd < %{epoch}:%{version}-%{release}
62 Conflicts: bacula-console < %{epoch}:%{version}-%{release}
65 Bacula - It comes by night and sucks the vital essence from your
68 Bacula is a set of computer programs that permit you (or the system
69 administrator) to manage backup, recovery, and verification of
70 computer data across a network of computers of different kinds. In
71 technical terms, it is a network client/server based backup program.
72 Bacula is relatively easy to use and efficient, while offering many
73 advanced storage management features that make it easy to find and
74 recover lost or damaged files.
77 Summary: Bacula Director and Catalog services
78 Group: Networking/Utilities
79 Prereq: bacula-common = %{epoch}:%{version}-%{release}
82 Bacula - It comes by night and sucks the vital essence from your
85 Bacula Director is the program that supervises all the backup,
86 restore, verify and archive operations. The system administrator uses
87 the Bacula Director to schedule backups and to recover files. Catalog
88 services are comprised of the software programs responsible for
89 maintaining the file indexes and volume databases for all files backed
90 up. The Catalog services permit the System Administrator or user to
91 quickly locate and restore any desired file, since it maintains a
92 record of all Volumes used, all Jobs run, and all Files saved. This
93 build requires sqlite to be installed separately as the catalog
97 Summary: Bacula Console
98 Group: Networking/Utilities
99 Prereq: bacula-common = %{epoch}:%{version}-%{release}
102 Bacula - It comes by night and sucks the vital essence from your
105 Bacula Console is the program that allows the administrator or user to
106 communicate with the Bacula Director. This is the text only console
110 Summary: Bacula wxWindows Console
111 Group: Networking/Utilities
112 Prereq: bacula-common = %{epoch}:%{version}-%{release}
114 %description console-wx
115 Bacula - It comes by night and sucks the vital essence from your
118 Bacula Console is the program that allows the administrator or user to
119 communicate with the Bacula Director. This is the wxWindows GUI
123 Summary: Bacula File services (Client)
124 Group: Networking/Utilities
125 Prereq: bacula-common = %{epoch}:%{version}-%{release}
128 Bacula - It comes by night and sucks the vital essence from your
131 Bacula File services (or Client program) is the software program that
132 is installed on the machine to be backed up. It is specific to the
133 operating system on which it runs and is responsible for providing the
134 file attributes and data when requested by the Director. The File
135 services are also responsible for the file system dependent part of
136 restoring the file attributes and data during a recovery operation.
137 This program runs as a daemon on the machine to be backed up, and in
138 some of the documentation, the File daemon is referred to as the
139 Client (for example in Bacula configuration file).
142 Summary: Bacula Storage services
143 Group: Networking/Utilities
144 Prereq: bacula-common = %{epoch}:%{version}-%{release}
147 Bacula - It comes by night and sucks the vital essence from your
150 Bacula Storage services consist of the software programs that perform
151 the storage and recovery of the file attributes and data to the
152 physical backup media or volumes. In other words, the Storage daemon
153 is responsible for reading and writing your tapes (or other storage
154 media, e.g. files). The Storage services runs as a daemon on the
155 machine that has the backup device (usually a tape drive).
158 Summary: Bacula - The Network Backup Solution
159 Group: Networking/Utilities
165 Bacula - It comes by night and sucks the vital essence from your
168 Bacula is a set of computer programs that permit you (or the system
169 administrator) to manage backup, recovery, and verification of
170 computer data across a network of computers of different kinds. In
171 technical terms, it is a network client/server based backup program.
172 Bacula is relatively easy to use and efficient, while offering many
173 advanced storage management features that make it easy to find and
174 recover lost or damaged files. Bacula source code has been released
175 under the GPL version 2 license.
177 This package installs scripts for disaster recovery and builds rescue
178 floppy disks for bare metal recovery. This package includes tomsrtbt
179 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a
180 tool to build a boot floppy disk.
182 To create a boot disk run "./getdiskinfo" from the
183 %{_sysconfdir}/rescue directory (this is done when the package is
184 first installed), then run "./install.s" from the
185 %{_sysconfdir}/rescue/tomsrtbt/ directory. To make the bacula rescue
186 disk run "./make_rescue_disk --copy-static-bacula
187 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
188 recreate the rescue information for this system run ./getdiskinfo
192 Summary: Bacula - The Network Backup Solution
193 Group: Networking/Utilities
195 %description updatedb
196 Bacula - It comes by night and sucks the vital essence from your
199 Bacula is a set of computer programs that permit you (or the system
200 administrator) to manage backup, recovery, and verification of
201 computer data across a network of computers of different kinds. In
202 technical terms, it is a network client/server based backup program.
203 Bacula is relatively easy to use and efficient, while offering many
204 advanced storage management features that make it easy to find and
205 recover lost or damaged files. Bacula source code has been released
206 under the GPL version 2 license.
208 This package installs scripts for updating older versions of the
214 sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure*
215 sed -i -e 's#-lreadline -ltermcap#-lreadline#g' configure*
218 # patches for the bundled sqlite scripts
219 # patch the make_sqlite_tables script for installation bindir
220 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
221 # patch the create_sqlite_database script for installation bindir
222 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
223 # patch the make_catalog_backup script for installation bindir
224 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
225 # patch the update_sqlite_tables script for installation bindir
226 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
228 CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
230 --with-scriptdir=%{_libexecdir}/%{name} \
233 --enable-smartalloc \
234 --enable-wx-console \
236 --with-tcp-wrappers \
237 --with-working-dir=%{_var}/lib/%{name} \
238 --with-dump-email="root@localhost" \
239 --with-job-email="root@localhost" \
240 --with-smtp-host=localhost \
241 --with-pid-dir=/var/run \
242 --with-subsys-dir=/var/lock/subsys \
245 --with-dir-password="#FAKE#DIR#PASSWORD#PLD#" \
246 --with-fd-password="#FAKE#FD#PASSWORD#PLD#" \
247 --with-sd-password="#FAKE#SD#PASSWORD#PLD#"
252 rm -rf $RPM_BUILD_ROOT
254 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,security/console.apps}
255 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rescue/tomsrtbt,updatedb}
256 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_mandir},%{_bindir}}
259 DESTDIR=$RPM_BUILD_ROOT
262 strip src/filed/static-bacula-fd
263 install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
265 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
266 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
267 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
268 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
270 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
272 # install the rescue stuff, these are the rescue scripts
273 install rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
274 install rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
275 install rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
276 install rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
277 install rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
278 install rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
279 install rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
280 install rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
281 install rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
283 # this is the tom's root boot disk
284 install tomsrtbt-*/* $RPM_BUILD_ROOT%{_sysconfdir}/rescue/tomsrtbt/
286 # install the updatedb scripts
287 install updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/updatedb/
290 cp -a man1 man8 $RPM_BUILD_ROOT%{_mandir}
292 install -d html-manual
293 cp -a doc/html-manual/*.{html,jpg,gif,css} html-manual/
296 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
297 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
298 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/gnome*
299 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
301 cat << EOF > $RPM_BUILD_ROOT/etc/security/console.apps/bconsole
303 PROGRAM=%{_sbindir}/bconsole
306 install scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/bconsole
307 ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/bconsole
309 cat << EOF > $RPM_BUILD_ROOT/etc/security/console.apps/wx-console
311 PROGRAM=%{_sbindir}/wx-console
314 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/wx-console
315 ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/wx-console
318 # FIXME: dodawanie usera bacula /var/lib/bacula /bin/false
321 # FIXME: del usera bacula
325 [ -s %{_localstatedir}/bacula.db ] && \
326 DB_VER=`echo "select * from Version;" | \
327 %{_bindir}/sqlite %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
328 if [ -z "$DB_VER" ]; then
329 # grant privileges and create tables
330 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
331 %{_libexecdir}/%{name}/create_bacula_database > dev/null
332 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
333 elif [ "$DB_VER" -lt "7" ]; then
334 echo "Backing up bacula tables"
335 echo ".dump" | sqlite %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
337 echo "Upgrading bacula tables"
338 if [ "$DB_VER" -lt "6" ]; then
339 if [ "$DB_VER" -lt "5" ]; then
340 %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
342 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
344 %{_libexecdir}/%{name}/update_bacula_tables
345 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
347 chown -R bacula:bacula %{_localstatedir}/%{name}
348 chmod -R u+rX,go-rwx %{_localstatedir}/%{name}
350 /sbin/chkconfig --add bacula-dir
351 if [ -f /var/lock/subsys/bacula-dir ]; then
352 /etc/rc.d/init.d/bacula-dir restart 1>&2
354 echo "Run \"/etc/rc.d/init.d/bacula-dir start\" to start Bacula Director daemon."
358 if [ "$1" = "0" ]; then
359 if [ -f /var/lock/subsys/bacula-dir ]; then
360 /etc/rc.d/init.d/bacula-dir stop 1>&2
362 /sbin/chkconfig --del bacula-dir
366 /sbin/chkconfig --add bacula-fd
367 if [ -f /var/lock/subsys/bacula-fd ]; then
368 /etc/rc.d/init.d/bacula-fd restart 1>&2
370 echo "Run \"/etc/rc.d/init.d/bacula-fd start\" to start Bacula File daemon."
374 if [ "$1" = "0" ]; then
375 if [ -f /var/lock/subsys/bacula-fd ]; then
376 /etc/rc.d/init.d/bacula-fd stop 1>&2
378 /sbin/chkconfig --del bacula-fd
382 /sbin/chkconfig --add bacula-sd
383 if [ -f /var/lock/subsys/bacula-sd ]; then
384 /etc/rc.d/init.d/bacula-sd restart 1>&2
386 echo "Run \"/etc/rc.d/init.d/bacula-sd start\" to start Bacula Storage daemon."
390 if [ "$1" = "0" ]; then
391 if [ -f /var/lock/subsys/bacula-sd ]; then
392 /etc/rc.d/init.d/bacula-sd stop 1>&2
394 /sbin/chkconfig --del bacula-sd
398 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
399 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
403 echo "The database update scripts were installed to %{_sysconfdir}/updatedb"
406 rm -rf $RPM_BUILD_ROOT
409 # link our current installed conf file to the rescue directory
410 ln -s %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
413 echo "Creating rescue files for this system..."
414 cd %{_sysconfdir}/rescue
418 # remove the files created after the initial rpm installation
419 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
420 rm -f %{_sysconfdir}/rescue/partition.*
421 rm -f %{_sysconfdir}/rescue/format.*
422 rm -f %{_sysconfdir}/rescue/mount_drives
423 rm -f %{_sysconfdir}/rescue/start_network
424 rm -f %{_sysconfdir}/rescue/sfdisk
425 rm -rf %{_sysconfdir}/rescue/diskinfo/*
428 %defattr(644,root,root,755)
430 %attr(755, root, root) %{_sbindir}/btraceback
431 %attr(755, root, root) %{_sbindir}/bsmtp
432 %dir %{_libexecdir}/%{name}
433 %{_libexecdir}/%{name}/btraceback.gdb
434 %attr(700, bacula, bacula) %dir %{_localstatedir}
437 %defattr(644,root,root,755)
438 %doc ChangeLog CheckList ReleaseNotes kernstodo
439 %doc doc/*.pdf html-manual examples
440 %attr(600, root, root) %config(noreplace) %{_sysconfdir}/bacula-dir.conf
441 %ghost %{_sysconfdir}/.pw.sed
442 %config(noreplace) /etc/logrotate.d/bacula-dir
443 %{_mandir}/man8/bacula-dir.8*
444 %{_mandir}/man1/dbcheck.1*
445 %defattr (755, root, root)
446 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
447 %attr(755,root,root) %{_sbindir}/bacula-dir
448 %attr(755,root,root) %{_sbindir}/dbcheck
449 %{_libexecdir}/%{name}/create_sqlite_database
450 %{_libexecdir}/%{name}/drop_sqlite_database
451 %{_libexecdir}/%{name}/drop_sqlite_tables
452 %{_libexecdir}/%{name}/grant_sqlite_privileges
453 %{_libexecdir}/%{name}/make_sqlite_tables
454 %{_libexecdir}/%{name}/update_sqlite_tables*
455 %{_libexecdir}/%{name}/create_bacula_database
456 %{_libexecdir}/%{name}/drop_bacula_database
457 %{_libexecdir}/%{name}/drop_bacula_tables
458 %{_libexecdir}/%{name}/grant_bacula_privileges
459 %{_libexecdir}/%{name}/make_bacula_tables
460 %{_libexecdir}/%{name}/update_bacula_tables
461 %{_libexecdir}/%{name}/make_catalog_backup
462 %{_libexecdir}/%{name}/delete_catalog_backup
463 %attr(644, root, root) %{_libexecdir}/%{name}/query.sql
466 %defattr(644,root,root,755)
467 %attr(600, root, root) %config(noreplace) %{_sysconfdir}/bacula-fd.conf
468 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
469 %attr(755,root,root) %{_sbindir}/bacula-fd
470 %attr(644, root, root) %{_mandir}/man8/bacula-fd.8*
473 %defattr(644,root,root,755)
475 %attr(600, root, root) %config(noreplace) %{_sysconfdir}/bacula-sd.conf
476 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
477 %attr(755,root,root) %{_sbindir}/bacula-sd
478 %attr(755,root,root) %{_sbindir}/bcopy
479 %attr(755,root,root) %{_sbindir}/bextract
480 %attr(755,root,root) %{_sbindir}/bls
481 %attr(755,root,root) %{_sbindir}/bscan
482 %attr(755,root,root) %{_sbindir}/btape
483 %{_libexecdir}/%{name}/mtx-changer
484 %defattr(644, root,root, 755)
485 %{_mandir}/man8/bacula-sd.8*
486 %{_mandir}/man1/bcopy.1*
487 %{_mandir}/man1/bextract.1*
488 %{_mandir}/man1/bls.1*
489 %{_mandir}/man1/bscan.1*
490 %{_mandir}/man1/btape.1*
493 %defattr(644,root,root,755)
494 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/bconsole.conf
495 %attr(755,root,root) %{_sbindir}/bconsole
496 %config(noreplace) /etc/security/console.apps/bconsole
497 %config(noreplace) /etc/pam.d/bconsole
498 %verify(link) %{_bindir}/bconsole
499 %{_mandir}/man1/bconsole.1*
502 %defattr(644,root,root,755)
503 %{_pixmapsdir}/%{name}.png
504 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/wx-console.conf
505 %attr(755,root,root) %{_sbindir}/wx-console
506 %config(noreplace) /etc/security/console.apps/wx-console
507 %config(noreplace) /etc/pam.d/wx-console
508 %verify(link) %{_bindir}/wx-console
509 %{_mandir}/man1/wx-console.1*
512 %defattr(644,root,root,755)
513 %{_sysconfdir}/rescue
516 %defattr(644,root,root,755)
517 %{_sysconfdir}/updatedb