]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/suse/bacula.spec.in
Document group addition in rpm packages.
[bacula/bacula] / bacula / platforms / suse / bacula.spec.in
1 # Platform Build Configuration
2
3 # basic defines for every build
4 %define depkgs ../depkgs
5 %define depkgs_version 30Jul04
6 %define tomsrtbt tomsrtbt-2.0.103
7 %define sqlite_bindir /usr/lib/sqlite
8 %define working_dir /var/bacula
9 %define daemon_user root
10 %define daemon_group bacula
11 %define group_file /etc/group
12 %define groupadd /usr/sbin/groupadd
13
14 # platform defines - set one below or define the build_xxx on the command line
15 # RedHat builds
16 %define rh7 0
17 %{?build_rh7:%define rh7 1}
18 %define rh8 0
19 %{?build_rh8:%define rh8 1}
20 %define rh9 0
21 %{?build_rh9:%define rh9 1}
22 # Fedora Core 1 build
23 %define fc1 0
24 %{?build_fc1:%define fc1 1}
25 # Whitebox Enterprise build
26 # this should also work for RHEL
27 %define wb3 0
28 %{?build_wb3:%define wb3 1}
29 # SuSE build
30 # this is known to build on SuSE 8.2 and 9.0
31 %define su9 0
32 %{?build_su9:%define su9 1}
33
34 # test for a platform definition
35 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9}
36 %{error: You must specify a platform. Please examine the spec file.}
37 exit 1
38 %endif
39
40 # database defines
41 # set for database support desired or define the build_xxx on the command line
42 %define mysql 0
43 %{?build_mysql:%define mysql 1}
44 %define sqlite 0
45 %{?build_sqlite:%define sqlite 1}
46 %define postgresql 0
47 %{?build_postgresql:%define postgresql 1}
48
49 # test for a database definition
50 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
51 %{error: You must specify database support. Please examine the spec file.}
52 exit 1
53 %endif
54
55 Summary: Bacula - The Network Backup Solution
56 Name: bacula
57 Version: @VERSION@
58 Release: 1
59 Group: System Environment/Daemons
60 Copyright: GPL v2
61 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
62 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
63 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
64 Source3: Release_Notes-%{version}-%{release}.tar.gz
65 BuildRoot: %{_tmppath}/%{name}-root
66 URL: http://www.bacula.org/
67 Vendor: The Bacula Team
68 Distribution: The Bacula Team
69 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
70 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
71 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
72 %if %{rh7}
73 BuildRequires: libtermcap-devel
74 BuildRequires: gtk+-devel >= 1.2
75 BuildRequires: gnome-libs-devel >= 1.4
76 BuildRequires: glibc-devel >= 2.2
77 BuildRequires: ORBit-devel
78 BuildRequires: bonobo-devel
79 BuildRequires: GConf-devel
80 %endif
81 %if %{su9}
82 BuildRequires: termcap
83 BuildRequires: gtk2-devel >= 2.0
84 BuildRequires: libgnomeui-devel >= 2.0
85 BuildRequires: glibc-devel >= 2.3
86 BuildRequires: ORBit2-devel
87 BuildRequires: libart_lgpl-devel >= 2.0
88 BuildRequires: libbonobo-devel >= 2.0
89 BuildRequires: libbonoboui-devel >= 2.0
90 BuildRequires: bonobo-activation-devel
91 BuildRequires: gconf2-devel
92 BuildRequires: linc-devel
93 %endif
94 %if ! %{rh7} && ! %{su9}
95 BuildRequires: libtermcap-devel
96 BuildRequires: gtk2-devel >= 2.0
97 BuildRequires: libgnomeui-devel >= 2.0
98 BuildRequires: glibc-devel >= 2.3
99 BuildRequires: ORBit2-devel
100 BuildRequires: libart_lgpl-devel >= 2.0
101 BuildRequires: libbonobo-devel >= 2.0
102 BuildRequires: libbonoboui-devel >= 2.0
103 BuildRequires: bonobo-activation-devel
104 BuildRequires: GConf2-devel
105 BuildRequires: linc-devel
106 %endif
107
108 %if %{mysql}
109 BuildRequires: mysql-devel >= 3.23
110 %endif
111
112 %if %{postgresql} && %{wb3}
113 BuildRequires: rh-postgresql-devel >= 7
114 %endif
115
116 %if %{postgresql} && ! %{wb3}
117 BuildRequires: postgresql-devel >= 7
118 %endif
119
120 %description
121 Bacula - It comes by night and sucks the vital essence from your computers.
122
123 Bacula is a set of computer programs that permit you (or the system 
124 administrator) to manage backup, recovery, and verification of computer 
125 data across a network of computers of different kinds. In technical terms, 
126 it is a network client/server based backup program. Bacula is relatively 
127 easy to use and efficient, while offering many advanced storage management 
128 features that make it easy to find and recover lost or damaged files. 
129 Bacula source code has been released under the GPL version 2 license.
130
131 %if %{mysql}
132 %package mysql
133 %endif
134 %if %{sqlite}
135 %package sqlite
136 %endif
137 %if %{postgresql}
138 %package postgresql
139 %endif
140
141 Summary: Bacula - The Network Backup Solution
142 Group: System Environment/Daemons
143 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
144 Conflicts: bacula-client
145 Requires: readline, ncurses, libstdc++, zlib
146 %if %{rh7}
147 Requires: glibc >= 2.2
148 Requires: libtermcap
149 %endif
150 %if %{su9}
151 Requires: glibc >= 2.3
152 Requires: termcap
153 %endif
154 %if ! %{rh7} && ! %{su9}
155 Requires: glibc >= 2.3
156 Requires: libtermcap
157 %endif
158 %if %{mysql} && ! %{su9}
159 Requires: mysql >= 3.23
160 Requires: mysql-server >= 3.23
161 %endif
162 %if %{mysql} && %{su9}
163 Requires: mysql >= 3.23
164 Requires: mysql-client >= 3.23
165 %endif
166 %if %{postgresql} && %{wb3}
167 Requires: rh-postgresql >= 7
168 Requires: rh-postgresql-server >= 7
169 %endif
170 %if %{postgresql} && ! %{wb3}
171 Requires: postgresql >= 7
172 Requires: postgresql-server >= 7
173 %endif
174
175 %if %{mysql}
176 %description mysql
177 %endif
178 %if %{sqlite}
179 %description sqlite
180 %endif
181 %if %{postgresql}
182 %description postgresql
183 %endif
184
185 Bacula - It comes by night and sucks the vital essence from your computers.
186
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.
194
195 %if %{mysql}
196 This build requires MySQL to be installed separately as the catalog database.
197 %endif
198 %if %{postgresql}
199 This build requires PostgreSQL to be installed separately as the catalog database.
200 %endif
201 %if %{sqlite}
202 This build incorporates sqlite as the catalog database, statically compiled.
203 %endif
204
205 %package client
206 Summary: Bacula - The Network Backup Solution
207 Group: System Environment/Daemons
208 Provides: bacula-fd
209 Requires: readline, libstdc++, zlib
210
211 %if %{rh7}
212 Requires: glibc >= 2.2
213 Requires: libtermcap
214 %endif
215 %if %{su9}
216 Requires: glibc >= 2.3
217 Requires: termcap
218 %endif
219 %if ! %{rh7} && ! %{su9}
220 Requires: glibc >= 2.3
221 Requires: libtermcap
222 %endif
223
224 %description client
225 Bacula - It comes by night and sucks the vital essence from your computers.
226
227 Bacula is a set of computer programs that permit you (or the system 
228 administrator) to manage backup, recovery, and verification of computer 
229 data across a network of computers of different kinds. In technical terms, 
230 it is a network client/server based backup program. Bacula is relatively 
231 easy to use and efficient, while offering many advanced storage management 
232 features that make it easy to find and recover lost or damaged files. 
233 Bacula source code has been released under the GPL version 2 license.
234
235 This is the File daemon (Client) only package. It includes the command line 
236 console program.
237
238 %package rescue
239
240 Summary: Bacula - The Network Backup Solution
241 Group: System Environment/Daemons
242 Requires: coreutils, util-linux, libc5, bacula-fd
243
244 %description rescue
245 Bacula - It comes by night and sucks the vital essence from your computers.
246
247 Bacula is a set of computer programs that permit you (or the system 
248 administrator) to manage backup, recovery, and verification of computer 
249 data across a network of computers of different kinds. In technical terms, 
250 it is a network client/server based backup program. Bacula is relatively 
251 easy to use and efficient, while offering many advanced storage management 
252 features that make it easy to find and recover lost or damaged files. 
253 Bacula source code has been released under the GPL version 2 license.
254
255 This package installs scripts for disaster recovery and builds rescue 
256 floppy disks for bare metal recovery. This package includes tomsrtbt
257 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
258 to build a boot floppy disk.
259
260 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or 
261 bacula-client package for your platform installed and configured before 
262 installing this package.
263
264 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
265 directory (this is done when the package is first installed), 
266 then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
267 directory. To make the bacula rescue disk run
268 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
269 from the /etc/bacula/rescue directory. To recreate the rescue
270 information for this system run ./getdiskinfo again.
271
272 %package updatedb
273
274 Summary: Bacula - The Network Backup Solution
275 Group: System Environment/Daemons
276
277 %description updatedb
278 Bacula - It comes by night and sucks the vital essence from your computers.
279
280 Bacula is a set of computer programs that permit you (or the system 
281 administrator) to manage backup, recovery, and verification of computer 
282 data across a network of computers of different kinds. In technical terms, 
283 it is a network client/server based backup program. Bacula is relatively 
284 easy to use and efficient, while offering many advanced storage management 
285 features that make it easy to find and recover lost or damaged files. 
286 Bacula source code has been released under the GPL version 2 license.
287
288 This package installs scripts for updating older versions of the bacula
289 database.
290
291 %package gconsole
292 Summary: Bacula - The Network Backup Solution
293 Group: System Environment/Daemons
294 Requires: readline, atk, libstdc++, zlib, pango, libxml2, bacula-fd
295
296 %if %{rh7}
297 Requires: gtk+ >= 1.2
298 Requires: gnome-libs >= 1.4
299 Requires: glibc >= 2.2
300 Requires: ORBit
301 Requires: bonobo
302 Requires: GConf
303 %endif
304 %if %{su9}
305 Requires: gtk2 >= 2.0
306 Requires: libgnomeui >= 2.0
307 Requires: glibc >= 2.3
308 Requires: ORBit2
309 Requires: libart_lgpl >= 2.0
310 Requires: libbonobo >= 2.0
311 Requires: libbonoboui >= 2.0
312 Requires: bonobo-activation
313 Requires: gconf2
314 Requires: linc
315 %endif
316 %if ! %{rh7} && ! %{su9}
317 Requires: gtk2 >= 2.0
318 Requires: libgnomeui >= 2.0
319 Requires: glibc >= 2.3
320 Requires: ORBit2
321 Requires: libart_lgpl >= 2.0
322 Requires: libbonobo >= 2.0
323 Requires: libbonoboui >= 2.0
324 Requires: bonobo-activation
325 Requires: GConf2
326 Requires: linc
327 %endif
328 %if %{su9}
329 Requires: xsu
330 %else
331 Requires: usermode
332 %endif
333
334 %description gconsole
335 Bacula - It comes by night and sucks the vital essence from your computers.
336
337 Bacula is a set of computer programs that permit you (or the system 
338 administrator) to manage backup, recovery, and verification of computer 
339 data across a network of computers of different kinds. In technical terms, 
340 it is a network client/server based backup program. Bacula is relatively 
341 easy to use and efficient, while offering many advanced storage management 
342 features that make it easy to find and recover lost or damaged files. 
343 Bacula source code has been released under the GPL version 2 license.
344
345 This is the Gnome Console package. It is an add-on to the client or
346 server packages.
347
348 %prep
349
350 %setup -b 1
351 %setup -b 2
352 %setup -b 3
353
354 %build
355
356 %if %{su9}
357 export LDFLAGS="-L/usr/lib/termcap"
358 %endif
359
360 cwd=${PWD}
361 cd %{depkgs}
362 %if %{sqlite}
363 make sqlite
364 %endif
365 make mtx
366 cd ${cwd}
367
368 # patches for the bundled sqlite scripts
369
370 # patch the make_sqlite_tables script for installation bindir
371 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
372
373 # patch the create_sqlite_database script for installation bindir
374 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
375
376 # patch the make_catalog_backup script for installation bindir
377 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
378
379 # patch the update_sqlite_tables script for installation bindir
380 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
381
382 %configure \
383         --prefix=/usr \
384         --sbindir=/usr/sbin \
385         --sysconfdir=/etc/bacula \
386         --with-scriptdir=/etc/bacula \
387         --enable-smartalloc \
388         --enable-gnome \
389         --enable-static-fd \
390 %if %{mysql}
391         --with-mysql \
392 %endif
393 %if %{sqlite}
394         --with-sqlite=${cwd}/../depkgs/sqlite \
395 %endif
396 %if %{postgresql}
397         --with-postgresql \
398 %endif
399         --with-working-dir=%{working_dir} \
400         --with-pid-dir=/var/run \
401         --with-subsys-dir=/var/lock/subsys \
402         --with-dir-user=%{daemon_user} \
403         --with-dir-group=%{daemon_group} \
404         --with-sd-user=%{daemon_user} \
405         --with-sd-group=%{daemon_group} \
406         --with-fd-user=%{daemon_user} \
407         --with-fd-group=%{daemon_group}
408 make
409
410 cd src/filed
411 strip static-bacula-fd
412 cd ../../
413
414 %install
415  
416 cwd=${PWD}
417 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
418 mkdir -p $RPM_BUILD_ROOT/etc/init.d
419 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
420 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
421 %if %{rh7}
422 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
423 %else
424 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
425 %endif
426 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
427 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
428 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
429 %if ! %{su9}
430 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
431 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
432 mkdir -p $RPM_BUILD_ROOT/usr/bin
433 %endif
434
435 %if %{sqlite}
436 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
437 %endif
438
439 make \
440         prefix=$RPM_BUILD_ROOT/usr \
441         sbindir=$RPM_BUILD_ROOT/usr/sbin \
442         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
443         scriptdir=$RPM_BUILD_ROOT/etc/bacula \
444         working_dir=$RPM_BUILD_ROOT%{working_dir} \
445         install
446
447 cd %{depkgs}
448 make \
449         prefix=$RPM_BUILD_ROOT/usr \
450         sbindir=$RPM_BUILD_ROOT/usr/sbin \
451         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
452         working_dir=$RPM_BUILD_ROOT%{working_dir} \
453         mandir=$RPM_BUILD_ROOT/usr/man \
454         mtx-install
455 cd ${cwd}
456
457 # setup the manual for the doc dir and correct some broken CVS permissions
458 mkdir html-manual
459 cp -p doc/html-manual/*.html html-manual/
460 cp -p doc/html-manual/*.jpg html-manual/
461 cp -p doc/html-manual/*.gif html-manual/
462 cp -p doc/html-manual/*.css html-manual/
463 chmod 644 html-manual/*
464 chmod 644 doc/bacula.pdf
465
466 # fixme - make installs the mysql scripts for sqlite build
467 %if %{sqlite}
468 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
469 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
470 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
471 %endif
472
473 # fixme - make installs the mysql scripts for postgresql build
474 %if %{postgresql}
475 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
476 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
477 %endif
478
479 # install the init scripts
480 %if %{su9}
481 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
482 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
483 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
484 %else
485 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
486 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
487 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
488 %endif
489 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
490
491 # install the menu stuff
492 %if %{su9}
493 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
494 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
495 %endif
496 %if %{rh7}
497 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
498 cp -p scripts/bacula.desktop.gnome1.consolehelper $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
499 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
500 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
501 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
502 %endif
503 %if %{rh8} || %{rh9} || %{wb3} || %{fc1}
504 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
505 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
506 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
507 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
508 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
509 %endif
510
511 # install sqlite
512 %if %{sqlite}
513 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
514 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
515 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
516 %endif
517
518 # install the logrotate file
519 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
520
521 # install the rescue stuff
522 # these are the rescue scripts
523 cp -p rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
524 cp -p rescue/linux/floppy/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
525 cp -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
526 cp -p rescue/linux/floppy/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
527 cp -p rescue/linux/floppy/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
528 cp -p rescue/linux/floppy/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
529 cp -p rescue/linux/floppy/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
530 cp -p rescue/linux/floppy/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
531 cp -p rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
532
533 # this is the static file daemon
534 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
535
536 # this is the tom's root boot disk
537 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
538
539 # install the updatedb scripts
540 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
541
542 # now clean up permissions that are left broken by the install
543 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
544 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
545
546 %clean
547 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
548
549 %if %{mysql}
550
551 %files mysql
552 %defattr(-,root,root)
553
554 /etc/bacula/bacula
555 /etc/bacula/bconsole
556 /etc/bacula/create_mysql_database
557 /etc/bacula/drop_mysql_database
558 /etc/bacula/make_mysql_tables
559 /etc/bacula/drop_mysql_tables
560 /etc/bacula/update_mysql_tables
561 /etc/bacula/grant_mysql_privileges
562 /etc/bacula/create_bacula_database
563 /etc/bacula/drop_bacula_database
564 /etc/bacula/grant_bacula_privileges
565 /etc/bacula/make_bacula_tables
566 /etc/bacula/drop_bacula_tables
567 /etc/bacula/update_bacula_tables
568 /etc/bacula/make_catalog_backup
569 /etc/bacula/delete_catalog_backup
570 /etc/bacula/startmysql
571 /etc/bacula/stopmysql
572 /etc/bacula/mtx-changer
573 /etc/init.d/bacula-dir
574 /etc/init.d/bacula-fd
575 /etc/init.d/bacula-sd
576
577 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
578 /usr/man/man1/*
579
580 /etc/logrotate.d/bacula
581
582 %config(noreplace) /etc/bacula/bacula-dir.conf
583 %config(noreplace) /etc/bacula/bacula-fd.conf
584 %config(noreplace) /etc/bacula/bacula-sd.conf
585 %config(noreplace) /etc/bacula/bconsole.conf
586 /etc/bacula/query.sql
587 %dir %{working_dir}
588
589 /usr/sbin/bacula-dir
590 /usr/sbin/bacula-fd
591 /usr/sbin/bacula-sd
592 /usr/sbin/bcopy
593 /usr/sbin/bextract
594 /usr/sbin/bls
595 /usr/sbin/bscan
596 /usr/sbin/btape
597 /usr/sbin/btraceback
598 /usr/sbin/bconsole
599 /usr/sbin/dbcheck
600 /usr/sbin/loaderinfo
601 /usr/sbin/mtx
602 /usr/sbin/scsitape
603 /usr/sbin/bsmtp
604 /usr/sbin/tapeinfo
605 /usr/sbin/static-bacula-fd
606 /etc/bacula/btraceback.gdb
607
608 %pre mysql
609 # test for bacula database older than version 6
610 # note: this ASSUMES no password has been set for bacula database
611 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
612
613 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
614         echo "This bacula upgrade will update a bacula database from version 6 to 7."
615         echo "You appear to be running database version $DB_VER. You must first update"
616         echo "your database to version 6 and then install this upgrade. The alternative"
617         echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
618         echo "catalog information, then do the upgrade. Information on updating a"
619         echo "database older than version 6 can be found in the release notes."
620         exit 1
621 fi
622 # check for and copy /etc/bacula/console.conf to bconsole.conf
623 if [ -s /etc/bacula/console.conf ];then
624         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
625 fi
626
627 %post mysql
628
629 # add our links
630 if [ "$1" -ge 1 ] ; then
631 /sbin/chkconfig --add bacula-dir
632 /sbin/chkconfig --add bacula-fd
633 /sbin/chkconfig --add bacula-sd
634 fi
635
636 # test for an existing database
637 # note: this ASSUMES no password has been set for bacula database
638 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
639
640 # grant privileges and create tables if they do not exist
641 if [ -z "$DB_VER" ]; then
642         echo "Hmm, doesn't look like you have an existing database."
643         echo "Granting privileges for MySQL user bacula..."
644         /etc/bacula/grant_mysql_privileges
645         echo "Creating MySQL bacula database..."
646         /etc/bacula/create_mysql_database
647         echo "Creating bacula tables..."
648         /etc/bacula/make_mysql_tables
649
650 # check to see if we need to upgrade a 1.32 or lower database
651 elif [ "$DB_VER" -lt "7" ]; then
652         echo "This release requires an upgrade to your bacula database."
653         echo "Backing up your current database..."
654         mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
655         echo "Upgrading bacula database ..."
656         /etc/bacula/update_mysql_tables
657         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
658
659 fi
660
661 # create the daemon group
662 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
663 if [ -z $HAVE_BACULA ]; then
664         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
665         echo "The group %{daemon_group} has been added to %{groupfile}."
666         echo "See the manual chapter Running Bacula for details."
667 fi
668
669 %preun mysql
670 # delete our links
671 if [ $1 = 0 ]; then
672 /sbin/chkconfig --del bacula-dir
673 /sbin/chkconfig --del bacula-fd
674 /sbin/chkconfig --del bacula-sd
675 fi
676
677 %endif
678
679 %if %{sqlite}
680
681 %files sqlite
682 %defattr(-,root,root)
683
684 /etc/bacula/bacula
685 /etc/bacula/bconsole
686 /etc/bacula/create_bacula_database
687 /etc/bacula/drop_bacula_database
688 /etc/bacula/grant_bacula_privileges
689 /etc/bacula/make_bacula_tables
690 /etc/bacula/drop_bacula_tables
691 /etc/bacula/update_bacula_tables
692 /etc/bacula/create_sqlite_database
693 /etc/bacula/drop_sqlite_database
694 /etc/bacula/grant_sqlite_privileges
695 /etc/bacula/make_sqlite_tables
696 /etc/bacula/drop_sqlite_tables
697 /etc/bacula/update_sqlite_tables
698 /etc/bacula/make_catalog_backup
699 /etc/bacula/delete_catalog_backup
700 /etc/bacula/mtx-changer
701 /etc/init.d/bacula-dir
702 /etc/init.d/bacula-fd
703 /etc/init.d/bacula-sd
704
705 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
706 /usr/man/man1/*
707
708 /etc/logrotate.d/bacula
709
710 %config(noreplace) /etc/bacula/bacula-dir.conf
711 %config(noreplace) /etc/bacula/bacula-fd.conf
712 %config(noreplace) /etc/bacula/bacula-sd.conf
713 %config(noreplace) /etc/bacula/bconsole.conf
714 /etc/bacula/query.sql
715 %{sqlite_bindir}/libsqlite.a
716 %{sqlite_bindir}/sqlite.h
717 %dir %{working_dir}
718
719 /usr/sbin/bacula-dir
720 /usr/sbin/bacula-fd
721 /usr/sbin/bacula-sd
722 /usr/sbin/bcopy
723 /usr/sbin/bextract
724 /usr/sbin/bls
725 /usr/sbin/bscan
726 /usr/sbin/btape
727 /usr/sbin/btraceback
728 /usr/sbin/bconsole
729 /usr/sbin/dbcheck
730 /usr/sbin/loaderinfo
731 /usr/sbin/mtx
732 /usr/sbin/scsitape
733 /usr/sbin/bsmtp
734 /usr/sbin/tapeinfo
735 /usr/sbin/static-bacula-fd
736 %{sqlite_bindir}/sqlite
737 /etc/bacula/btraceback.gdb
738
739 %pre sqlite
740 # test for bacula database older than version 6
741 if [ -s %{working_dir}/bacula.db ];then
742         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
743         if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
744                 echo "This bacula upgrade will update a bacula database from version 6 to 7."
745                 echo "You appear to be running database version $DB_VER. You must first update"
746                 echo "your database to version 6 and then install this upgrade. The alternative"
747                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
748                 echo "catalog information, then do the upgrade. Information on updating a"
749                 echo "database older than version 6 can be found in the release notes."
750                 exit 1
751         fi
752 fi
753 # check for and copy /etc/bacula/console.conf to bconsole.conf
754 if [ -s /etc/bacula/console.conf ];then
755         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
756 fi
757
758 %post sqlite
759 # add our links
760 if [ "$1" -ge 1 ] ; then
761 /sbin/chkconfig --add bacula-dir
762 /sbin/chkconfig --add bacula-fd
763 /sbin/chkconfig --add bacula-sd
764 fi
765
766 # test for an existing database
767 if [ -s %{working_dir}/bacula.db ]; then
768         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
769         # check to see if we need to upgrade a 1.32 or lower database
770         if [ "$DB_VER" -lt "7" ]; then
771                 echo "This release requires an upgrade to your bacula database."
772                 echo "Backing up your current database..."
773                 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
774                 echo "Upgrading bacula database ..."
775                 /etc/bacula/update_sqlite_tables
776                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
777         fi
778 else
779         # create the database and tables
780         echo "Hmm, doesn't look like you have an existing database."
781         echo "Creating SQLite database..."
782         /etc/bacula/create_sqlite_database
783         echo "Creating the SQLite tables..."
784         /etc/bacula/make_sqlite_tables
785 fi
786
787 # create the daemon group
788 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
789 if [ -z $HAVE_BACULA ]; then
790         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
791         echo "The group %{daemon_group} has been added to %{groupfile}."
792         echo "See the manual chapter Running Bacula for details."
793 fi
794
795 %preun sqlite
796 # delete our links
797 if [ $1 = 0 ]; then
798 /sbin/chkconfig --del bacula-dir
799 /sbin/chkconfig --del bacula-fd
800 /sbin/chkconfig --del bacula-sd
801 fi
802
803 %endif
804
805 %if %{postgresql}
806
807 %files postgresql
808 %defattr(-,root,root)
809
810 /etc/bacula/bacula
811 /etc/bacula/bconsole
812 /etc/bacula/create_postgresql_database
813 /etc/bacula/drop_postgresql_database
814 /etc/bacula/make_postgresql_tables
815 /etc/bacula/drop_postgresql_tables
816 /etc/bacula/update_postgresql_tables
817 /etc/bacula/grant_postgresql_privileges
818 /etc/bacula/create_bacula_database
819 /etc/bacula/drop_bacula_database
820 /etc/bacula/grant_bacula_privileges
821 /etc/bacula/make_bacula_tables
822 /etc/bacula/drop_bacula_tables
823 /etc/bacula/update_bacula_tables
824 /etc/bacula/make_catalog_backup
825 /etc/bacula/delete_catalog_backup
826 /etc/bacula/mtx-changer
827 /etc/init.d/bacula-dir
828 /etc/init.d/bacula-fd
829 /etc/init.d/bacula-sd
830
831 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
832 /usr/man/man1/*
833
834 /etc/logrotate.d/bacula
835
836 %config(noreplace) /etc/bacula/bacula-dir.conf
837 %config(noreplace) /etc/bacula/bacula-fd.conf
838 %config(noreplace) /etc/bacula/bacula-sd.conf
839 %config(noreplace) /etc/bacula/bconsole.conf
840 /etc/bacula/query.sql
841 %dir %{working_dir}
842
843 /usr/sbin/bacula-dir
844 /usr/sbin/bacula-fd
845 /usr/sbin/bacula-sd
846 /usr/sbin/bcopy
847 /usr/sbin/bextract
848 /usr/sbin/bls
849 /usr/sbin/bscan
850 /usr/sbin/btape
851 /usr/sbin/btraceback
852 /usr/sbin/bconsole
853 /usr/sbin/dbcheck
854 /usr/sbin/loaderinfo
855 /usr/sbin/mtx
856 /usr/sbin/scsitape
857 /usr/sbin/bsmtp
858 /usr/sbin/tapeinfo
859 /usr/sbin/static-bacula-fd
860 /etc/bacula/btraceback.gdb
861
862 %post postgresql
863 # add our links
864 if [ "$1" -ge 1 ] ; then
865 /sbin/chkconfig --add bacula-dir
866 /sbin/chkconfig --add bacula-fd
867 /sbin/chkconfig --add bacula-sd
868 fi
869
870 # test for an existing database
871 # note: this ASSUMES no password has been set for bacula database
872 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
873
874 # grant privileges and create tables if they do not exist
875 if [ -z "$DB_VER" ]; then
876         echo "Hmm, doesn't look like you have an existing database."
877         echo "Granting privileges for PostgreSQL user bacula..."
878         /etc/bacula/grant_postgresql_privileges
879         echo "Creating PostgreSQL bacula database..."
880         /etc/bacula/create_postgresql_database
881         echo "Creating bacula tables..."
882         /etc/bacula/make_postgresql_tables
883 fi
884
885 # create the daemon group
886 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
887 if [ -z $HAVE_BACULA ]; then
888         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
889         echo "The group %{daemon_group} has been added to %{groupfile}."
890         echo "See the manual chapter Running Bacula for details."
891 fi
892         
893
894 %preun postgresql
895 # delete our links
896 if [ $1 = 0 ]; then
897 /sbin/chkconfig --del bacula-dir
898 /sbin/chkconfig --del bacula-fd
899 /sbin/chkconfig --del bacula-sd
900 fi
901
902 %endif
903
904 %files client
905 %defattr(-,root,root)
906
907 /etc/bacula/bconsole
908 /etc/init.d/bacula-fd
909
910 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
911 /etc/logrotate.d/bacula
912
913 %config(noreplace) /etc/bacula/bacula-fd.conf
914 %config(noreplace) /etc/bacula/bconsole.conf
915 %dir %{working_dir}
916
917 /usr/sbin/bacula-fd
918 /usr/sbin/btraceback
919 /etc/bacula/btraceback.gdb
920 /usr/sbin/bsmtp
921 /usr/sbin/bconsole
922
923
924 %post client
925 # add our link
926 if [ "$1" -ge 1 ] ; then
927 /sbin/chkconfig --add bacula-fd
928 fi
929
930 # create the daemon group
931 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
932 if [ -z $HAVE_BACULA ]; then
933         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
934         echo "The group %{daemon_group} has been added to %{groupfile}."
935         echo "See the manual chapter Running Bacula for details."
936 fi
937
938 %preun client
939 # delete our link
940 if [ $1 = 0 ]; then
941 /sbin/chkconfig --del bacula-fd
942 fi
943
944 %files rescue
945 %defattr(-,root,root)
946 /etc/bacula/rescue/backup.etc.list
947 /etc/bacula/rescue/format_floppy
948 /etc/bacula/rescue/getdiskinfo
949 /etc/bacula/rescue/make_rescue_disk
950 /etc/bacula/rescue/restore_bacula
951 /etc/bacula/rescue/restore_etc
952 /etc/bacula/rescue/run_grub
953 /etc/bacula/rescue/run_lilo
954 /etc/bacula/rescue/sfdisk.bz2
955 /etc/bacula/rescue/bacula-fd
956 /etc/bacula/rescue/tomsrtbt/*
957
958 %post rescue
959 # link our current installed conf file to the rescue directory
960 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
961
962 # run getdiskinfo
963 echo "Creating rescue files for this system..."
964 cd /etc/bacula/rescue
965 ./getdiskinfo
966
967 %preun rescue
968 # remove the files created after the initial rpm installation
969 rm -f /etc/bacula/rescue/bacula-fd.conf
970 rm -f /etc/bacula/rescue/partition.*
971 rm -f /etc/bacula/rescue/format.*
972 rm -f /etc/bacula/rescue/mount_drives
973 rm -f /etc/bacula/rescue/start_network
974 rm -f /etc/bacula/rescue/sfdisk
975 rm -rf /etc/bacula/rescue/diskinfo/*
976
977 %files updatedb
978 %defattr(-,root,root)
979 /etc/bacula/updatedb/*
980
981 %post updatedb
982 echo "The database update scripts were installed to /etc/bacula/updatedb"
983
984 %files gconsole
985 %defattr(-,root,root)
986 /usr/sbin/gnome-console
987 /etc/bacula/gconsole
988 %config(noreplace) /etc/bacula/gnome-console.conf
989 /usr/share/pixmaps/bacula.png
990 %if %{rh7}
991 /usr/share/gnome/apps/System/bacula.desktop
992 %else
993 /usr/share/applications/bacula.desktop
994 %endif
995
996 %if ! %{su9} 
997 # add the console helper files
998 %config(noreplace,missingok) /etc/pam.d/gnome-console
999 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1000 /usr/bin/gnome-console
1001 %endif
1002
1003
1004 %changelog
1005 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1006 - add documentation to console for groupadd
1007 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1008 - add support for running daemons as root.bacula
1009 - correct for change in location of floppy rescue files in 1.35.2
1010 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1011 - updated depgkgs to 30Jul04
1012 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1013 - really, really fix symlink creation for gconsole
1014 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1015 - fix symlink creation in gconsole post install
1016 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1017 - fixed error in gconsole post script
1018 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1019 - add check for gconsole symlink before trying to create it
1020 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1021 - fix some minor permissions issues on doc files that CVS won't let us fix
1022 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1023 - add pkgconfig to BuildRequires
1024 - clean up gnome1/2 menu entries for appropriate packages
1025 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1026 - tightened up doc distribution
1027 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1028 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1029 - rpm's horrible bug that prevents nested conditional macros prevents me
1030 - from implementing these 2 separate approaches within the conditionals which
1031 - create the separate server packages.
1032 - the solution adopted is to remove the gnome-console files from the server packages
1033 - so bacula-gconsole is now an add on for both client and server packages.
1034 - this also now allows the server packages to be install on machines without
1035 - an X-server and we can still maintain a single spec file.
1036 - added tests to make sure we have defined platform and database macros.
1037 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1038 - corrected mysql prerequisites for suse
1039 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1040 - replaced all cp commands with cp -p
1041 - removed addition of a+x permissions on gnome-console
1042 - corrected permissions on init scripts
1043 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1044 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1045 -
1046 - various cleanup patches from Michael K. Johnson:
1047 - corrected post install routines for nicer chkconfig
1048 - removed chmod changes in post routines and moved to install section
1049 - removed interactive nature of post routine for rescue package
1050 - added description of building rescue disks to the description of rescue package
1051 - added clean of build root to beginning of install
1052 - removed specifying attr in all file lists
1053 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1054 - added bconsole to client package
1055 - added gconsole package as add-on to client
1056 - removed spurious dependancies on updatedb package (!cut/paste)
1057 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1058 - added updatedb package
1059 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1060 - added postgresql package
1061 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1062 - corrected the if else logic in the dependancy sections
1063 - changes for 1.34 release
1064 - /etc/bacula/console is now /etc/bacula/bconsole
1065 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1066 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1067 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1068 - added new /etc/bacula/drop_mysql_database
1069 - added new /etc/bacula/drop_sqlite_database
1070 - added new /etc/bacula/grant_sqlite_privileges
1071 - added new generic bacula database scripts in /etc/bacula
1072 - added pre-install sections to check for database versions older than 6
1073 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1074 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1075 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1076 - added testing for existing databases before executing any of the database creation scripts
1077 - added defines working_dir and sqlite_bindir in place of hard coded paths
1078 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1079 - added build configuration for SuSE.
1080 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1081 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1082 - added patch for create_sqlite_database to fix the installed bindir
1083 - added execute of create_sqlite_database to post of sqlite package
1084 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1085 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1086 - added bacula-fd as Requires for rescue package
1087 - added build tag for Fedora Core 1
1088 - cleaned up dependancies for all builds
1089 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1090 - removed rh_version from package names
1091 - added platform build configuration section to beginning of file
1092 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1093 - removed make_static_bacula script from rescue package install
1094 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1095 - Added define at top of file for depkgs version
1096 - Added rescue sub-package
1097 - Moved requires statements into proper sub-package locations
1098 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1099 - Corrected Requires for Gnome 1.4/2.0 builds
1100 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1101 - Added separate source declaration for depkgs
1102 - added patch for make_catalog_backup script
1103 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1104 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1105 - Added rh_version to sub-package names
1106 - Added installed but missing file /etc/bacula/gconsole
1107 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1108 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1109 - Update spec for version 1.31 and combine client
1110 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1111 - Initial spec file