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