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