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