]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula.spec.in
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / platforms / redhat / bacula.spec.in
1 # Bacula RPM spec file
2 # Copyright (C) 2004 Kern Sibbald
3
4 # Platform Build Configuration
5
6 # basic defines for every build
7 %define depkgs ../depkgs
8 %define depkgs_version 29Oct04
9 %define tomsrtbt tomsrtbt-2.0.103
10 %define sqlite_bindir /usr/lib/sqlite
11 %define working_dir /var/bacula
12 %define daemon_user root
13 %define daemon_group bacula
14 %define group_file /etc/group
15 %define groupadd /usr/sbin/groupadd
16
17 # platform defines - set one below or define the build_xxx on the command line
18 # RedHat builds
19 %define rh7 0
20 %{?build_rh7:%define rh7 1}
21 %define rh8 0
22 %{?build_rh8:%define rh8 1}
23 %define rh9 0
24 %{?build_rh9:%define rh9 1}
25 # Fedora Core build
26 %define fc1 0
27 %{?build_fc1:%define fc1 1}
28 %define fc3 0
29 %{?build_fc3:%define fc3 1}
30 # Whitebox Enterprise build
31 # 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/init.d/bacula-dir
723 /etc/init.d/bacula-fd
724 /etc/init.d/bacula-sd
725
726 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
727 /usr/man/man1/*
728
729 /etc/logrotate.d/bacula
730 /etc/log.d/scripts/services/bacula
731 %config(noreplace) /etc/bacula/bacula-dir.conf
732 %config(noreplace) /etc/bacula/bacula-fd.conf
733 %config(noreplace) /etc/bacula/bacula-sd.conf
734 %config(noreplace) /etc/bacula/bconsole.conf
735 %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
736 %config(noreplace) /etc/log.d/conf/services/bacula.conf
737 /etc/bacula/query.sql
738 %dir %{working_dir}
739
740 /usr/sbin/bacula-dir
741 /usr/sbin/bacula-fd
742 /usr/sbin/bacula-sd
743 /usr/sbin/bcopy
744 /usr/sbin/bextract
745 /usr/sbin/bls
746 /usr/sbin/bscan
747 /usr/sbin/btape
748 /usr/sbin/btraceback
749 /usr/sbin/bconsole
750 /usr/sbin/dbcheck
751 /usr/sbin/loaderinfo
752 /usr/sbin/mtx
753 /usr/sbin/scsitape
754 /usr/sbin/bsmtp
755 /usr/sbin/tapeinfo
756 /usr/sbin/static-bacula-fd
757
758 %pre mysql
759 # test for bacula database older than version 7
760 # note: this ASSUMES no password has been set for bacula database
761 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
762
763 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
764         echo "This bacula upgrade will update a bacula database from version 7 to 8."
765         echo "You appear to be running database version $DB_VER. You must first update"
766         echo "your database to version 7 and then install this upgrade. The alternative"
767         echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
768         echo "catalog information, then do the upgrade. Information on updating a"
769         echo "database older than version 7 can be found in the release notes."
770         exit 1
771 fi
772 # check for and copy /etc/bacula/console.conf to bconsole.conf
773 if [ -s /etc/bacula/console.conf ];then
774         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
775 fi
776
777 %post mysql
778
779 # add our links
780 if [ "$1" -ge 1 ] ; then
781 /sbin/chkconfig --add bacula-dir
782 /sbin/chkconfig --add bacula-fd
783 /sbin/chkconfig --add bacula-sd
784 fi
785
786 # test for an existing database
787 # note: this ASSUMES no password has been set for bacula database
788 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
789
790 # grant privileges and create tables if they do not exist
791 if [ -z "$DB_VER" ]; then
792         echo "Hmm, doesn't look like you have an existing database."
793         echo "Granting privileges for MySQL user bacula..."
794         /etc/bacula/grant_mysql_privileges
795         echo "Creating MySQL bacula database..."
796         /etc/bacula/create_mysql_database
797         echo "Creating bacula tables..."
798         /etc/bacula/make_mysql_tables
799
800 # check to see if we need to upgrade a 1.34 or lower database
801 elif [ "$DB_VER" -lt "8" ]; then
802         echo "This release requires an upgrade to your bacula database."
803         echo "Backing up your current database..."
804         mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
805         echo "Upgrading bacula database ..."
806         /etc/bacula/update_mysql_tables
807         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
808
809 fi
810
811 # create the daemon group
812 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
813 if [ -z $HAVE_BACULA ]; then
814         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
815         echo "The group %{daemon_group} has been added to %{group_file}."
816         echo "See the manual chapter Running Bacula for details."
817 fi
818
819 %preun mysql
820 # delete our links
821 if [ $1 = 0 ]; then
822 /sbin/chkconfig --del bacula-dir
823 /sbin/chkconfig --del bacula-fd
824 /sbin/chkconfig --del bacula-sd
825 fi
826
827 %endif
828
829 %if %{sqlite}
830
831 %files sqlite
832 %defattr(-,root,root)
833
834 /etc/bacula/bacula
835 /etc/bacula/bconsole
836 /etc/bacula/create_bacula_database
837 /etc/bacula/drop_bacula_database
838 /etc/bacula/grant_bacula_privileges
839 /etc/bacula/make_bacula_tables
840 /etc/bacula/drop_bacula_tables
841 /etc/bacula/update_bacula_tables
842 /etc/bacula/create_sqlite_database
843 /etc/bacula/drop_sqlite_database
844 /etc/bacula/grant_sqlite_privileges
845 /etc/bacula/make_sqlite_tables
846 /etc/bacula/drop_sqlite_tables
847 /etc/bacula/update_sqlite_tables
848 /etc/bacula/make_catalog_backup
849 /etc/bacula/delete_catalog_backup
850 /etc/bacula/mtx-changer
851 /etc/bacula/btraceback.dbx
852 /etc/bacula/btraceback.gdb
853 /etc/init.d/bacula-dir
854 /etc/init.d/bacula-fd
855 /etc/init.d/bacula-sd
856
857 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
858 /usr/man/man1/*
859
860 /etc/logrotate.d/bacula
861 /etc/log.d/scripts/services/bacula
862 %config(noreplace) /etc/bacula/bacula-dir.conf
863 %config(noreplace) /etc/bacula/bacula-fd.conf
864 %config(noreplace) /etc/bacula/bacula-sd.conf
865 %config(noreplace) /etc/bacula/bconsole.conf
866 %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
867 %config(noreplace) /etc/log.d/conf/services/bacula.conf
868 /etc/bacula/query.sql
869 %{sqlite_bindir}/libsqlite.a
870 %{sqlite_bindir}/sqlite.h
871 %dir %{working_dir}
872
873 /usr/sbin/bacula-dir
874 /usr/sbin/bacula-fd
875 /usr/sbin/bacula-sd
876 /usr/sbin/bcopy
877 /usr/sbin/bextract
878 /usr/sbin/bls
879 /usr/sbin/bscan
880 /usr/sbin/btape
881 /usr/sbin/btraceback
882 /usr/sbin/bconsole
883 /usr/sbin/dbcheck
884 /usr/sbin/loaderinfo
885 /usr/sbin/mtx
886 /usr/sbin/scsitape
887 /usr/sbin/bsmtp
888 /usr/sbin/tapeinfo
889 /usr/sbin/static-bacula-fd
890 %{sqlite_bindir}/sqlite
891
892
893 %pre sqlite
894 # test for bacula database older than version 7
895 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
896         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
897         if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
898                 echo "This bacula upgrade will update a bacula database from version 7 to 8."
899                 echo "You appear to be running database version $DB_VER. You must first update"
900                 echo "your database to version 7 and then install this upgrade. The alternative"
901                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
902                 echo "catalog information, then do the upgrade. Information on updating a"
903                 echo "database older than version 7 can be found in the release notes."
904                 exit 1
905         fi
906 fi
907 # check for and copy /etc/bacula/console.conf to bconsole.conf
908 if [ -s /etc/bacula/console.conf ];then
909         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
910 fi
911
912 %post sqlite
913 # add our links
914 if [ "$1" -ge 1 ] ; then
915 /sbin/chkconfig --add bacula-dir
916 /sbin/chkconfig --add bacula-fd
917 /sbin/chkconfig --add bacula-sd
918 fi
919
920 # test for an existing database
921 if [ -s %{working_dir}/bacula.db ]; then
922         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
923         # check to see if we need to upgrade a 1.34 or lower database
924         if [ "$DB_VER" -lt "7" ]; then
925                 echo "This bacula upgrade requires a database update to version 8. You appear to"
926                 echo "be running database version $DB_VER. You must update your database using the"
927                 echo "upgrade scripts in the bacula-updatedb package. The alternative"
928                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
929                 echo "catalog information, then /etc/bacula/make_sqlite_tables. Information on updating a"
930                 echo "database older than version 7 can be found in the release notes."
931         fi      
932         
933         if [ "$DB_VER" -lt "8" ] && [ "$DB_VER" -ge "7" ]; then
934                 echo "This release requires an upgrade to your bacula database."
935                 echo "Backing up your current database..."
936                 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
937                 echo "Upgrading bacula database ..."
938                 /etc/bacula/update_sqlite_tables
939                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
940         fi
941 else
942         # create the database and tables
943         echo "Hmm, doesn't look like you have an existing database."
944         echo "Creating SQLite database..."
945         /etc/bacula/create_sqlite_database
946         echo "Creating the SQLite tables..."
947         /etc/bacula/make_sqlite_tables
948 fi
949
950 # create the daemon group
951 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
952 if [ -z $HAVE_BACULA ]; then
953         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
954         echo "The group %{daemon_group} has been added to %{group_file}."
955         echo "See the manual chapter Running Bacula for details."
956 fi
957
958 %preun sqlite
959 # delete our links
960 if [ $1 = 0 ]; then
961 /sbin/chkconfig --del bacula-dir
962 /sbin/chkconfig --del bacula-fd
963 /sbin/chkconfig --del bacula-sd
964 fi
965
966 %endif
967
968 %if %{postgresql}
969
970 %files postgresql
971 %defattr(-,root,root)
972
973 /etc/bacula/bacula
974 /etc/bacula/bconsole
975 /etc/bacula/create_postgresql_database
976 /etc/bacula/drop_postgresql_database
977 /etc/bacula/make_postgresql_tables
978 /etc/bacula/drop_postgresql_tables
979 /etc/bacula/update_postgresql_tables
980 /etc/bacula/grant_postgresql_privileges
981 /etc/bacula/create_bacula_database
982 /etc/bacula/drop_bacula_database
983 /etc/bacula/grant_bacula_privileges
984 /etc/bacula/make_bacula_tables
985 /etc/bacula/drop_bacula_tables
986 /etc/bacula/update_bacula_tables
987 /etc/bacula/make_catalog_backup
988 /etc/bacula/delete_catalog_backup
989 /etc/bacula/mtx-changer
990 /etc/bacula/btraceback.dbx
991 /etc/bacula/btraceback.gdb
992 /etc/init.d/bacula-dir
993 /etc/init.d/bacula-fd
994 /etc/init.d/bacula-sd
995
996 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
997 /usr/man/man1/*
998
999 /etc/logrotate.d/bacula
1000 /etc/log.d/scripts/services/bacula
1001 %config(noreplace) /etc/bacula/bacula-dir.conf
1002 %config(noreplace) /etc/bacula/bacula-fd.conf
1003 %config(noreplace) /etc/bacula/bacula-sd.conf
1004 %config(noreplace) /etc/bacula/bconsole.conf
1005 %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1006 %config(noreplace) /etc/log.d/conf/services/bacula.conf
1007 /etc/bacula/query.sql
1008 %dir %{working_dir}
1009
1010 /usr/sbin/bacula-dir
1011 /usr/sbin/bacula-fd
1012 /usr/sbin/bacula-sd
1013 /usr/sbin/bcopy
1014 /usr/sbin/bextract
1015 /usr/sbin/bls
1016 /usr/sbin/bscan
1017 /usr/sbin/btape
1018 /usr/sbin/btraceback
1019 /usr/sbin/bconsole
1020 /usr/sbin/dbcheck
1021 /usr/sbin/loaderinfo
1022 /usr/sbin/mtx
1023 /usr/sbin/scsitape
1024 /usr/sbin/bsmtp
1025 /usr/sbin/tapeinfo
1026 /usr/sbin/static-bacula-fd
1027
1028 %pre postgresql
1029 # test for bacula database older than version 7
1030 # note: this ASSUMES no password has been set for bacula database
1031 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1032
1033 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
1034         echo "This bacula upgrade will update a bacula database from version 7 to 8."
1035         echo "You appear to be running database version $DB_VER. You must first update"
1036         echo "your database to version 7 and then install this upgrade. The alternative"
1037         echo "is to use /etc/bacula/drop_postgresql_tables to delete all your your current"
1038         echo "catalog information, then do the upgrade. Information on updating a"
1039         echo "database older than version 7 can be found in the release notes."
1040         exit 1
1041 fi
1042
1043 %post postgresql
1044 # add our links
1045 if [ "$1" -ge 1 ] ; then
1046 /sbin/chkconfig --add bacula-dir
1047 /sbin/chkconfig --add bacula-fd
1048 /sbin/chkconfig --add bacula-sd
1049 fi
1050
1051 # test for an existing database
1052 # note: this ASSUMES no password has been set for bacula database
1053 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1054
1055 # grant privileges and create tables if they do not exist
1056 if [ -z "$DB_VER" ]; then
1057         echo "Hmm, doesn't look like you have an existing database."
1058         echo "Creating PostgreSQL bacula database..."
1059         /etc/bacula/create_postgresql_database
1060         echo "Creating bacula tables..."
1061         /etc/bacula/make_postgresql_tables
1062         echo "Granting privileges for PostgreSQL user bacula..."
1063         /etc/bacula/grant_postgresql_privileges
1064
1065 # check to see if we need to upgrade a 1.34 or lower database
1066 elif [ "$DB_VER" -lt "8" ]; then
1067         echo "This release requires an upgrade to your bacula database."
1068         echo "Backing up your current database..."
1069         pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1070         echo "Upgrading bacula database ..."
1071         /etc/bacula/update_postgresql_tables
1072         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1073         
1074 fi
1075
1076 # create the daemon group
1077 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1078 if [ -z $HAVE_BACULA ]; then
1079         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1080         echo "The group %{daemon_group} has been added to %{groupfile}."
1081         echo "See the manual chapter Running Bacula for details."
1082 fi
1083         
1084
1085 %preun postgresql
1086 # delete our links
1087 if [ $1 = 0 ]; then
1088 /sbin/chkconfig --del bacula-dir
1089 /sbin/chkconfig --del bacula-fd
1090 /sbin/chkconfig --del bacula-sd
1091 fi
1092
1093 %endif
1094
1095 %files client
1096 %defattr(-,root,root)
1097
1098 /etc/bacula/bconsole
1099 /etc/init.d/bacula-fd
1100
1101 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
1102 /etc/logrotate.d/bacula
1103
1104 %config(noreplace) /etc/bacula/bacula-fd.conf
1105 %config(noreplace) /etc/bacula/bconsole.conf
1106 %dir %{working_dir}
1107
1108 /usr/sbin/bacula-fd
1109 /usr/sbin/btraceback
1110 /etc/bacula/btraceback.gdb
1111 /etc/bacula/btraceback.dbx
1112 /usr/sbin/bsmtp
1113 /usr/sbin/bconsole
1114
1115
1116 %post client
1117 # add our link
1118 if [ "$1" -ge 1 ] ; then
1119 /sbin/chkconfig --add bacula-fd
1120 fi
1121
1122 # create the daemon group
1123 HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
1124 if [ -z $HAVE_BACULA ]; then
1125         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1126         echo "The group %{daemon_group} has been added to %{group_file}."
1127         echo "See the manual chapter Running Bacula for details."
1128 fi
1129
1130 %preun client
1131 # delete our link
1132 if [ $1 = 0 ]; then
1133 /sbin/chkconfig --del bacula-fd
1134 fi
1135
1136 %files rescue
1137 %defattr(-,root,root)
1138 /etc/bacula/rescue/floppy/*
1139 /etc/bacula/rescue/cdrom/*
1140
1141 %post rescue
1142 # link our current installed conf file to the rescue directory
1143 ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
1144 ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
1145
1146 # run getdiskinfo
1147 echo "Creating rescue files for this system..."
1148 cd /etc/bacula/rescue/floppy
1149 ./getdiskinfo
1150 cd /etc/bacula/rescue/cdrom/bacula
1151 ./getdiskinfo
1152
1153 %preun rescue
1154 # remove the files created after the initial rpm installation
1155 rm -f /etc/bacula/rescue/floppy/bacula-fd.conf
1156 rm -f /etc/bacula/rescue/floppy/partition.*
1157 rm -f /etc/bacula/rescue/floppy/format.*
1158 rm -f /etc/bacula/rescue/floppy/mount_drives
1159 rm -f /etc/bacula/rescue/floppy/start_network
1160 rm -f /etc/bacula/rescue/floppy/sfdisk
1161 rm -rf /etc/bacula/rescue/floppy/diskinfo/*
1162
1163 rm -f /etc/bacula/rescue/cdrom/bacula/bacula-fd.conf
1164 rm -f /etc/bacula/rescue/cdrom/bacula/partition.*
1165 rm -f /etc/bacula/rescue/cdrom/bacula/format.*
1166 rm -f /etc/bacula/rescue/cdrom/bacula/mount_drives
1167 rm -f /etc/bacula/rescue/cdrom/bacula/start_network
1168 rm -rf /etc/bacula/rescue/cdrom/bacula/diskinfo/*
1169
1170 %files updatedb
1171 %defattr(-,root,root)
1172 /etc/bacula/updatedb/*
1173
1174 %post updatedb
1175 echo "The database update scripts were installed to /etc/bacula/updatedb"
1176
1177 %files gconsole
1178 %defattr(-,root,root)
1179 /usr/sbin/gnome-console
1180 /etc/bacula/gconsole
1181 %config(noreplace) /etc/bacula/gnome-console.conf
1182 /usr/share/pixmaps/bacula.png
1183
1184 %if %{rh7}
1185 /usr/share/gnome/apps/System/bacula.desktop
1186 %else
1187 /usr/share/applications/bacula.desktop
1188 %endif
1189
1190 %if ! %{rh7} && ! %{rh8}
1191 /usr/sbin/bacula-tray-monitor
1192 /etc/bacula/tray-monitor.conf
1193 /usr/share/pixmaps/bacula-tray-monitor.xpm
1194 /usr/share/applications/bacula-tray-monitor.desktop
1195 %endif
1196
1197 %if ! %{su9} 
1198 # add the console helper files
1199 %config(noreplace,missingok) /etc/pam.d/gnome-console
1200 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1201 /usr/bin/gnome-console
1202 %endif
1203
1204
1205 %changelog
1206 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1207 - add logwatch script
1208 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1209 - add build for Fedora Core 3 (linc now included in ORDit2)
1210 - add mysql4 define for Mandrake 10.1
1211 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1212 - fix {group_file} variable in post scripts
1213 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1214 - add distribution checking and custom Distribution tag
1215 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1216 - ASSIGNMENT OF COPYRIGHT
1217 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
1218 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
1219 - all right, title and interest in and to the copyright in this software RPM
1220 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
1221 - free of all liens, encumbrances or any known claims against said copyright.
1222 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1223 - bug 183 fixes
1224 - thanks to Daniel Widyono
1225 - update description for rescue package to describe cdrom creation
1226 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1227 - update depkgs to 29Oct04
1228 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1229 - add cdrom rescue to bacula-rescue package
1230 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1231 - misc fixes from 1.36.0 suse feedback
1232 - fix situation where sqlite database exists but sqlite has been removed.
1233 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1234 - remove tray-monitor from RH8 build
1235 - fix permissions on tray-monitor files
1236 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1237 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1238 - change database update to 7 to 8 upgrade,
1239 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1240 - build in 30Jul04, add freetype dependancy to gnome package.
1241 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1242 - add documentation to console for groupadd
1243 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1244 - add support for running daemons as root.bacula
1245 - correct for change in location of floppy rescue files in 1.35.2
1246 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1247 - updated depgkgs to 30Jul04
1248 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1249 - really, really fix symlink creation for gconsole
1250 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1251 - fix symlink creation in gconsole post install
1252 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1253 - fixed error in gconsole post script
1254 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1255 - add check for gconsole symlink before trying to create it
1256 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1257 - fix some minor permissions issues on doc files that CVS won't let us fix
1258 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1259 - add pkgconfig to BuildRequires
1260 - clean up gnome1/2 menu entries for appropriate packages
1261 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1262 - tightened up doc distribution
1263 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1264 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1265 - rpm's horrible bug that prevents nested conditional macros prevents me
1266 - from implementing these 2 separate approaches within the conditionals which
1267 - create the separate server packages.
1268 - the solution adopted is to remove the gnome-console files from the server packages
1269 - so bacula-gconsole is now an add on for both client and server packages.
1270 - this also now allows the server packages to be install on machines without
1271 - an X-server and we can still maintain a single spec file.
1272 - added tests to make sure we have defined platform and database macros.
1273 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1274 - corrected mysql prerequisites for suse
1275 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1276 - replaced all cp commands with cp -p
1277 - removed addition of a+x permissions on gnome-console
1278 - corrected permissions on init scripts
1279 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1280 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1281 -
1282 - various cleanup patches from Michael K. Johnson:
1283 - corrected post install routines for nicer chkconfig
1284 - removed chmod changes in post routines and moved to install section
1285 - removed interactive nature of post routine for rescue package
1286 - added description of building rescue disks to the description of rescue package
1287 - added clean of build root to beginning of install
1288 - removed specifying attr in all file lists
1289 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1290 - added bconsole to client package
1291 - added gconsole package as add-on to client
1292 - removed spurious dependancies on updatedb package (!cut/paste)
1293 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1294 - added updatedb package
1295 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1296 - added postgresql package
1297 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1298 - corrected the if else logic in the dependancy sections
1299 - changes for 1.34 release
1300 - /etc/bacula/console is now /etc/bacula/bconsole
1301 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1302 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1303 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1304 - added new /etc/bacula/drop_mysql_database
1305 - added new /etc/bacula/drop_sqlite_database
1306 - added new /etc/bacula/grant_sqlite_privileges
1307 - added new generic bacula database scripts in /etc/bacula
1308 - added pre-install sections to check for database versions older than 6
1309 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1310 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1311 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1312 - added testing for existing databases before executing any of the database creation scripts
1313 - added defines working_dir and sqlite_bindir in place of hard coded paths
1314 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1315 - added build configuration for SuSE.
1316 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1317 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1318 - added patch for create_sqlite_database to fix the installed bindir
1319 - added execute of create_sqlite_database to post of sqlite package
1320 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1321 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1322 - added bacula-fd as Requires for rescue package
1323 - added build tag for Fedora Core 1
1324 - cleaned up dependancies for all builds
1325 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1326 - removed rh_version from package names
1327 - added platform build configuration section to beginning of file
1328 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1329 - removed make_static_bacula script from rescue package install
1330 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1331 - Added define at top of file for depkgs version
1332 - Added rescue sub-package
1333 - Moved requires statements into proper sub-package locations
1334 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1335 - Corrected Requires for Gnome 1.4/2.0 builds
1336 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1337 - Added separate source declaration for depkgs
1338 - added patch for make_catalog_backup script
1339 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1340 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1341 - Added rh_version to sub-package names
1342 - Added installed but missing file /etc/bacula/gconsole
1343 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1344 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1345 - Update spec for version 1.31 and combine client
1346 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1347 - Initial spec file