]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/suse/bacula.spec.in
Support running as root.bacula, other changes for 1.35.2
[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 fi
666
667 %preun mysql
668 # delete our links
669 if [ $1 = 0 ]; then
670 /sbin/chkconfig --del bacula-dir
671 /sbin/chkconfig --del bacula-fd
672 /sbin/chkconfig --del bacula-sd
673 fi
674
675 %endif
676
677 %if %{sqlite}
678
679 %files sqlite
680 %defattr(-,root,root)
681
682 /etc/bacula/bacula
683 /etc/bacula/bconsole
684 /etc/bacula/create_bacula_database
685 /etc/bacula/drop_bacula_database
686 /etc/bacula/grant_bacula_privileges
687 /etc/bacula/make_bacula_tables
688 /etc/bacula/drop_bacula_tables
689 /etc/bacula/update_bacula_tables
690 /etc/bacula/create_sqlite_database
691 /etc/bacula/drop_sqlite_database
692 /etc/bacula/grant_sqlite_privileges
693 /etc/bacula/make_sqlite_tables
694 /etc/bacula/drop_sqlite_tables
695 /etc/bacula/update_sqlite_tables
696 /etc/bacula/make_catalog_backup
697 /etc/bacula/delete_catalog_backup
698 /etc/bacula/mtx-changer
699 /etc/init.d/bacula-dir
700 /etc/init.d/bacula-fd
701 /etc/init.d/bacula-sd
702
703 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
704 /usr/man/man1/*
705
706 /etc/logrotate.d/bacula
707
708 %config(noreplace) /etc/bacula/bacula-dir.conf
709 %config(noreplace) /etc/bacula/bacula-fd.conf
710 %config(noreplace) /etc/bacula/bacula-sd.conf
711 %config(noreplace) /etc/bacula/bconsole.conf
712 /etc/bacula/query.sql
713 %{sqlite_bindir}/libsqlite.a
714 %{sqlite_bindir}/sqlite.h
715 %dir %{working_dir}
716
717 /usr/sbin/bacula-dir
718 /usr/sbin/bacula-fd
719 /usr/sbin/bacula-sd
720 /usr/sbin/bcopy
721 /usr/sbin/bextract
722 /usr/sbin/bls
723 /usr/sbin/bscan
724 /usr/sbin/btape
725 /usr/sbin/btraceback
726 /usr/sbin/bconsole
727 /usr/sbin/dbcheck
728 /usr/sbin/loaderinfo
729 /usr/sbin/mtx
730 /usr/sbin/scsitape
731 /usr/sbin/bsmtp
732 /usr/sbin/tapeinfo
733 /usr/sbin/static-bacula-fd
734 %{sqlite_bindir}/sqlite
735 /etc/bacula/btraceback.gdb
736
737 %pre sqlite
738 # test for bacula database older than version 6
739 if [ -s %{working_dir}/bacula.db ];then
740         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
741         if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
742                 echo "This bacula upgrade will update a bacula database from version 6 to 7."
743                 echo "You appear to be running database version $DB_VER. You must first update"
744                 echo "your database to version 6 and then install this upgrade. The alternative"
745                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
746                 echo "catalog information, then do the upgrade. Information on updating a"
747                 echo "database older than version 6 can be found in the release notes."
748                 exit 1
749         fi
750 fi
751 # check for and copy /etc/bacula/console.conf to bconsole.conf
752 if [ -s /etc/bacula/console.conf ];then
753         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
754 fi
755
756 %post sqlite
757 # add our links
758 if [ "$1" -ge 1 ] ; then
759 /sbin/chkconfig --add bacula-dir
760 /sbin/chkconfig --add bacula-fd
761 /sbin/chkconfig --add bacula-sd
762 fi
763
764 # test for an existing database
765 if [ -s %{working_dir}/bacula.db ]; then
766         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
767         # check to see if we need to upgrade a 1.32 or lower database
768         if [ "$DB_VER" -lt "7" ]; then
769                 echo "This release requires an upgrade to your bacula database."
770                 echo "Backing up your current database..."
771                 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
772                 echo "Upgrading bacula database ..."
773                 /etc/bacula/update_sqlite_tables
774                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
775         fi
776 else
777         # create the database and tables
778         echo "Hmm, doesn't look like you have an existing database."
779         echo "Creating SQLite database..."
780         /etc/bacula/create_sqlite_database
781         echo "Creating the SQLite tables..."
782         /etc/bacula/make_sqlite_tables
783 fi
784
785 # create the daemon group
786 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
787 if [ -z $HAVE_BACULA ]; then
788         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
789 fi
790
791 %preun sqlite
792 # delete our links
793 if [ $1 = 0 ]; then
794 /sbin/chkconfig --del bacula-dir
795 /sbin/chkconfig --del bacula-fd
796 /sbin/chkconfig --del bacula-sd
797 fi
798
799 %endif
800
801 %if %{postgresql}
802
803 %files postgresql
804 %defattr(-,root,root)
805
806 /etc/bacula/bacula
807 /etc/bacula/bconsole
808 /etc/bacula/create_postgresql_database
809 /etc/bacula/drop_postgresql_database
810 /etc/bacula/make_postgresql_tables
811 /etc/bacula/drop_postgresql_tables
812 /etc/bacula/update_postgresql_tables
813 /etc/bacula/grant_postgresql_privileges
814 /etc/bacula/create_bacula_database
815 /etc/bacula/drop_bacula_database
816 /etc/bacula/grant_bacula_privileges
817 /etc/bacula/make_bacula_tables
818 /etc/bacula/drop_bacula_tables
819 /etc/bacula/update_bacula_tables
820 /etc/bacula/make_catalog_backup
821 /etc/bacula/delete_catalog_backup
822 /etc/bacula/mtx-changer
823 /etc/init.d/bacula-dir
824 /etc/init.d/bacula-fd
825 /etc/init.d/bacula-sd
826
827 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
828 /usr/man/man1/*
829
830 /etc/logrotate.d/bacula
831
832 %config(noreplace) /etc/bacula/bacula-dir.conf
833 %config(noreplace) /etc/bacula/bacula-fd.conf
834 %config(noreplace) /etc/bacula/bacula-sd.conf
835 %config(noreplace) /etc/bacula/bconsole.conf
836 /etc/bacula/query.sql
837 %dir %{working_dir}
838
839 /usr/sbin/bacula-dir
840 /usr/sbin/bacula-fd
841 /usr/sbin/bacula-sd
842 /usr/sbin/bcopy
843 /usr/sbin/bextract
844 /usr/sbin/bls
845 /usr/sbin/bscan
846 /usr/sbin/btape
847 /usr/sbin/btraceback
848 /usr/sbin/bconsole
849 /usr/sbin/dbcheck
850 /usr/sbin/loaderinfo
851 /usr/sbin/mtx
852 /usr/sbin/scsitape
853 /usr/sbin/bsmtp
854 /usr/sbin/tapeinfo
855 /usr/sbin/static-bacula-fd
856 /etc/bacula/btraceback.gdb
857
858 %post postgresql
859 # add our links
860 if [ "$1" -ge 1 ] ; then
861 /sbin/chkconfig --add bacula-dir
862 /sbin/chkconfig --add bacula-fd
863 /sbin/chkconfig --add bacula-sd
864 fi
865
866 # test for an existing database
867 # note: this ASSUMES no password has been set for bacula database
868 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
869
870 # grant privileges and create tables if they do not exist
871 if [ -z "$DB_VER" ]; then
872         echo "Hmm, doesn't look like you have an existing database."
873         echo "Granting privileges for PostgreSQL user bacula..."
874         /etc/bacula/grant_postgresql_privileges
875         echo "Creating PostgreSQL bacula database..."
876         /etc/bacula/create_postgresql_database
877         echo "Creating bacula tables..."
878         /etc/bacula/make_postgresql_tables
879 fi
880
881 # create the daemon group
882 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
883 if [ -z $HAVE_BACULA ]; then
884         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
885 fi
886         
887
888 %preun postgresql
889 # delete our links
890 if [ $1 = 0 ]; then
891 /sbin/chkconfig --del bacula-dir
892 /sbin/chkconfig --del bacula-fd
893 /sbin/chkconfig --del bacula-sd
894 fi
895
896 %endif
897
898 %files client
899 %defattr(-,root,root)
900
901 /etc/bacula/bconsole
902 /etc/init.d/bacula-fd
903
904 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
905 /etc/logrotate.d/bacula
906
907 %config(noreplace) /etc/bacula/bacula-fd.conf
908 %config(noreplace) /etc/bacula/bconsole.conf
909 %dir %{working_dir}
910
911 /usr/sbin/bacula-fd
912 /usr/sbin/btraceback
913 /etc/bacula/btraceback.gdb
914 /usr/sbin/bsmtp
915 /usr/sbin/bconsole
916
917
918 %post client
919 # add our link
920 if [ "$1" -ge 1 ] ; then
921 /sbin/chkconfig --add bacula-fd
922 fi
923
924 # create the daemon group
925 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
926 if [ -z $HAVE_BACULA ]; then
927         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
928 fi
929
930 %preun client
931 # delete our link
932 if [ $1 = 0 ]; then
933 /sbin/chkconfig --del bacula-fd
934 fi
935
936 %files rescue
937 %defattr(-,root,root)
938 /etc/bacula/rescue/backup.etc.list
939 /etc/bacula/rescue/format_floppy
940 /etc/bacula/rescue/getdiskinfo
941 /etc/bacula/rescue/make_rescue_disk
942 /etc/bacula/rescue/restore_bacula
943 /etc/bacula/rescue/restore_etc
944 /etc/bacula/rescue/run_grub
945 /etc/bacula/rescue/run_lilo
946 /etc/bacula/rescue/sfdisk.bz2
947 /etc/bacula/rescue/bacula-fd
948 /etc/bacula/rescue/tomsrtbt/*
949
950 %post rescue
951 # link our current installed conf file to the rescue directory
952 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
953
954 # run getdiskinfo
955 echo "Creating rescue files for this system..."
956 cd /etc/bacula/rescue
957 ./getdiskinfo
958
959 %preun rescue
960 # remove the files created after the initial rpm installation
961 rm -f /etc/bacula/rescue/bacula-fd.conf
962 rm -f /etc/bacula/rescue/partition.*
963 rm -f /etc/bacula/rescue/format.*
964 rm -f /etc/bacula/rescue/mount_drives
965 rm -f /etc/bacula/rescue/start_network
966 rm -f /etc/bacula/rescue/sfdisk
967 rm -rf /etc/bacula/rescue/diskinfo/*
968
969 %files updatedb
970 %defattr(-,root,root)
971 /etc/bacula/updatedb/*
972
973 %post updatedb
974 echo "The database update scripts were installed to /etc/bacula/updatedb"
975
976 %files gconsole
977 %defattr(-,root,root)
978 /usr/sbin/gnome-console
979 /etc/bacula/gconsole
980 %config(noreplace) /etc/bacula/gnome-console.conf
981 /usr/share/pixmaps/bacula.png
982 %if %{rh7}
983 /usr/share/gnome/apps/System/bacula.desktop
984 %else
985 /usr/share/applications/bacula.desktop
986 %endif
987
988 %if ! %{su9} 
989 # add the console helper files
990 %config(noreplace,missingok) /etc/pam.d/gnome-console
991 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
992 /usr/bin/gnome-console
993 %endif
994
995
996 %changelog
997 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
998 - add support for running daemons as root.bacula
999 - correct for change in location of floppy rescue files in 1.35.2
1000 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1001 - updated depgkgs to 30Jul04
1002 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1003 - really, really fix symlink creation for gconsole
1004 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1005 - fix symlink creation in gconsole post install
1006 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1007 - fixed error in gconsole post script
1008 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1009 - add check for gconsole symlink before trying to create it
1010 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1011 - fix some minor permissions issues on doc files that CVS won't let us fix
1012 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1013 - add pkgconfig to BuildRequires
1014 - clean up gnome1/2 menu entries for appropriate packages
1015 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1016 - tightened up doc distribution
1017 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1018 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1019 - rpm's horrible bug that prevents nested conditional macros prevents me
1020 - from implementing these 2 separate approaches within the conditionals which
1021 - create the separate server packages.
1022 - the solution adopted is to remove the gnome-console files from the server packages
1023 - so bacula-gconsole is now an add on for both client and server packages.
1024 - this also now allows the server packages to be install on machines without
1025 - an X-server and we can still maintain a single spec file.
1026 - added tests to make sure we have defined platform and database macros.
1027 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1028 - corrected mysql prerequisites for suse
1029 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1030 - replaced all cp commands with cp -p
1031 - removed addition of a+x permissions on gnome-console
1032 - corrected permissions on init scripts
1033 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1034 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1035 -
1036 - various cleanup patches from Michael K. Johnson:
1037 - corrected post install routines for nicer chkconfig
1038 - removed chmod changes in post routines and moved to install section
1039 - removed interactive nature of post routine for rescue package
1040 - added description of building rescue disks to the description of rescue package
1041 - added clean of build root to beginning of install
1042 - removed specifying attr in all file lists
1043 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1044 - added bconsole to client package
1045 - added gconsole package as add-on to client
1046 - removed spurious dependancies on updatedb package (!cut/paste)
1047 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1048 - added updatedb package
1049 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1050 - added postgresql package
1051 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1052 - corrected the if else logic in the dependancy sections
1053 - changes for 1.34 release
1054 - /etc/bacula/console is now /etc/bacula/bconsole
1055 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1056 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1057 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1058 - added new /etc/bacula/drop_mysql_database
1059 - added new /etc/bacula/drop_sqlite_database
1060 - added new /etc/bacula/grant_sqlite_privileges
1061 - added new generic bacula database scripts in /etc/bacula
1062 - added pre-install sections to check for database versions older than 6
1063 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1064 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1065 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1066 - added testing for existing databases before executing any of the database creation scripts
1067 - added defines working_dir and sqlite_bindir in place of hard coded paths
1068 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1069 - added build configuration for SuSE.
1070 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1071 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1072 - added patch for create_sqlite_database to fix the installed bindir
1073 - added execute of create_sqlite_database to post of sqlite package
1074 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1075 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1076 - added bacula-fd as Requires for rescue package
1077 - added build tag for Fedora Core 1
1078 - cleaned up dependancies for all builds
1079 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1080 - removed rh_version from package names
1081 - added platform build configuration section to beginning of file
1082 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1083 - removed make_static_bacula script from rescue package install
1084 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1085 - Added define at top of file for depkgs version
1086 - Added rescue sub-package
1087 - Moved requires statements into proper sub-package locations
1088 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1089 - Corrected Requires for Gnome 1.4/2.0 builds
1090 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1091 - Added separate source declaration for depkgs
1092 - added patch for make_catalog_backup script
1093 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1094 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1095 - Added rh_version to sub-package names
1096 - Added installed but missing file /etc/bacula/gconsole
1097 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1098 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1099 - Update spec for version 1.31 and combine client
1100 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1101 - Initial spec file