2 # basic defines for every build
3 %define depkgs ../depkgs
4 %define depkgs_version 24Jul03
5 %define tomsrtbt tomsrtbt-2.0.103
8 # You must build the package with at least one define parameter
9 # e.g. rpmbuild -ba --define "build_rh7 1" bacula.spec
11 # If you want the MySQL version, use:
12 # rpmbuild -ba --define "build_mysql 1" --define "build_rh7 1" bacula.spec
16 %{?build_rh7:%define rh7 1}
19 %{?build_rh8:%define rh8 1}
22 %{?build_rh9:%define rh9 1}
25 %{?build_mysql:%define mysql 1}
29 %define rh_version rh7
32 %define rh_version rh8
35 %define rh_version rh9
38 Summary: Bacula - The Network Backup Solution
42 Group: System Environment/Daemons
44 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
45 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
46 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
47 BuildRoot: %{_tmppath}/%{name}-root
48 URL: http://www.bacula.org/
49 Vendor: The Bacula Team
50 Distribution: The Bacula Team
51 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
52 BuildRequires: readline-devel
54 BuildRequires: gtk+-devel >= 1.2
55 BuildRequires: gnome-libs-devel >= 1.4
57 BuildRequires: gtk2-devel >= 2.0
58 BuildRequires: libgnomeui-devel >= 2.0
61 BuildRequires: mysql-devel >= 3.23
65 Bacula - It comes by night and sucks the vital essence from your computers.
67 Bacula is a set of computer programs that permit you (or the system
68 administrator) to manage backup, recovery, and verification of computer
69 data across a network of computers of different kinds. In technical terms,
70 it is a network client/server based backup program. Bacula is relatively
71 easy to use and efficient, while offering many advanced storage management
72 features that make it easy to find and recover lost or damaged files.
73 Bacula source code has been released under the GPL version 2 license.
76 %package mysql-%{rh_version}
78 %package sqlite-%{rh_version}
81 Summary: Bacula - The Network Backup Solution
82 Group: System Environment/Daemons
86 Requires: gnome-libs >= 1.4
89 Requires: libgnomeui >= 2.0
92 Requires: mysql >= 3.23
93 Requires: mysql-server >= 3.23
97 %description mysql-%{rh_version}
99 %description sqlite-%{rh_version}
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.
113 This build requires MySQL to be installed separately as the catalog database.
115 This build incorporates sqlite as the catalog database, statically compiled.
118 %package client-%{rh_version}
119 Summary: Bacula - The Network Backup Solution
120 Group: System Environment/Daemons
123 Requires: gtk+ >= 1.2
124 Requires: gnome-libs >= 1.4
126 Requires: gtk2 >= 2.0
127 Requires: libgnomeui >= 2.0
130 %description client-%{rh_version}
131 Bacula - It comes by night and sucks the vital essence from your computers.
133 Bacula is a set of computer programs that permit you (or the system
134 administrator) to manage backup, recovery, and verification of computer
135 data across a network of computers of different kinds. In technical terms,
136 it is a network client/server based backup program. Bacula is relatively
137 easy to use and efficient, while offering many advanced storage management
138 features that make it easy to find and recover lost or damaged files.
139 Bacula source code has been released under the GPL version 2 license.
141 This is the File daemon (Client) only package.
145 Summary: Bacula - The Network Backup Solution
146 Group: System Environment/Daemons
147 Requires: coreutils, util-linux, libc5
150 Bacula - It comes by night and sucks the vital essence from your computers.
152 Bacula is a set of computer programs that permit you (or the system
153 administrator) to manage backup, recovery, and verification of computer
154 data across a network of computers of different kinds. In technical terms,
155 it is a network client/server based backup program. Bacula is relatively
156 easy to use and efficient, while offering many advanced storage management
157 features that make it easy to find and recover lost or damaged files.
158 Bacula source code has been released under the GPL version 2 license.
160 This package installs scripts for disaster recovery and builds rescue
161 floppy disks for bare metal recovery. This package includes tomsrtbt
162 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
163 to build a boot floppy disk.
165 You need to have the bacula-sqlite, bacula-mysql or bacula-client package for
166 your platform installed and configured before installing this package.
183 # patch the make_sqlite_tables script for installation bindir
184 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
186 # patch the make_catalog_backup script for installation bindir
187 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
191 --sbindir=/usr/sbin \
192 --sysconfdir=/etc/bacula \
193 --with-scriptdir=/etc/bacula \
194 --enable-smartalloc \
200 --with-sqlite=${cwd}/../depkgs/sqlite \
202 --with-working-dir=/var/bacula \
203 --with-pid-dir=/var/run \
204 --with-subsys-dir=/var/lock/subsys
208 strip static-bacula-fd
214 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
215 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
216 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
217 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
218 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
219 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
220 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
223 mkdir -p $RPM_BUILD_ROOT/usr/lib/sqlite
227 prefix=$RPM_BUILD_ROOT/usr \
228 sbindir=$RPM_BUILD_ROOT/usr/sbin \
229 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
230 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
231 working_dir=$RPM_BUILD_ROOT/var/bacula \
236 prefix=$RPM_BUILD_ROOT/usr \
237 sbindir=$RPM_BUILD_ROOT/usr/sbin \
238 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
239 working_dir=$RPM_BUILD_ROOT/var/bacula \
240 mandir=$RPM_BUILD_ROOT/usr/man \
245 # fixme - make installs the mysql scripts for sqlite build
246 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
247 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
248 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
251 # install the init scripts
252 cp platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
253 cp platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
254 cp platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
256 # install the menu stuff
257 cp scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
258 cp scripts/bacula.desktop.gnome1 $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
259 cp scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
263 cp ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite
264 cp ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite.h
265 cp ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT/usr/lib/sqlite/libsqlite.a
268 # install the logrotate file
269 cp scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
271 # install the rescue stuff
272 # these are the rescue scripts
273 cp rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
274 cp rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
275 cp rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
276 cp rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
277 cp rescue/linux/make_static_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
278 cp rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
279 cp rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
280 cp rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
281 cp rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
282 cp rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
284 # this is the static file daemon
285 cp src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
287 # this is the tom's root boot disk
288 cp ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
291 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
295 %files mysql-%{rh_version}
296 %defattr(-,root,root)
298 %attr(0754,root,root) /etc/bacula/bacula
299 %attr(0754,root,root) /etc/bacula/console
300 %attr(0754,root,root) /etc/bacula/fd
301 %attr(0754,root,root) /etc/bacula/gconsole
302 %attr(0754,root,root) /etc/bacula/create_mysql_database
303 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
304 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
305 %attr(0754,root,root) /etc/bacula/drop_mysql_tables
306 %attr(0754,root,root) /etc/bacula/make_bacula_tables
307 %attr(0754,root,root) /etc/bacula/make_catalog_backup
308 %attr(0754,root,root) /etc/bacula/make_mysql_tables
309 %attr(0754,root,root) /etc/bacula/grant_mysql_privileges
310 %attr(0754,root,root) /etc/bacula/startmysql
311 %attr(0754,root,root) /etc/bacula/stopmysql
312 %attr(0754,root,root) /etc/bacula/mtx-changer
313 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
314 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
315 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
317 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
318 %attr(0644,root,root) /usr/man/man1/*
319 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
320 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
321 %attr(0644,root,root) /usr/share/applications/bacula.desktop
322 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
323 %attr(0644,root,root) /etc/logrotate.d/bacula
325 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
326 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
327 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
328 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
329 %attr(0640,root,root) /etc/bacula/query.sql
330 %attr(0640,root,root) %dir /var/bacula
332 %attr(0750,root,root) /usr/sbin/*
334 %post mysql-%{rh_version}
335 # delete then add our links
336 /sbin/chkconfig --del bacula-dir
337 /sbin/chkconfig --del bacula-fd
338 /sbin/chkconfig --del bacula-sd
339 /sbin/chkconfig --add bacula-dir
340 /sbin/chkconfig --add bacula-fd
341 /sbin/chkconfig --add bacula-sd
343 # add execute permissions for console
344 chmod 0755 /usr/sbin/gnome-console
346 # grant privileges and create tables
347 # this will error out harmlessly if tables already exist
348 echo "Granting privileges for MySQL user bacula..."
349 /etc/bacula/grant_mysql_privileges
350 echo "Creating MySQL bacula database..."
351 /etc/bacula/create_mysql_database
352 echo "Creating bacula tables..."
353 /etc/bacula/make_mysql_tables
355 %preun mysql-%{rh_version}
357 /sbin/chkconfig --del bacula-dir
358 /sbin/chkconfig --del bacula-fd
359 /sbin/chkconfig --del bacula-sd
363 %files sqlite-%{rh_version}
364 %defattr(-,root,root)
366 %attr(0754,root,root) /etc/bacula/bacula
367 %attr(0754,root,root) /etc/bacula/console
368 %attr(0754,root,root) /etc/bacula/fd
369 %attr(0754,root,root) /etc/bacula/gconsole
370 %attr(0754,root,root) /etc/bacula/create_sqlite_database
371 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
372 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
373 %attr(0754,root,root) /etc/bacula/drop_sqlite_tables
374 %attr(0754,root,root) /etc/bacula/make_bacula_tables
375 %attr(0754,root,root) /etc/bacula/make_catalog_backup
376 %attr(0754,root,root) /etc/bacula/make_sqlite_tables
377 %attr(0754,root,root) /etc/bacula/mtx-changer
378 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
379 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
380 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
382 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
383 %attr(0644,root,root) /usr/man/man1/*
384 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
385 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
386 %attr(0644,root,root) /usr/share/applications/bacula.desktop
387 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
388 %attr(0644,root,root) /etc/logrotate.d/bacula
390 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
391 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
392 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
393 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
394 %attr(0640,root,root) /etc/bacula/query.sql
395 %attr(0640,root,root) /usr/lib/sqlite/libsqlite.a
396 %attr(0640,root,root) /usr/lib/sqlite/sqlite.h
397 %attr(0640,root,root) %dir /var/bacula
399 %attr(0750,root,root) /usr/sbin/*
400 %attr(0750,root,root) /usr/lib/sqlite/sqlite
402 %post sqlite-%{rh_version}
403 # delete then add our links
404 /sbin/chkconfig --del bacula-dir
405 /sbin/chkconfig --del bacula-fd
406 /sbin/chkconfig --del bacula-sd
407 /sbin/chkconfig --add bacula-dir
408 /sbin/chkconfig --add bacula-fd
409 /sbin/chkconfig --add bacula-sd
411 # add execute permission for console
412 chmod 0755 /usr/sbin/gnome-console
415 /etc/bacula/make_sqlite_tables
417 %preun sqlite-%{rh_version}
419 /sbin/chkconfig --del bacula-dir
420 /sbin/chkconfig --del bacula-fd
421 /sbin/chkconfig --del bacula-sd
425 %files client-%{rh_version}
426 %defattr(-,root,root)
428 %attr(0754,root,root) /etc/bacula/fd
429 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
431 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
432 %attr(0644,root,root) /etc/logrotate.d/bacula
434 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
435 %attr(0640,root,root) %dir /var/bacula
437 %attr(0750,root,root) /usr/sbin/bacula-fd
438 %attr(0750,root,root) /usr/sbin/btraceback
439 %attr(0750,root,root) /usr/sbin/btraceback.gdb
440 %attr(0750,root,root) /usr/sbin/smtp
443 %post client-%{rh_version}
444 # delete then add our links
445 /sbin/chkconfig --del bacula-fd
446 /sbin/chkconfig --add bacula-fd
448 %preun client-%{rh_version}
450 /sbin/chkconfig --del bacula-fd
453 %defattr(-,root,root)
454 %attr(0644,root,root) /etc/bacula/rescue/backup.etc.list
455 %attr(0754,root,root) /etc/bacula/rescue/format_floppy
456 %attr(0754,root,root) /etc/bacula/rescue/getdiskinfo
457 %attr(0754,root,root) /etc/bacula/rescue/make_rescue_disk
458 %attr(0754,root,root) /etc/bacula/rescue/make_static_bacula
459 %attr(0754,root,root) /etc/bacula/rescue/restore_bacula
460 %attr(0754,root,root) /etc/bacula/rescue/restore_etc
461 %attr(0754,root,root) /etc/bacula/rescue/run_grub
462 %attr(0754,root,root) /etc/bacula/rescue/run_lilo
463 %attr(0644,root,root) /etc/bacula/rescue/sfdisk.bz2
464 %attr(0754,root,root) /etc/bacula/rescue/bacula-fd
465 /etc/bacula/rescue/tomsrtbt/*
468 # link our current installed conf file to the rescue directory
469 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
472 echo "Ready to create the rescue files for this system."
473 echo "Press <enter> to continue..."
478 echo "Running getdiskinfo..."
479 cd /etc/bacula/rescue
484 echo "To create a boot disk run \"./install.s\" from the /etc/bacula/rescue/tomsrtbt/"
485 echo "directory. To make the bacula rescue disk run"
486 echo "\"./make_rescue_disk --copy-static-bacula --copy-etc-files\" "
487 echo "from the /etc/bacula/rescue directory. To recreate the rescue"
488 echo "information for this system run ./getdiskinfo again."
492 # remove the files created after the initial rpm installation
493 rm -f /etc/bacula/rescue/bacula-fd.conf
494 rm -f /etc/bacula/rescue/partition.*
495 rm -f /etc/bacula/rescue/format.*
496 rm -f /etc/bacula/rescue/mount_drives
497 rm -f /etc/bacula/rescue/start_network
498 rm -f /etc/bacula/rescue/sfdisk
499 rm -rf /etc/bacula/rescue/diskinfo/*
502 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
503 - Added define at top of file for depkgs version
504 - Added rescue sub-package
505 - Moved requires statements into proper sub-package locations
506 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
507 - Corrected Requires for Gnome 1.4/2.0 builds
508 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
509 - Added separate Source declaration for depkgs
510 - added patch for make_catalog_backup script
511 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
512 - Misc changes to mysql/sqlite build and rh7/8 menu differences
513 - Added rh_version to sub-package names
514 - Added installed but missing file /etc/bacula/gconsole
515 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
516 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
517 - Update spec for version 1.31 and combine client
518 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>