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