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