]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula.spec.in
Really, really fix the gconsole rpm package symlink.
[bacula/bacula] / bacula / platforms / redhat / bacula.spec.in
1 # Platform Build Configuration
2
3 # basic defines for every build
4 %define depkgs ../depkgs
5 %define depkgs_version 08Mar04
6 %define tomsrtbt tomsrtbt-2.0.103
7 %define sqlite_bindir /usr/lib/sqlite
8 %define working_dir /var/bacula
9
10 # platform defines - set one below or define the build_xxx on the command line
11 # RedHat builds
12 %define rh7 0
13 %{?build_rh7:%define rh7 1}
14 %define rh8 0
15 %{?build_rh8:%define rh8 1}
16 %define rh9 0
17 %{?build_rh9:%define rh9 1}
18 # Fedora Core 1 build
19 %define fc1 0
20 %{?build_fc1:%define fc1 1}
21 # Whitebox Enterprise build
22 # this should also work for RHEL
23 %define wb3 0
24 %{?build_wb3:%define wb3 1}
25 # SuSE build
26 # this is known to build on SuSE 8.2 and 9.0
27 %define su9 0
28 %{?build_su9:%define su9 1}
29
30 # test for a platform definition
31 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9}
32 %{error: You must specify a platform. Please examine the spec file.}
33 exit 1
34 %endif
35
36 # database defines
37 # set for database support desired or define the build_xxx on the command line
38 %define mysql 0
39 %{?build_mysql:%define mysql 1}
40 %define sqlite 0
41 %{?build_sqlite:%define sqlite 1}
42 %define postgresql 0
43 %{?build_postgresql:%define postgresql 1}
44
45 # test for a database definition
46 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
47 %{error: You must specify database support. Please examine the spec file.}
48 exit 1
49 %endif
50
51 Summary: Bacula - The Network Backup Solution
52 Name: bacula
53 Version: @VERSION@
54 Release: 1
55 Group: System Environment/Daemons
56 Copyright: GPL v2
57 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
58 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
59 Source2:http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/%{tomsrtbt}.tar.gz
60 Source3: Release_Notes-%{version}-%{release}.tar.gz
61 BuildRoot: %{_tmppath}/%{name}-root
62 URL: http://www.bacula.org/
63 Vendor: The Bacula Team
64 Distribution: The Bacula Team
65 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
66 BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
67 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
68 %if %{rh7}
69 BuildRequires: libtermcap-devel
70 BuildRequires: gtk+-devel >= 1.2
71 BuildRequires: gnome-libs-devel >= 1.4
72 BuildRequires: glibc-devel >= 2.2
73 BuildRequires: ORBit-devel
74 BuildRequires: bonobo-devel
75 BuildRequires: GConf-devel
76 %endif
77 %if %{su9}
78 BuildRequires: termcap
79 BuildRequires: gtk2-devel >= 2.0
80 BuildRequires: libgnomeui-devel >= 2.0
81 BuildRequires: glibc-devel >= 2.3
82 BuildRequires: ORBit2-devel
83 BuildRequires: libart_lgpl-devel >= 2.0
84 BuildRequires: libbonobo-devel >= 2.0
85 BuildRequires: libbonoboui-devel >= 2.0
86 BuildRequires: bonobo-activation-devel
87 BuildRequires: gconf2-devel
88 BuildRequires: linc-devel
89 %endif
90 %if ! %{rh7} && ! %{su9}
91 BuildRequires: libtermcap-devel
92 BuildRequires: gtk2-devel >= 2.0
93 BuildRequires: libgnomeui-devel >= 2.0
94 BuildRequires: glibc-devel >= 2.3
95 BuildRequires: ORBit2-devel
96 BuildRequires: libart_lgpl-devel >= 2.0
97 BuildRequires: libbonobo-devel >= 2.0
98 BuildRequires: libbonoboui-devel >= 2.0
99 BuildRequires: bonobo-activation-devel
100 BuildRequires: GConf2-devel
101 BuildRequires: linc-devel
102 %endif
103
104 %if %{mysql}
105 BuildRequires: mysql-devel >= 3.23
106 %endif
107
108 %if %{postgresql} && %{wb3}
109 BuildRequires: rh-postgresql-devel >= 7
110 %endif
111
112 %if %{postgresql} && ! %{wb3}
113 BuildRequires: postgresql-devel >= 7
114 %endif
115
116 %description
117 Bacula - It comes by night and sucks the vital essence from your computers.
118
119 Bacula is a set of computer programs that permit you (or the system 
120 administrator) to manage backup, recovery, and verification of computer 
121 data across a network of computers of different kinds. In technical terms, 
122 it is a network client/server based backup program. Bacula is relatively 
123 easy to use and efficient, while offering many advanced storage management 
124 features that make it easy to find and recover lost or damaged files. 
125 Bacula source code has been released under the GPL version 2 license.
126
127 %if %{mysql}
128 %package mysql
129 %endif
130 %if %{sqlite}
131 %package sqlite
132 %endif
133 %if %{postgresql}
134 %package postgresql
135 %endif
136
137 Summary: Bacula - The Network Backup Solution
138 Group: System Environment/Daemons
139 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
140 Conflicts: bacula-client
141 Requires: readline, ncurses, libstdc++, zlib
142 %if %{rh7}
143 Requires: glibc >= 2.2
144 Requires: libtermcap
145 %endif
146 %if %{su9}
147 Requires: glibc >= 2.3
148 Requires: termcap
149 %endif
150 %if ! %{rh7} && ! %{su9}
151 Requires: glibc >= 2.3
152 Requires: libtermcap
153 %endif
154 %if %{mysql} && ! %{su9}
155 Requires: mysql >= 3.23
156 Requires: mysql-server >= 3.23
157 %endif
158 %if %{mysql} && %{su9}
159 Requires: mysql >= 3.23
160 Requires: mysql-client >= 3.23
161 %endif
162 %if %{postgresql} && %{wb3}
163 Requires: rh-postgresql >= 7
164 Requires: rh-postgresql-server >= 7
165 %endif
166 %if %{postgresql} && ! %{wb3}
167 Requires: postgresql >= 7
168 Requires: postgresql-server >= 7
169 %endif
170
171 %if %{mysql}
172 %description mysql
173 %endif
174 %if %{sqlite}
175 %description sqlite
176 %endif
177 %if %{postgresql}
178 %description postgresql
179 %endif
180
181 Bacula - It comes by night and sucks the vital essence from your computers.
182
183 Bacula is a set of computer programs that permit you (or the system 
184 administrator) to manage backup, recovery, and verification of computer 
185 data across a network of computers of different kinds. In technical terms, 
186 it is a network client/server based backup program. Bacula is relatively 
187 easy to use and efficient, while offering many advanced storage management 
188 features that make it easy to find and recover lost or damaged files. 
189 Bacula source code has been released under the GPL version 2 license.
190
191 %if %{mysql}
192 This build requires MySQL to be installed separately as the catalog database.
193 %endif
194 %if %{postgresql}
195 This build requires PostgreSQL to be installed separately as the catalog database.
196 %endif
197 %if %{sqlite}
198 This build incorporates sqlite as the catalog database, statically compiled.
199 %endif
200
201 %package client
202 Summary: Bacula - The Network Backup Solution
203 Group: System Environment/Daemons
204 Provides: bacula-fd
205 Requires: readline, libstdc++, zlib
206
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
220 %description client
221 Bacula - It comes by night and sucks the vital essence from your computers.
222
223 Bacula is a set of computer programs that permit you (or the system 
224 administrator) to manage backup, recovery, and verification of computer 
225 data across a network of computers of different kinds. In technical terms, 
226 it is a network client/server based backup program. Bacula is relatively 
227 easy to use and efficient, while offering many advanced storage management 
228 features that make it easy to find and recover lost or damaged files. 
229 Bacula source code has been released under the GPL version 2 license.
230
231 This is the File daemon (Client) only package. It includes the command line 
232 console program.
233
234 %package rescue
235
236 Summary: Bacula - The Network Backup Solution
237 Group: System Environment/Daemons
238 Requires: coreutils, util-linux, libc5, bacula-fd
239
240 %description rescue
241 Bacula - It comes by night and sucks the vital essence from your computers.
242
243 Bacula is a set of computer programs that permit you (or the system 
244 administrator) to manage backup, recovery, and verification of computer 
245 data across a network of computers of different kinds. In technical terms, 
246 it is a network client/server based backup program. Bacula is relatively 
247 easy to use and efficient, while offering many advanced storage management 
248 features that make it easy to find and recover lost or damaged files. 
249 Bacula source code has been released under the GPL version 2 license.
250
251 This package installs scripts for disaster recovery and builds rescue 
252 floppy disks for bare metal recovery. This package includes tomsrtbt
253 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
254 to build a boot floppy disk.
255
256 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or 
257 bacula-client package for your platform installed and configured before 
258 installing this package.
259
260 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
261 directory (this is done when the package is first installed), 
262 then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
263 directory. To make the bacula rescue disk run
264 "./make_rescue_disk --copy-static-bacula --copy-etc-files"
265 from the /etc/bacula/rescue directory. To recreate the rescue
266 information for this system run ./getdiskinfo again.
267
268 %package updatedb
269
270 Summary: Bacula - The Network Backup Solution
271 Group: System Environment/Daemons
272
273 %description updatedb
274 Bacula - It comes by night and sucks the vital essence from your computers.
275
276 Bacula is a set of computer programs that permit you (or the system 
277 administrator) to manage backup, recovery, and verification of computer 
278 data across a network of computers of different kinds. In technical terms, 
279 it is a network client/server based backup program. Bacula is relatively 
280 easy to use and efficient, while offering many advanced storage management 
281 features that make it easy to find and recover lost or damaged files. 
282 Bacula source code has been released under the GPL version 2 license.
283
284 This package installs scripts for updating older versions of the bacula
285 database.
286
287 %package gconsole
288 Summary: Bacula - The Network Backup Solution
289 Group: System Environment/Daemons
290 Requires: readline, atk, libstdc++, zlib, pango, libxml2, bacula-fd
291
292 %if %{rh7}
293 Requires: gtk+ >= 1.2
294 Requires: gnome-libs >= 1.4
295 Requires: glibc >= 2.2
296 Requires: ORBit
297 Requires: bonobo
298 Requires: GConf
299 %endif
300 %if %{su9}
301 Requires: gtk2 >= 2.0
302 Requires: libgnomeui >= 2.0
303 Requires: glibc >= 2.3
304 Requires: ORBit2
305 Requires: libart_lgpl >= 2.0
306 Requires: libbonobo >= 2.0
307 Requires: libbonoboui >= 2.0
308 Requires: bonobo-activation
309 Requires: gconf2
310 Requires: linc
311 %endif
312 %if ! %{rh7} && ! %{su9}
313 Requires: gtk2 >= 2.0
314 Requires: libgnomeui >= 2.0
315 Requires: glibc >= 2.3
316 Requires: ORBit2
317 Requires: libart_lgpl >= 2.0
318 Requires: libbonobo >= 2.0
319 Requires: libbonoboui >= 2.0
320 Requires: bonobo-activation
321 Requires: GConf2
322 Requires: linc
323 %endif
324 %if %{su9}
325 Requires: xsu
326 %else
327 Requires: usermode
328 %endif
329
330 %description gconsole
331 Bacula - It comes by night and sucks the vital essence from your computers.
332
333 Bacula is a set of computer programs that permit you (or the system 
334 administrator) to manage backup, recovery, and verification of computer 
335 data across a network of computers of different kinds. In technical terms, 
336 it is a network client/server based backup program. Bacula is relatively 
337 easy to use and efficient, while offering many advanced storage management 
338 features that make it easy to find and recover lost or damaged files. 
339 Bacula source code has been released under the GPL version 2 license.
340
341 This is the Gnome Console package. It is an add-on to the client or
342 server packages.
343
344 %prep
345
346 %setup -b 1
347 %setup -b 2
348 %setup -b 3
349
350 %build
351
352 %if %{su9}
353 export LDFLAGS="-L/usr/lib/termcap"
354 %endif
355
356 cwd=${PWD}
357 cd %{depkgs}
358 %if %{sqlite}
359 make sqlite
360 %endif
361 make mtx
362 cd ${cwd}
363
364 # patches for the bundled sqlite scripts
365
366 # patch the make_sqlite_tables script for installation bindir
367 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
368
369 # patch the create_sqlite_database script for installation bindir
370 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
371
372 # patch the make_catalog_backup script for installation bindir
373 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
374
375 # patch the update_sqlite_tables script for installation bindir
376 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
377
378 %configure \
379         --prefix=/usr \
380         --sbindir=/usr/sbin \
381         --sysconfdir=/etc/bacula \
382         --with-scriptdir=/etc/bacula \
383         --enable-smartalloc \
384         --enable-gnome \
385         --enable-static-fd \
386 %if %{mysql}
387         --with-mysql \
388 %endif
389 %if %{sqlite}
390         --with-sqlite=${cwd}/../depkgs/sqlite \
391 %endif
392 %if %{postgresql}
393         --with-postgresql \
394 %endif
395         --with-working-dir=%{working_dir} \
396         --with-pid-dir=/var/run \
397         --with-subsys-dir=/var/lock/subsys
398 make
399
400 cd src/filed
401 strip static-bacula-fd
402 cd ../../
403
404 %install
405  
406 cwd=${PWD}
407 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
408 mkdir -p $RPM_BUILD_ROOT/etc/init.d
409 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
410 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
411 %if %{rh7}
412 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
413 %else
414 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
415 %endif
416 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue
417 mkdir -p $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt
418 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
419 %if ! %{su9}
420 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
421 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
422 mkdir -p $RPM_BUILD_ROOT/usr/bin
423 %endif
424
425 %if %{sqlite}
426 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
427 %endif
428
429 make \
430         prefix=$RPM_BUILD_ROOT/usr \
431         sbindir=$RPM_BUILD_ROOT/usr/sbin \
432         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
433         scriptdir=$RPM_BUILD_ROOT/etc/bacula \
434         working_dir=$RPM_BUILD_ROOT%{working_dir} \
435         install
436
437 cd %{depkgs}
438 make \
439         prefix=$RPM_BUILD_ROOT/usr \
440         sbindir=$RPM_BUILD_ROOT/usr/sbin \
441         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
442         working_dir=$RPM_BUILD_ROOT%{working_dir} \
443         mandir=$RPM_BUILD_ROOT/usr/man \
444         mtx-install
445 cd ${cwd}
446
447 # setup the manual for the doc dir and correct some broken CVS permissions
448 mkdir html-manual
449 cp -p doc/html-manual/*.html html-manual/
450 cp -p doc/html-manual/*.jpg html-manual/
451 cp -p doc/html-manual/*.gif html-manual/
452 cp -p doc/html-manual/*.css html-manual/
453 chmod 644 html-manual/*
454 chmod 644 doc/bacula.pdf
455
456 # fixme - make installs the mysql scripts for sqlite build
457 %if %{sqlite}
458 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
459 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
460 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
461 %endif
462
463 # fixme - make installs the mysql scripts for postgresql build
464 %if %{postgresql}
465 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
466 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
467 %endif
468
469 # install the init scripts
470 %if %{su9}
471 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
472 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
473 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
474 %else
475 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
476 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
477 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
478 %endif
479 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
480
481 # install the menu stuff
482 %if %{su9}
483 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
484 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
485 %endif
486 %if %{rh7}
487 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
488 cp -p scripts/bacula.desktop.gnome1.consolehelper $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
489 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
490 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
491 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
492 %endif
493 %if %{rh8} || %{rh9} || %{wb3} || %{fc1}
494 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
495 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
496 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
497 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
498 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
499 %endif
500
501 # install sqlite
502 %if %{sqlite}
503 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
504 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
505 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
506 %endif
507
508 # install the logrotate file
509 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
510
511 # install the rescue stuff
512 # these are the rescue scripts
513 cp -p rescue/linux/backup.etc.list $RPM_BUILD_ROOT/etc/bacula/rescue/
514 cp -p rescue/linux/format_floppy $RPM_BUILD_ROOT/etc/bacula/rescue/
515 cp -p rescue/linux/getdiskinfo $RPM_BUILD_ROOT/etc/bacula/rescue/
516 cp -p rescue/linux/make_rescue_disk $RPM_BUILD_ROOT/etc/bacula/rescue/
517 cp -p rescue/linux/restore_bacula $RPM_BUILD_ROOT/etc/bacula/rescue/
518 cp -p rescue/linux/restore_etc $RPM_BUILD_ROOT/etc/bacula/rescue/
519 cp -p rescue/linux/run_grub $RPM_BUILD_ROOT/etc/bacula/rescue/
520 cp -p rescue/linux/run_lilo $RPM_BUILD_ROOT/etc/bacula/rescue/
521 cp -p rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT/etc/bacula/rescue/
522
523 # this is the static file daemon
524 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/bacula-fd
525
526 # this is the tom's root boot disk
527 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT/etc/bacula/rescue/tomsrtbt/
528
529 # install the updatedb scripts
530 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
531
532 # now clean up permissions that are left broken by the install
533 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
534 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
535
536 %clean
537 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
538
539 %if %{mysql}
540
541 %files mysql
542 %defattr(-,root,root)
543
544 /etc/bacula/bacula
545 /etc/bacula/bconsole
546 /etc/bacula/fd
547 /etc/bacula/create_mysql_database
548 /etc/bacula/drop_mysql_database
549 /etc/bacula/make_mysql_tables
550 /etc/bacula/drop_mysql_tables
551 /etc/bacula/update_mysql_tables
552 /etc/bacula/grant_mysql_privileges
553 /etc/bacula/create_bacula_database
554 /etc/bacula/drop_bacula_database
555 /etc/bacula/grant_bacula_privileges
556 /etc/bacula/make_bacula_tables
557 /etc/bacula/drop_bacula_tables
558 /etc/bacula/update_bacula_tables
559 /etc/bacula/make_catalog_backup
560 /etc/bacula/delete_catalog_backup
561 /etc/bacula/startmysql
562 /etc/bacula/stopmysql
563 /etc/bacula/mtx-changer
564 /etc/init.d/bacula-dir
565 /etc/init.d/bacula-fd
566 /etc/init.d/bacula-sd
567
568 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
569 /usr/man/man1/*
570
571 /etc/logrotate.d/bacula
572
573 %config(noreplace) /etc/bacula/bacula-dir.conf
574 %config(noreplace) /etc/bacula/bacula-fd.conf
575 %config(noreplace) /etc/bacula/bacula-sd.conf
576 %config(noreplace) /etc/bacula/bconsole.conf
577 /etc/bacula/query.sql
578 %dir %{working_dir}
579
580 /usr/sbin/bacula-dir
581 /usr/sbin/bacula-fd
582 /usr/sbin/bacula-sd
583 /usr/sbin/bcopy
584 /usr/sbin/bextract
585 /usr/sbin/bls
586 /usr/sbin/bscan
587 /usr/sbin/btape
588 /usr/sbin/btraceback
589 /usr/sbin/bconsole
590 /usr/sbin/dbcheck
591 /usr/sbin/loaderinfo
592 /usr/sbin/mtx
593 /usr/sbin/scsitape
594 /usr/sbin/bsmtp
595 /usr/sbin/tapeinfo
596 /usr/sbin/static-bacula-fd
597 /etc/bacula/btraceback.gdb
598
599 %pre mysql
600 # test for bacula database older than version 6
601 # note: this ASSUMES no password has been set for bacula database
602 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
603
604 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
605         echo "This bacula upgrade will update a bacula database from version 6 to 7."
606         echo "You appear to be running database version $DB_VER. You must first update"
607         echo "your database to version 6 and then install this upgrade. The alternative"
608         echo "is to use /etc/bacula/drop_mysql_tables to delete all your your current"
609         echo "catalog information, then do the upgrade. Information on updating a"
610         echo "database older than version 6 can be found in the release notes."
611         exit 1
612 fi
613 # check for and copy /etc/bacula/console.conf to bconsole.conf
614 if [ -s /etc/bacula/console.conf ];then
615         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
616 fi
617
618 %post mysql
619
620 # add our links
621 if [ "$1" -ge 1 ] ; then
622 /sbin/chkconfig --add bacula-dir
623 /sbin/chkconfig --add bacula-fd
624 /sbin/chkconfig --add bacula-sd
625 fi
626
627 # test for an existing database
628 # note: this ASSUMES no password has been set for bacula database
629 DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
630
631 # grant privileges and create tables if they do not exist
632 if [ -z "$DB_VER" ]; then
633         echo "Hmm, doesn't look like you have an existing database."
634         echo "Granting privileges for MySQL user bacula..."
635         /etc/bacula/grant_mysql_privileges
636         echo "Creating MySQL bacula database..."
637         /etc/bacula/create_mysql_database
638         echo "Creating bacula tables..."
639         /etc/bacula/make_mysql_tables
640
641 # check to see if we need to upgrade a 1.32 or lower database
642 elif [ "$DB_VER" -lt "7" ]; then
643         echo "This release requires an upgrade to your bacula database."
644         echo "Backing up your current database..."
645         mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
646         echo "Upgrading bacula database ..."
647         /etc/bacula/update_mysql_tables
648         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
649
650 fi
651
652 %preun mysql
653 # delete our links
654 if [ $1 = 0 ]; then
655 /sbin/chkconfig --del bacula-dir
656 /sbin/chkconfig --del bacula-fd
657 /sbin/chkconfig --del bacula-sd
658 fi
659
660 %endif
661
662 %if %{sqlite}
663
664 %files sqlite
665 %defattr(-,root,root)
666
667 /etc/bacula/bacula
668 /etc/bacula/bconsole
669 /etc/bacula/fd
670 /etc/bacula/create_bacula_database
671 /etc/bacula/drop_bacula_database
672 /etc/bacula/grant_bacula_privileges
673 /etc/bacula/make_bacula_tables
674 /etc/bacula/drop_bacula_tables
675 /etc/bacula/update_bacula_tables
676 /etc/bacula/create_sqlite_database
677 /etc/bacula/drop_sqlite_database
678 /etc/bacula/grant_sqlite_privileges
679 /etc/bacula/make_sqlite_tables
680 /etc/bacula/drop_sqlite_tables
681 /etc/bacula/update_sqlite_tables
682 /etc/bacula/make_catalog_backup
683 /etc/bacula/delete_catalog_backup
684 /etc/bacula/mtx-changer
685 /etc/init.d/bacula-dir
686 /etc/init.d/bacula-fd
687 /etc/init.d/bacula-sd
688
689 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
690 /usr/man/man1/*
691
692 /etc/logrotate.d/bacula
693
694 %config(noreplace) /etc/bacula/bacula-dir.conf
695 %config(noreplace) /etc/bacula/bacula-fd.conf
696 %config(noreplace) /etc/bacula/bacula-sd.conf
697 %config(noreplace) /etc/bacula/bconsole.conf
698 /etc/bacula/query.sql
699 %{sqlite_bindir}/libsqlite.a
700 %{sqlite_bindir}/sqlite.h
701 %dir %{working_dir}
702
703 /usr/sbin/bacula-dir
704 /usr/sbin/bacula-fd
705 /usr/sbin/bacula-sd
706 /usr/sbin/bcopy
707 /usr/sbin/bextract
708 /usr/sbin/bls
709 /usr/sbin/bscan
710 /usr/sbin/btape
711 /usr/sbin/btraceback
712 /usr/sbin/bconsole
713 /usr/sbin/dbcheck
714 /usr/sbin/loaderinfo
715 /usr/sbin/mtx
716 /usr/sbin/scsitape
717 /usr/sbin/bsmtp
718 /usr/sbin/tapeinfo
719 /usr/sbin/static-bacula-fd
720 %{sqlite_bindir}/sqlite
721 /etc/bacula/btraceback.gdb
722
723 %pre sqlite
724 # test for bacula database older than version 6
725 if [ -s %{working_dir}/bacula.db ];then
726         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
727         if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
728                 echo "This bacula upgrade will update a bacula database from version 6 to 7."
729                 echo "You appear to be running database version $DB_VER. You must first update"
730                 echo "your database to version 6 and then install this upgrade. The alternative"
731                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
732                 echo "catalog information, then do the upgrade. Information on updating a"
733                 echo "database older than version 6 can be found in the release notes."
734                 exit 1
735         fi
736 fi
737 # check for and copy /etc/bacula/console.conf to bconsole.conf
738 if [ -s /etc/bacula/console.conf ];then
739         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
740 fi
741
742 %post sqlite
743 # add our links
744 if [ "$1" -ge 1 ] ; then
745 /sbin/chkconfig --add bacula-dir
746 /sbin/chkconfig --add bacula-fd
747 /sbin/chkconfig --add bacula-sd
748 fi
749
750 # test for an existing database
751 if [ -s %{working_dir}/bacula.db ]; then
752         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
753         # check to see if we need to upgrade a 1.32 or lower database
754         if [ "$DB_VER" -lt "7" ]; then
755                 echo "This release requires an upgrade to your bacula database."
756                 echo "Backing up your current database..."
757                 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
758                 echo "Upgrading bacula database ..."
759                 /etc/bacula/update_sqlite_tables
760                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
761         fi
762 else
763         # create the database and tables
764         echo "Hmm, doesn't look like you have an existing database."
765         echo "Creating SQLite database..."
766         /etc/bacula/create_sqlite_database
767         echo "Creating the SQLite tables..."
768         /etc/bacula/make_sqlite_tables
769 fi
770
771 %preun sqlite
772 # delete our links
773 if [ $1 = 0 ]; then
774 /sbin/chkconfig --del bacula-dir
775 /sbin/chkconfig --del bacula-fd
776 /sbin/chkconfig --del bacula-sd
777 fi
778
779 %endif
780
781 %if %{postgresql}
782
783 %files postgresql
784 %defattr(-,root,root)
785
786 /etc/bacula/bacula
787 /etc/bacula/bconsole
788 /etc/bacula/fd
789 /etc/bacula/create_postgresql_database
790 /etc/bacula/drop_postgresql_database
791 /etc/bacula/make_postgresql_tables
792 /etc/bacula/drop_postgresql_tables
793 /etc/bacula/update_postgresql_tables
794 /etc/bacula/grant_postgresql_privileges
795 /etc/bacula/create_bacula_database
796 /etc/bacula/drop_bacula_database
797 /etc/bacula/grant_bacula_privileges
798 /etc/bacula/make_bacula_tables
799 /etc/bacula/drop_bacula_tables
800 /etc/bacula/update_bacula_tables
801 /etc/bacula/make_catalog_backup
802 /etc/bacula/delete_catalog_backup
803 /etc/bacula/mtx-changer
804 /etc/init.d/bacula-dir
805 /etc/init.d/bacula-fd
806 /etc/init.d/bacula-sd
807
808 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
809 /usr/man/man1/*
810
811 /etc/logrotate.d/bacula
812
813 %config(noreplace) /etc/bacula/bacula-dir.conf
814 %config(noreplace) /etc/bacula/bacula-fd.conf
815 %config(noreplace) /etc/bacula/bacula-sd.conf
816 %config(noreplace) /etc/bacula/bconsole.conf
817 /etc/bacula/query.sql
818 %dir %{working_dir}
819
820 /usr/sbin/bacula-dir
821 /usr/sbin/bacula-fd
822 /usr/sbin/bacula-sd
823 /usr/sbin/bcopy
824 /usr/sbin/bextract
825 /usr/sbin/bls
826 /usr/sbin/bscan
827 /usr/sbin/btape
828 /usr/sbin/btraceback
829 /usr/sbin/bconsole
830 /usr/sbin/dbcheck
831 /usr/sbin/loaderinfo
832 /usr/sbin/mtx
833 /usr/sbin/scsitape
834 /usr/sbin/bsmtp
835 /usr/sbin/tapeinfo
836 /usr/sbin/static-bacula-fd
837 /etc/bacula/btraceback.gdb
838
839 %post postgresql
840 # add our links
841 if [ "$1" -ge 1 ] ; then
842 /sbin/chkconfig --add bacula-dir
843 /sbin/chkconfig --add bacula-fd
844 /sbin/chkconfig --add bacula-sd
845 fi
846
847 # test for an existing database
848 # note: this ASSUMES no password has been set for bacula database
849 DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
850
851 # grant privileges and create tables if they do not exist
852 if [ -z "$DB_VER" ]; then
853         echo "Hmm, doesn't look like you have an existing database."
854         echo "Granting privileges for PostgreSQL user bacula..."
855         /etc/bacula/grant_postgresql_privileges
856         echo "Creating PostgreSQL bacula database..."
857         /etc/bacula/create_postgresql_database
858         echo "Creating bacula tables..."
859         /etc/bacula/make_postgresql_tables
860         
861
862 %preun postgresql
863 # delete our links
864 if [ $1 = 0 ]; then
865 /sbin/chkconfig --del bacula-dir
866 /sbin/chkconfig --del bacula-fd
867 /sbin/chkconfig --del bacula-sd
868 fi
869
870 %endif
871
872 %files client
873 %defattr(-,root,root)
874
875 /etc/bacula/fd
876 /etc/bacula/bconsole
877 /etc/init.d/bacula-fd
878
879 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
880 /etc/logrotate.d/bacula
881
882 %config(noreplace) /etc/bacula/bacula-fd.conf
883 %config(noreplace) /etc/bacula/bconsole.conf
884 %dir %{working_dir}
885
886 /usr/sbin/bacula-fd
887 /usr/sbin/btraceback
888 /etc/bacula/btraceback.gdb
889 /usr/sbin/bsmtp
890 /usr/sbin/bconsole
891
892
893 %post client
894 # add our link
895 if [ "$1" -ge 1 ] ; then
896 /sbin/chkconfig --add bacula-fd
897 fi
898
899 %preun client
900 # delete our link
901 if [ $1 = 0 ]; then
902 /sbin/chkconfig --del bacula-fd
903 fi
904
905 %files rescue
906 %defattr(-,root,root)
907 /etc/bacula/rescue/backup.etc.list
908 /etc/bacula/rescue/format_floppy
909 /etc/bacula/rescue/getdiskinfo
910 /etc/bacula/rescue/make_rescue_disk
911 /etc/bacula/rescue/restore_bacula
912 /etc/bacula/rescue/restore_etc
913 /etc/bacula/rescue/run_grub
914 /etc/bacula/rescue/run_lilo
915 /etc/bacula/rescue/sfdisk.bz2
916 /etc/bacula/rescue/bacula-fd
917 /etc/bacula/rescue/tomsrtbt/*
918
919 %post rescue
920 # link our current installed conf file to the rescue directory
921 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
922
923 # run getdiskinfo
924 echo "Creating rescue files for this system..."
925 cd /etc/bacula/rescue
926 ./getdiskinfo
927
928 %preun rescue
929 # remove the files created after the initial rpm installation
930 rm -f /etc/bacula/rescue/bacula-fd.conf
931 rm -f /etc/bacula/rescue/partition.*
932 rm -f /etc/bacula/rescue/format.*
933 rm -f /etc/bacula/rescue/mount_drives
934 rm -f /etc/bacula/rescue/start_network
935 rm -f /etc/bacula/rescue/sfdisk
936 rm -rf /etc/bacula/rescue/diskinfo/*
937
938 %files updatedb
939 %defattr(-,root,root)
940 /etc/bacula/updatedb/*
941
942 %post updatedb
943 echo "The database update scripts were installed to /etc/bacula/updatedb"
944
945 %files gconsole
946 %defattr(-,root,root)
947 /usr/sbin/gnome-console
948 /etc/bacula/gconsole
949 %config(noreplace) /etc/bacula/gnome-console.conf
950 /usr/share/pixmaps/bacula.png
951 %if %{rh7}
952 /usr/share/gnome/apps/System/bacula.desktop
953 %else
954 /usr/share/applications/bacula.desktop
955 %endif
956
957 %if ! %{su9} 
958 # add the console helper files
959 %config(noreplace,missingok) /etc/pam.d/gnome-console
960 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
961 /usr/bin/gnome-console
962 %endif
963
964 %changelog
965 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
966 - really, really fix symlink creation for gconsole
967 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
968 - fix symlink creation in gconsole post install
969 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
970 - fixed error in gconsole post script
971 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
972 - add check for gconsole symlink before trying to create it
973 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
974 - fix some minor permissions issues on doc files that CVS won't let us fix
975 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
976 - add pkgconfig to BuildRequires
977 - clean up gnome1/2 menu entries for appropriate packages
978 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
979 - tightened up doc distribution
980 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
981 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
982 - rpm's horrible bug that prevents nested conditional macros prevents me
983 - from implementing these 2 separate approaches within the conditionals which
984 - create the separate server packages.
985 - the solution adopted is to remove the gnome-console files from the server packages
986 - so bacula-gconsole is now an add on for both client and server packages.
987 - this also now allows the server packages to be install on machines without
988 - an X-server and we can still maintain a single spec file.
989 - added tests to make sure we have defined platform and database macros.
990 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
991 - corrected mysql prerequisites for suse
992 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
993 - replaced all cp commands with cp -p
994 - removed addition of a+x permissions on gnome-console
995 - corrected permissions on init scripts
996 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
997 - corrected creation of sqlite_bindir in install from !mysql to sqlite
998 -
999 - various cleanup patches from Michael K. Johnson:
1000 - corrected post install routines for nicer chkconfig
1001 - removed chmod changes in post routines and moved to install section
1002 - removed interactive nature of post routine for rescue package
1003 - added description of building rescue disks to the description of rescue package
1004 - added clean of build root to beginning of install
1005 - removed specifying attr in all file lists
1006 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1007 - added bconsole to client package
1008 - added gconsole package as add-on to client
1009 - removed spurious dependancies on updatedb package (!cut/paste)
1010 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1011 - added updatedb package
1012 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1013 - added postgresql package
1014 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1015 - corrected the if else logic in the dependancy sections
1016 - changes for 1.34 release
1017 - /etc/bacula/console is now /etc/bacula/bconsole
1018 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1019 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1020 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1021 - added new /etc/bacula/drop_mysql_database
1022 - added new /etc/bacula/drop_sqlite_database
1023 - added new /etc/bacula/grant_sqlite_privileges
1024 - added new generic bacula database scripts in /etc/bacula
1025 - added pre-install sections to check for database versions older than 6
1026 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1027 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1028 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1029 - added testing for existing databases before executing any of the database creation scripts
1030 - added defines working_dir and sqlite_bindir in place of hard coded paths
1031 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1032 - added build configuration for SuSE.
1033 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1034 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1035 - added patch for create_sqlite_database to fix the installed bindir
1036 - added execute of create_sqlite_database to post of sqlite package
1037 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1038 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1039 - added bacula-fd as Requires for rescue package
1040 - added build tag for Fedora Core 1
1041 - cleaned up dependancies for all builds
1042 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1043 - removed rh_version from package names
1044 - added platform build configuration section to beginning of file
1045 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1046 - removed make_static_bacula script from rescue package install
1047 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1048 - Added define at top of file for depkgs version
1049 - Added rescue sub-package
1050 - Moved requires statements into proper sub-package locations
1051 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1052 - Corrected Requires for Gnome 1.4/2.0 builds
1053 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1054 - Added separate source declaration for depkgs
1055 - added patch for make_catalog_backup script
1056 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1057 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1058 - Added rh_version to sub-package names
1059 - Added installed but missing file /etc/bacula/gconsole
1060 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1061 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1062 - Update spec for version 1.31 and combine client
1063 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1064 - Initial spec file