]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/mandrake/bacula.spec.in
545ada98a7ed82a06c79cc3db66843c548252d38
[bacula/bacula] / bacula / platforms / mandrake / bacula.spec.in
1 # Bacula RPM spec file
2 # Copyright (C) 2000-2006 Kern Sibbald
3
4 # Platform Build Configuration
5
6 # basic defines for every build
7 %define _version @VERSION@
8 %define _release 1
9 %define depkgs_version 04Jan07
10 %define _rescuever 2.0.0
11 %define docs_version @VERSION@
12
13 # any patches for this release
14 # be sure to check the setup section for patch macros
15
16
17 #--------------------------------------------------------------------------
18 # it should not be necessary to change anything below here for a release
19 # except for patch macros in the setup section
20 #--------------------------------------------------------------------------
21
22 # third party packagers
23 %define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
24 %{?contrib_packager:%define _packager %{contrib_packager}}
25
26 Summary: Bacula - The Network Backup Solution
27 Name: bacula
28 Version: %{_version}
29 Release: %{_release}
30 Group: System Environment/Daemons
31 License: GPL v2
32 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
33 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
34 Source2: Release_Notes-%{version}-%{release}.tar.gz
35 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
36 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
37 BuildRoot: %{_tmppath}/%{name}-root
38 URL: http://www.bacula.org/
39 Vendor: The Bacula Team
40 Packager: %{_packager}
41
42 # define the basic package description
43 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
44 %define blurb2 Bacula is a set of computer programs that permit you (or the system
45 %define blurb3 administrator) to manage backup, recovery, and verification of computer
46 %define blurb4 data across a network of computers of different kinds. In technical terms,
47 %define blurb5 it is a network client/server based backup program. Bacula is relatively
48 %define blurb6 easy to use and efficient, while offering many advanced storage management
49 %define blurb7 features that make it easy to find and recover lost or damaged files.
50 %define blurb8 Bacula source code has been released under the GPL version 2 license.
51
52 # directory locations
53 %define sqlite_bindir /usr/lib/bacula/sqlite
54 %define working_dir /var/bacula
55 %define _docsrc ../%{name}-docs-%{docs_version}
56 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
57 %define depkgs ../depkgs
58 %define _mandir /usr/share/man
59
60 # NOTE these defines are used in some rather complex useradd and groupadd
61 # commands. If you change them examine the post scripts for consequences.
62 %define director_daemon_user bacula
63 %define storage_daemon_user bacula
64 %define file_daemon_user root
65 %define daemon_group bacula
66 # group that has write access to tape devices, usually disk on Linux
67 %define storage_daemon_group disk
68 %define user_file /etc/passwd
69 %define group_file /etc/group
70
71 # program locations
72 %define useradd /usr/sbin/useradd
73 %define groupadd /usr/sbin/groupadd
74 %define usermod /usr/sbin/usermod
75
76 # platform defines - set one below or define the build_xxx on the command line
77 # RedHat builds
78 %define rh7 0
79 %{?build_rh7:%define rh7 1}
80 %define rh8 0
81 %{?build_rh8:%define rh8 1}
82 %define rh9 0
83 %{?build_rh9:%define rh9 1}
84 # Fedora Core build
85 %define fc1 0
86 %{?build_fc1:%define fc1 1}
87 %define fc3 0
88 %{?build_fc3:%define fc3 1}
89 %define fc4 0
90 %{?build_fc4:%define fc4 1}
91 %define fc5 0
92 %{?build_fc5:%define fc5 1}
93 %define fc6 0
94 %{?build_fc6:%define fc6 1}
95 # Whitebox Enterprise build
96 %define wb3 0
97 %{?build_wb3:%define wb3 1}
98 # RedHat Enterprise builds
99 %define rhel3 0
100 %{?build_rhel3:%define rhel3 1}
101 %{?build_rhel3:%define wb3 1}
102 %define rhel4 0
103 %{?build_rhel4:%define rhel4 1}
104 %{?build_rhel4:%define fc3 1}
105 # CentOS build
106 %define centos3 0
107 %{?build_centos3:%define centos3 1}
108 %{?build_centos3:%define wb3 1}
109 %define centos4 0
110 %{?build_centos4:%define centos4 1}
111 %{?build_centos4:%define fc3 1}
112 # SuSE build
113 %define su9 0
114 %{?build_su9:%define su9 1}
115 %define su10 0
116 %{?build_su10:%define su10 1}
117 # Mandrake builds
118 %define mdk 0
119 %{?build_mdk:%define mdk 1}
120 %define mdv 0
121 %{?build_mdv:%define mdv 1}
122 %{?build_mdv:%define mdk 1}
123
124 # client only build
125 %define client_only 0
126 %{?build_client_only:%define client_only 1}
127
128 # test for a platform definition
129 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
130 %{error: You must specify a platform. Please examine the spec file.}
131 exit 1
132 %endif
133
134 # database defines
135 # set for database support desired or define the build_xxx on the command line
136 %define mysql 0
137 %{?build_mysql:%define mysql 1}
138 # if using mysql 4.x define this and mysql above
139 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
140 %define mysql4 0
141 %{?build_mysql4:%define mysql4 1}
142 %{?build_mysql4:%define mysql 1}
143 # if using mysql 5.x define this and mysql above
144 # currently: SuSE 10.1 and Fedora Core 5
145 %define mysql5 0
146 %{?build_mysql5:%define mysql5 1}
147 %{?build_mysql5:%define mysql 1}
148 %define sqlite 0
149 %{?build_sqlite:%define sqlite 1}
150 %define postgresql 0
151 %{?build_postgresql:%define postgresql 1}
152
153 # test for a database definition
154 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
155 %{error: You must specify database support. Please examine the spec file.}
156 exit 1
157 %endif
158
159 %if %{mysql}
160 %define db_backend mysql
161 %endif
162 %if %{sqlite}
163 %define db_backend sqlite
164 %endif
165 %if %{postgresql}
166 %define db_backend postgresql
167 %endif
168
169 # 64 bit support
170 %define x86_64 0
171 %{?build_x86_64:%define x86_64 1}
172
173 # check what distribution we are
174 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
175 %define _dist %(grep Red /etc/redhat-release)
176 %endif
177 %if %{fc1} || %{fc4} || %{fc5} || %{fc6}
178 %define _dist %(grep Fedora /etc/redhat-release)
179 %endif
180 %if %{centos4} || %{centos3}
181 %define _dist %(grep CentOS /etc/redhat-release)
182 %endif
183 %if %{fc3} && ! %{rhel4} && ! %{centos4}
184 %define _dist %(grep Fedora /etc/redhat-release)
185 %endif
186 %if %{wb3} && ! %{rhel3} && ! %{centos3}
187 %define _dist %(grep White /etc/whitebox-release)
188 %endif
189 %if %{su9} || %{su10}
190 %define _dist %(grep -i SuSE /etc/SuSE-release)
191 %endif
192 %if %{mdk}
193 %define _dist %(grep Mand /etc/mandrake-release)
194 %endif
195 Distribution: %{_dist}
196
197 # Should we build gconsole, possible only if gtk= >= 2.4 available.
198 # leaving all the BuildRequires and Requires in place below for now.
199
200 %define gconsole 1
201 %if %{rh7} || %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{su9}
202 %define gconsole 0
203 %endif
204 %if %{mdk} && ! %{mdv}
205 %define gconsole 0
206 %endif
207
208 # specifically disallow gconsole if desired
209 %{?nobuild_gconsole:%define gconsole 0}
210
211 # Should we build wxconsole, only wxWidgets >=2.6 is supported
212 # currently only SuSE 10 and FC4/FC5
213 %define wxconsole 0
214 %{?build_wxconsole:%define wxconsole 1}
215
216 # should we turn on python support
217 %define python 0
218 %{?build_python:%define python 1}
219
220 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
221 %if %{mdk}
222 %define manpage_ext bz2
223 %else
224 %define manpage_ext gz
225 %endif
226
227 # for client only build
228 %if %{client_only}
229 %define mysql 0
230 %define mysql4 0
231 %define mysql5 0
232 %define postgresql 0
233 %define sqlite 0
234 %define gconsole 0
235 %define wxconsole 0
236 %endif
237
238 %{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)}
239 %{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)}
240
241 BuildRequires: gcc, gcc-c++, make, autoconf
242 BuildRequires: ncurses-devel, perl
243 BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, libxml2-devel, zlib-devel
244 BuildRequires: openssl-devel
245 %if %{python}
246 BuildRequires: python, python-devel
247 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
248 %endif
249 %if %{gconsole}
250 BuildRequires: pkgconfig, pango-devel, atk-devel
251 %endif
252 %if %{rh7}
253 BuildRequires: libtermcap-devel
254 BuildRequires: glibc-devel >= 2.2
255 %endif
256 %if %{su9}
257 BuildRequires: termcap
258 BuildRequires: glibc-devel >= 2.3
259 %endif
260 %if %{su9} && %{gconsole}
261 BuildRequires: libgnome >= 2.0
262 BuildRequires: gtk2-devel >= 2.0
263 BuildRequires: libgnomeui-devel >= 2.0
264 BuildRequires: ORBit2-devel
265 BuildRequires: libart_lgpl-devel >= 2.0
266 BuildRequires: libbonobo-devel >= 2.0
267 BuildRequires: libbonoboui-devel >= 2.0
268 BuildRequires: bonobo-activation-devel
269 BuildRequires: gconf2-devel
270 BuildRequires: linc-devel
271 BuildRequires: freetype2-devel
272 %endif
273 %if %{su10}
274 BuildRequires: termcap
275 BuildRequires: glibc-devel >= 2.3
276 %endif
277 %if %{su10} && %{gconsole}
278 BuildRequires: libgnome >= 2.12
279 BuildRequires: gtk2-devel >= 2.8
280 BuildRequires: libgnomeui-devel >= 2.12
281 BuildRequires: ORBit2-devel
282 BuildRequires: libart_lgpl-devel >= 2.3
283 BuildRequires: libbonobo-devel >= 2.10
284 BuildRequires: libbonoboui-devel >= 2.10
285 BuildRequires: bonobo-activation-devel
286 BuildRequires: gconf2-devel
287 BuildRequires: freetype2-devel
288 BuildRequires: cairo-devel
289 BuildRequires: fontconfig-devel >= 2.3
290 BuildRequires: gnome-vfs2-devel >= 2.12
291 BuildRequires: libpng-devel
292 %endif
293 %if %{mdk}
294 BuildRequires: libtermcap-devel
295 BuildRequires: libstdc++-static-devel
296 BuildRequires: glibc-static-devel
297 BuildRequires: glibc-devel >= 2.3
298 %endif
299 %if %{mdk} && !%{mdv} && %{gconsole}
300 BuildRequires: gtk2-devel >= 2.0
301 BuildRequires: libgnomeui2-devel >= 2.0
302 BuildRequires: libORBit2-devel
303 BuildRequires: libart_lgpl-devel >= 2.0
304 BuildRequires: libbonobo2_0-devel
305 BuildRequires: libbonoboui2_0-devel
306 BuildRequires: libbonobo-activation-devel
307 BuildRequires: libGConf2-devel
308 BuildRequires: freetype2-devel
309 %endif
310 %if %{mdv} && %{gconsole}
311 BuildRequires: gtk2-devel >= 2.8
312 BuildRequires: libgnomeui2-devel >= 2.10
313 BuildRequires: libORBit2-devel
314 BuildRequires: libart_lgpl-devel >= 2.3
315 BuildRequires: libbonobo2_0-devel
316 BuildRequires: libbonoboui2_0-devel
317 BuildRequires: libbonobo-activation-devel
318 BuildRequires: libGConf2-devel
319 BuildRequires: freetype2-devel
320 %endif
321 %if %{fc3}
322 BuildRequires: libtermcap-devel
323 BuildRequires: glibc-devel >= 2.3
324 %endif
325 %if %{fc3} && %{gconsole}
326 BuildRequires: gtk2-devel >= 2.4
327 BuildRequires: libgnomeui-devel >= 2.8
328 BuildRequires: ORBit2-devel
329 BuildRequires: libart_lgpl-devel >= 2.3
330 BuildRequires: libbonobo-devel >= 2.8
331 BuildRequires: libbonoboui-devel >= 2.8
332 BuildRequires: bonobo-activation-devel
333 BuildRequires: GConf2-devel
334 BuildRequires: freetype-devel
335 %endif
336 %if %{fc4}
337 BuildRequires: libtermcap-devel
338 BuildRequires: glibc-devel >= 2.3
339 %endif
340 %if %{fc4} && %{gconsole}
341 BuildRequires: gtk2-devel >= 2.6
342 BuildRequires: libgnomeui-devel >= 2.10
343 BuildRequires: ORBit2-devel
344 BuildRequires: libart_lgpl-devel >= 2.3
345 BuildRequires: libbonobo-devel >= 2.8
346 BuildRequires: libbonoboui-devel >= 2.8
347 BuildRequires: bonobo-activation-devel
348 BuildRequires: GConf2-devel
349 BuildRequires: freetype-devel
350 %endif
351 %if %{fc5}
352 BuildRequires: libtermcap-devel
353 BuildRequires: glibc-devel >= 2.4
354 %endif
355 %if %{fc5} && %{gconsole}
356 BuildRequires: gtk2-devel >= 2.8
357 BuildRequires: libgnomeui-devel >= 2.14
358 BuildRequires: ORBit2-devel
359 BuildRequires: libart_lgpl-devel >= 2.3
360 BuildRequires: libbonobo-devel >= 2.14
361 BuildRequires: libbonoboui-devel >= 2.14
362 BuildRequires: GConf2-devel
363 BuildRequires: freetype-devel
364 %endif
365 %if %{fc6}
366 BuildRequires: libtermcap-devel
367 BuildRequires: glibc-devel >= 2.5
368 %endif
369 %if %{fc6} && %{gconsole}
370 BuildRequires: gtk2-devel >= 2.10
371 BuildRequires: libgnomeui-devel >= 2.16
372 BuildRequires: ORBit2-devel
373 BuildRequires: libart_lgpl-devel >= 2.3
374 BuildRequires: libbonobo-devel >= 2.16
375 BuildRequires: libbonoboui-devel >= 2.16
376 BuildRequires: GConf2-devel
377 BuildRequires: freetype-devel
378 %endif
379 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6}
380 BuildRequires: libtermcap-devel
381 BuildRequires: glibc-devel >= 2.3
382 %endif
383 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6} && %{gconsole}
384 BuildRequires: gtk2-devel >= 2.0
385 BuildRequires: libgnomeui-devel >= 2.0
386 BuildRequires: ORBit2-devel
387 BuildRequires: libart_lgpl-devel >= 2.0
388 BuildRequires: libbonobo-devel >= 2.0
389 BuildRequires: libbonoboui-devel >= 2.0
390 BuildRequires: bonobo-activation-devel
391 BuildRequires: GConf2-devel
392 BuildRequires: linc-devel
393 BuildRequires: freetype-devel
394 %endif
395
396 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
397 BuildRequires: mysql-devel >= 3.23
398 %endif
399
400 %if %{mysql} && %{mysql4}
401 BuildRequires: mysql-devel >= 4.0
402 %endif
403
404 %if %{mysql} && %{mysql5}
405 BuildRequires: mysql-devel >= 5.0
406 %endif
407
408 %if %{postgresql} && %{wb3}
409 BuildRequires: rh-postgresql-devel >= 7
410 %endif
411
412 %if %{postgresql} && ! %{wb3}
413 BuildRequires: postgresql-devel >= 7
414 %endif
415
416 %if %{wxconsole}
417 BuildRequires: wxGTK-devel >= 2.6
418 %endif
419
420 %description
421 %{blurb}
422
423 %{blurb2}
424 %{blurb3}
425 %{blurb4}
426 %{blurb5}
427 %{blurb6}
428 %{blurb7}
429 %{blurb8}
430
431 %if %{mysql}
432 %package mysql
433 %endif
434 %if %{sqlite}
435 %package sqlite
436 %endif
437 %if %{postgresql}
438 %package postgresql
439 %endif
440
441 Summary: Bacula - The Network Backup Solution
442 Group: System Environment/Daemons
443 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
444 Conflicts: bacula-client
445 Obsoletes: bacula-rescue
446
447 %if %{su9} || %{su10}
448 Conflicts: bacula
449 %endif
450
451 Requires: ncurses, libstdc++, zlib, openssl, mtx
452
453 %if %{rh7}
454 Requires: glibc >= 2.2
455 Requires: libtermcap
456 %endif
457 %if %{su9} || %{su10}
458 Requires: glibc >= 2.3
459 Requires: termcap
460 %endif
461 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5} && ! %{fc6}
462 Requires: glibc >= 2.3
463 Requires: libtermcap
464 %endif
465 %if %{fc5}
466 Requires: glibc >= 2.4
467 Requires: libtermcap
468 %endif
469 %if %{fc6}
470 Requires: glibc >= 2.5
471 Requires: libtermcap
472 %endif
473
474 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
475 Requires: mysql >= 3.23
476 Requires: mysql-server >= 3.23
477 %endif
478 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
479 Requires: mysql >= 4.0
480 Requires: mysql-server >= 4.0
481 %endif
482 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
483 Requires: mysql >= 5.0
484 Requires: mysql-server >= 5.0
485 %endif
486
487 %if %{mysql} && %{su9} && ! %{mysql4}
488 Requires: mysql >= 3.23
489 Requires: mysql-client >= 3.23
490 %endif
491 %if %{mysql} && %{su9} && %{mysql4}
492 Requires: mysql >= 4.0
493 Requires: mysql-client >= 4.0
494 %endif
495 %if %{mysql} && %{su10} && %{mysql4}
496 Requires: mysql >= 4.0
497 Requires: mysql-client >= 4.0
498 %endif
499 %if %{mysql} && %{su10} && %{mysql5}
500 Requires: mysql >= 5.0
501 Requires: mysql-client >= 5.0
502 %endif
503
504 %if %{mysql} && %{mdk} && ! %{mysql4}
505 Requires: mysql >= 3.23
506 Requires: mysql-client >= 3.23
507 %endif
508 %if %{mysql} && %{mdk} && %{mysql4}
509 Requires: mysql >= 4.0
510 Requires: mysql-client >= 4.0
511 %endif
512
513 %if %{postgresql} && %{wb3}
514 Requires: rh-postgresql >= 7
515 Requires: rh-postgresql-server >= 7
516 %endif
517 %if %{postgresql} && ! %{wb3}
518 Requires: postgresql >= 7
519 Requires: postgresql-server >= 7
520 %endif
521
522 %if %{mysql}
523 %description mysql
524 %endif
525 %if %{sqlite}
526 %description sqlite
527 %endif
528 %if %{postgresql}
529 %description postgresql
530 %endif
531
532 %if %{python}
533 Requires: python >= %{pyver}
534 %endif
535
536 %{blurb}
537
538 %{blurb2}
539 %{blurb3}
540 %{blurb4}
541 %{blurb5}
542 %{blurb6}
543 %{blurb7}
544 %{blurb8}
545
546 %if %{mysql}
547 This build requires MySQL to be installed separately as the catalog database.
548 %endif
549 %if %{postgresql}
550 This build requires PostgreSQL to be installed separately as the catalog database.
551 %endif
552 %if %{sqlite}
553 This build incorporates sqlite as the catalog database, statically compiled.
554 %endif
555 %if %{python}
556 This build includes python scripting support.
557 %endif
558
559 %if ! %{client_only}
560 %package mtx
561 Summary: Bacula - The Network Backup Solution
562 Group: System Environment/Daemons
563 Provides: mtx
564
565 %description mtx
566 This is Bacula's version of mtx tape utilities for Linux distributions that
567 do not provide their own mtx package
568 %endif
569
570 %package client
571 Summary: Bacula - The Network Backup Solution
572 Group: System Environment/Daemons
573 Provides: bacula-fd
574 Conflicts: bacula-mysql
575 Conflicts: bacula-sqlite
576 Conflicts: bacula-postgresql
577 Obsoletes: bacula-rescue
578
579 %if %{su9} || %{su10}
580 Provides: bacula
581 %endif
582
583 Requires: libstdc++, zlib, openssl
584
585 %if %{rh7}
586 Requires: glibc >= 2.2
587 Requires: libtermcap
588 %endif
589 %if %{su9} || %{su10}
590 Requires: glibc >= 2.3
591 Requires: termcap
592 %endif
593 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5} && ! %{fc6}
594 Requires: glibc >= 2.3
595 Requires: libtermcap
596 %endif
597 %if %{fc5}
598 Requires: glibc >= 2.4
599 Requires: libtermcap
600 %endif
601 %if %{fc6}
602 Requires: glibc >= 2.5
603 Requires: libtermcap
604 %endif
605
606 %if %{python}
607 Requires: python >= %{pyver}
608 %endif
609
610 %description client
611 %{blurb}
612
613 %{blurb2}
614 %{blurb3}
615 %{blurb4}
616 %{blurb5}
617 %{blurb6}
618 %{blurb7}
619 %{blurb8}
620
621 This is the File daemon (Client) only package. It includes the command line 
622 console program.
623 %if %{python}
624 This build includes python scripting support.
625 %endif
626
627 %if ! %{client_only}
628 %package updatedb
629
630 Summary: Bacula - The Network Backup Solution
631 Group: System Environment/Daemons
632
633 %description updatedb
634 %{blurb}
635
636 %{blurb2}
637 %{blurb3}
638 %{blurb4}
639 %{blurb5}
640 %{blurb6}
641 %{blurb7}
642 %{blurb8}
643
644 This package installs scripts for updating older versions of the bacula
645 database.
646 %endif
647
648 %if %{gconsole}
649 %package gconsole
650 Summary: Bacula - The Network Backup Solution
651 Group: System Environment/Daemons
652 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
653 %endif
654
655 %if %{gconsole} && %{su9}
656 Requires: gtk2 >= 2.0
657 Requires: libgnome >= 2.0
658 Requires: libgnomeui >= 2.0
659 Requires: glibc >= 2.3
660 Requires: ORBit2
661 Requires: libart_lgpl >= 2.0
662 Requires: libbonobo >= 2.0
663 Requires: libbonoboui >= 2.0
664 Requires: bonobo-activation
665 Requires: gconf2
666 Requires: linc
667 Requires: freetype2
668 %endif
669 %if %{gconsole} && %{su10}
670 Requires: gtk2 >= 2.8
671 Requires: libgnome >= 2.12
672 Requires: libgnomeui >= 2.12
673 Requires: glibc >= 2.3
674 Requires: ORBit2
675 Requires: libart_lgpl >= 2.3
676 Requires: libbonobo >= 2.10
677 Requires: libbonoboui >= 2.10
678 Requires: bonobo-activation
679 Requires: gconf2
680 Requires: freetype2
681 Requires: cairo
682 Requires: fontconfig >= 2.3
683 Requires: gnome-vfs2 >= 2.12
684 Requires: libpng
685 %endif
686 %if %{gconsole} && %{mdk} && !%{mdv}
687 Requires: gtk2 >= 2.0
688 Requires: libgnomeui2
689 Requires: glibc >= 2.3
690 Requires: ORBit2
691 Requires: libart_lgpl >= 2.0
692 Requires: libbonobo >= 2.0
693 Requires: libbonoboui >= 2.0
694 Requires: GConf2
695 Requires: freetype2
696 %endif
697 %if %{gconsole} && %{mdv}
698 Requires: gtk2 >= 2.8
699 Requires: libgnomeui2
700 Requires: glibc >= 2.3
701 Requires: ORBit2
702 Requires: libart_lgpl >= 2.3
703 Requires: libbonobo >= 2.10
704 Requires: libbonoboui >= 2.10
705 Requires: GConf2
706 Requires: freetype2
707 %endif
708 %if %{gconsole} && %{fc3}  
709 Requires: gtk2 >= 2.4
710 Requires: libgnomeui >= 2.8
711 Requires: glibc >= 2.3
712 Requires: ORBit2
713 Requires: libart_lgpl >= 2.3
714 Requires: libbonobo >= 2.8
715 Requires: libbonoboui >= 2.8
716 Requires: bonobo-activation
717 Requires: GConf2
718 Requires: freetype
719 %endif
720 %if %{gconsole} && %{fc4}  
721 Requires: gtk2 >= 2.6
722 Requires: libgnomeui >= 2.10
723 Requires: glibc >= 2.3
724 Requires: ORBit2
725 Requires: libart_lgpl >= 2.3
726 Requires: libbonobo >= 2.8
727 Requires: libbonoboui >= 2.8
728 Requires: bonobo-activation
729 Requires: GConf2
730 Requires: freetype
731 %endif
732 %if %{gconsole} && %{fc5}  
733 Requires: gtk2 >= 2.8
734 Requires: libgnomeui >= 2.14
735 Requires: glibc >= 2.4
736 Requires: ORBit2
737 Requires: libart_lgpl >= 2.3
738 Requires: libbonobo >= 2.14
739 Requires: libbonoboui >= 2.14
740 Requires: GConf2
741 Requires: freetype
742 %endif
743 %if %{gconsole} && %{fc6}  
744 Requires: gtk2 >= 2.10
745 Requires: libgnomeui >= 2.16
746 Requires: glibc >= 2.5
747 Requires: ORBit2
748 Requires: libart_lgpl >= 2.3
749 Requires: libbonobo >= 2.16
750 Requires: libbonoboui >= 2.16
751 Requires: GConf2
752 Requires: freetype
753 %endif
754 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{fc6}
755 Requires: gtk2 >= 2.0
756 Requires: libgnomeui >= 2.0
757 Requires: glibc >= 2.3
758 Requires: ORBit2
759 Requires: libart_lgpl >= 2.0
760 Requires: libbonobo >= 2.0
761 Requires: libbonoboui >= 2.0
762 Requires: bonobo-activation
763 Requires: GConf2
764 Requires: linc
765 Requires: freetype
766 %endif
767 %if %{gconsole} && %{su9}
768 Requires: xsu
769 %endif
770 %if %{gconsole} && %{su10}
771 Requires: xsu
772 %endif
773 %if %{gconsole} && ! %{su9} && ! %{su10}
774 Requires: usermode
775 %endif
776
777 %if %{gconsole}
778 %description gconsole
779 %{blurb}
780
781 %{blurb2}
782 %{blurb3}
783 %{blurb4}
784 %{blurb5}
785 %{blurb6}
786 %{blurb7}
787 %{blurb8}
788
789 This is the Gnome Console package. It is an add-on to the client or
790 server packages.
791 %endif
792
793 %if %{wxconsole}
794 %package wxconsole
795 Summary: Bacula - The Network Backup Solution
796 Group: System Environment/Daemons
797 Requires: wxGTK >= 2.6, libstdc++, openssl
798 %endif
799
800 %if %{wxconsole} && %{su10}
801 Requires: gtk2 >= 2.8
802 %endif
803
804 %if %{wxconsole} && %{fc3}  
805 Requires: gtk2 >= 2.4
806 %endif
807
808 %if %{wxconsole} && %{fc4}  
809 Requires: gtk2 >= 2.6
810 %endif
811
812 %if %{wxconsole} && %{fc5}  
813 Requires: gtk2 >= 2.8
814 %endif
815
816 %if %{wxconsole} && %{fc6}  
817 Requires: gtk2 >= 2.10
818 %endif
819
820 %if %{wxconsole}
821 %description wxconsole
822 %{blurb}
823
824 %{blurb2}
825 %{blurb3}
826 %{blurb4}
827 %{blurb5}
828 %{blurb6}
829 %{blurb7}
830 %{blurb8}
831
832 This is the WXWindows Console package. It is an add-on to the client or
833 server packages.
834 %endif
835
836 %prep
837
838 %setup
839 %setup -T -D -b 1
840 %setup -T -D -b 2
841 %setup -T -D -b 3
842 %setup -T -D -b 4
843
844 %build
845
846 %if %{su9} || %{su10}
847 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
848 %endif
849
850 cwd=${PWD}
851 cd %{depkgs}
852 %if %{sqlite}
853 make sqlite
854 %endif
855 %if ! %{client_only}
856 make mtx
857 %endif
858 cd ${cwd}
859
860 # patches for the bundled sqlite scripts
861
862 # patch the make_sqlite_tables script for installation bindir
863 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
864
865 # patch the create_sqlite_database script for installation bindir
866 # not necessary after 1.39.26 no longer references sqlite binary
867 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
868
869 # patch the make_catalog_backup script for installation bindir
870 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
871
872 # patch the update_sqlite_tables script for installation bindir
873 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
874
875 # patch the bacula-dir init script to remove sqlite service
876 %if %{sqlite} && %{su9}
877 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
878 %endif
879 %if %{sqlite} && %{su10}
880 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
881 %endif
882
883 # 64 bit lib location hacks
884 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
885 # reported to be fixed to properly detect lib locations.
886 %if %{x86_64}
887 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
888 %endif
889 %if %{mysql} && %{x86_64}
890 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
891 %endif
892 %if %{python} && %{x86_64}
893 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
894 %endif
895
896 %configure \
897         --prefix=/usr \
898         --sbindir=/usr/sbin \
899         --sysconfdir=/etc/bacula \
900         --with-scriptdir=/etc/bacula \
901         --enable-smartalloc \
902         --enable-client-only \
903         %if %{mdk}
904         --disable-nls \
905         %endif
906         --enable-static-fd
907
908 make
909
910 %configure \
911         --prefix=/usr \
912         --sbindir=/usr/sbin \
913         --sysconfdir=/etc/bacula \
914         --with-scriptdir=/etc/bacula \
915         --enable-smartalloc \
916 %if %{gconsole}
917         --enable-gnome \
918 %endif
919 %if %{gconsole} && ! %{rh8}
920         --enable-tray-monitor \
921 %endif
922 %if %{mysql}
923         --with-mysql \
924 %endif
925 %if %{sqlite}
926         --with-sqlite=${cwd}/%{depkgs}/sqlite \
927 %endif
928 %if %{postgresql}
929         --with-postgresql \
930 %endif
931 %if %{wxconsole}
932         --enable-wx-console \
933 %endif
934 %if %{python}
935         --with-python \
936 %endif
937 %if %{client_only}
938         --enable-client-only \
939 %endif
940         --mandir=%{_mandir} \
941         --with-working-dir=%{working_dir} \
942         --with-pid-dir=/var/run \
943         --with-subsys-dir=/var/lock/subsys \
944         --with-dir-user=%{director_daemon_user} \
945         --with-dir-group=%{daemon_group} \
946         --with-sd-user=%{storage_daemon_user} \
947         --with-sd-group=%{storage_daemon_group} \
948         --with-fd-user=%{file_daemon_user} \
949         --with-fd-group=%{daemon_group} \
950         --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
951         --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
952         --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
953         --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
954         --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
955         --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
956         --with-openssl
957
958 make
959
960 %install
961  
962 cwd=${PWD}
963 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
964 mkdir -p $RPM_BUILD_ROOT/etc/init.d
965 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
966 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
967 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
968 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
969 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
970
971 %if %{gconsole} || %{wxconsole}
972 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
973 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
974 %endif
975
976 %if %{gconsole} || %{wxconsole}
977 %define usermode_iftrick 1
978 %else
979 %define usermode_iftrick 0
980 %endif
981
982 %if %{usermode_iftrick} && ! %{su9} && ! %{su10}
983 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
984 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
985 mkdir -p $RPM_BUILD_ROOT/usr/bin
986 %endif
987
988 %if %{sqlite}
989 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
990 %endif
991
992 make \
993         prefix=$RPM_BUILD_ROOT/usr \
994         sbindir=$RPM_BUILD_ROOT/usr/sbin \
995         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
996         scriptdir=$RPM_BUILD_ROOT/etc/bacula \
997         working_dir=$RPM_BUILD_ROOT%{working_dir} \
998         mandir=$RPM_BUILD_ROOT%{_mandir} \
999         install
1000
1001 %if ! %{client_only}
1002 cd %{depkgs}
1003 make \
1004         prefix=$RPM_BUILD_ROOT/usr \
1005         sbindir=$RPM_BUILD_ROOT/usr/sbin \
1006         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
1007         working_dir=$RPM_BUILD_ROOT%{working_dir} \
1008         mandir=$RPM_BUILD_ROOT%{_mandir} \
1009         mtx-install
1010 cd ${cwd}
1011 %endif
1012
1013 # make install in manpages installs _everything_ shotgun style
1014 # so now delete what we will not be packaging
1015 %if ! %{wxconsole}
1016 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-wxconsole.1.gz
1017 %endif
1018 %if ! %{gconsole}
1019 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-console-gnome.1.gz
1020 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.gz
1021 %endif
1022 %if %{client_only}
1023 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.gz
1024 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.gz
1025 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.gz
1026 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.gz
1027 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.gz
1028 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.gz
1029 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.gz
1030 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.gz
1031 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.gz
1032 %endif
1033
1034 # fixme - make installs the mysql scripts for sqlite build
1035 %if %{sqlite}
1036 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
1037 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
1038 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
1039 %endif
1040
1041 # fixme - make installs the mysql scripts for postgresql build
1042 %if %{postgresql}
1043 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
1044 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
1045 %endif
1046
1047 # fixme - make installs gconsole script for build without gconsole
1048 %if ! %{gconsole}
1049 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
1050 %endif
1051
1052 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
1053
1054 # install the init scripts
1055 %if %{su9} || %{su10}
1056 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1057 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1058 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1059 %endif
1060 %if %{mdk}
1061 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1062 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1063 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1064 %endif
1065 %if ! %{su9} && ! %{su10} && ! %{mdk}
1066 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1067 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
1068 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1069 %endif
1070 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
1071 %if %{client_only}
1072 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
1073 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
1074 %endif
1075
1076 # install the menu stuff
1077 %if %{gconsole} && %{su9}
1078 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1079 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1080 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1081 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1082 %endif
1083 %if %{gconsole} && %{su10}
1084 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1085 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1086 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1087 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1088 %endif
1089 %if %{wxconsole} && %{su10}
1090 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1091 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1092 %endif
1093 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
1094 %define iftrick 1
1095 %else
1096 %define iftrick 0
1097 %endif
1098 %if %{gconsole} && %{iftrick}
1099 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
1100 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
1101 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
1102 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
1103 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
1104 %endif
1105 %if %{gconsole} && ! %{rh8}
1106 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
1107 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
1108 %endif
1109 %if %{wxconsole} && %{iftrick}
1110 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
1111 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
1112 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
1113 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
1114 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
1115 %endif
1116
1117 # install sqlite
1118 %if %{sqlite}
1119 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
1120 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
1121 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
1122 %endif
1123
1124 # install the logrotate file
1125 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
1126
1127 # install the updatedb scripts
1128 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
1129
1130 # install the logwatch scripts
1131 %if ! %{client_only}
1132 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1133 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1134 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1135 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1136 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1137 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1138 %endif
1139
1140 # install the rescue files
1141 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
1142 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
1143 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
1144 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
1145 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
1146 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
1147 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
1148 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
1149 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
1150 rm -f src/filed/static-bacula-fd
1151
1152 %if %{wxconsole}
1153 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
1154 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
1155 %endif
1156
1157 # now clean up permissions that are left broken by the install
1158 %if ! %{client_only}
1159 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
1160 %endif
1161 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
1162 %if %{gconsole} && ! %{rh8}
1163 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
1164 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
1165 %endif
1166
1167 # fix me - building enable-client-only installs files not included in bacula-client package
1168 %if %{client_only}
1169 rm -f $RPM_BUILD_ROOT/etc/bacula/bacula
1170 rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-dir
1171 rm -f $RPM_BUILD_ROOT/etc/bacula/bacula-ctl-sd
1172 rm -f $RPM_BUILD_ROOT/etc/bacula/disk-changer
1173 rm -f $RPM_BUILD_ROOT/etc/bacula/dvd-handler
1174 rm -f $RPM_BUILD_ROOT/etc/bacula/mtx-changer
1175 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
1176 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
1177 rm -rf $RPM_BUILD_ROOT/etc/bacula/updatedb
1178 %endif
1179
1180 %clean
1181 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1182
1183 %if %{mysql}
1184 # MySQL specific files
1185 %files mysql
1186 %defattr(-, root, root)
1187 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
1188 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
1189 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
1190 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
1191 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1192 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1193 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1194 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1195 %endif
1196
1197 %if %{sqlite}
1198 %files sqlite
1199 %defattr(-,root,root)
1200 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1201 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1202 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1203 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1204 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1205 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1206 %{sqlite_bindir}/libsqlite.a
1207 %{sqlite_bindir}/sqlite.h
1208 %{sqlite_bindir}/sqlite
1209 %endif
1210
1211 %if %{postgresql}
1212 %files postgresql
1213 %defattr(-,root,root)
1214 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1215 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1216 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1217 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1218 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1219 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1220 %endif
1221
1222 # The rest is DB backend independent
1223 %if ! %{client_only}
1224 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1225 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1226 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1227 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1228 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1229 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1230 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1231 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1232 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1233 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1234 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1235 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1236 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1237 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1238 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1239 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1240 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1241 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1242 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1243 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1244 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1245 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1246 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1247
1248 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
1249 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1250
1251 /etc/logrotate.d/bacula
1252 /etc/log.d/scripts/services/bacula
1253 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1254 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1255 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1256 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1257 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1258 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1259 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1260
1261 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1262
1263 /usr/sbin/bacula-dir
1264 /usr/sbin/bacula-fd
1265 /usr/sbin/bacula-sd
1266 /usr/sbin/bcopy
1267 /usr/sbin/bextract
1268 /usr/sbin/bls
1269 /usr/sbin/bscan
1270 /usr/sbin/btape
1271 /usr/sbin/btraceback
1272 /usr/sbin/bconsole
1273 /usr/sbin/dbcheck
1274 /usr/sbin/bsmtp
1275 /usr/sbin/bregex
1276 /usr/sbin/bwild
1277 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1278 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1279 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1280 %{_mandir}/man8/bacula.8.%{manpage_ext}
1281 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1282 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1283 %{_mandir}/man8/bextract.8.%{manpage_ext}
1284 %{_mandir}/man8/bls.8.%{manpage_ext}
1285 %{_mandir}/man8/bscan.8.%{manpage_ext}
1286 %{_mandir}/man8/btape.8.%{manpage_ext}
1287 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1288 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1289 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1290 %endif
1291
1292 %if %{mysql}
1293 %pre mysql
1294 # test for bacula database older than version 9
1295 # note: this ASSUMES no password has been set for bacula database
1296 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1297 %endif
1298
1299 %if %{sqlite}
1300 %pre sqlite
1301 # test for bacula database older than version 9
1302 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1303         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1304 %endif
1305
1306 %if %{postgresql}
1307 %pre postgresql
1308 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1309 %endif
1310
1311 %if ! %{client_only}
1312 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "9" ]; then
1313         echo "This bacula upgrade will update a bacula database from version 9 to 10."
1314         echo "You appear to be running database version $DB_VER. You must first update"
1315         echo "your database to version 9 and then install this upgrade. The alternative"
1316         echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1317         echo "catalog information, then do the upgrade. Information on updating a"
1318         echo "database older than version 9 can be found in the release notes."
1319         exit 1
1320 fi
1321 %endif
1322
1323 %if %{sqlite}
1324 fi
1325 %endif
1326
1327 %if ! %{client_only}
1328 # check for and copy /etc/bacula/console.conf to bconsole.conf
1329 if [ -s /etc/bacula/console.conf ];then
1330         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1331 fi
1332
1333 # create the daemon users and groups
1334 # first create the groups if they don't exist
1335 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1336 if [ -z "$HAVE_BACULA" ]; then
1337         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1338         echo "The group %{daemon_group} has been added to %{group_file}."
1339         echo "See the manual chapter \"Running Bacula\" for details."
1340 fi
1341 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1342 if [ -z "$HAVE_BACULA" ]; then
1343         %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1344         echo "The group %{storage_daemon_group} has been added to %{group_file}."
1345         echo "See the manual chapter \"Running Bacula\" for details."
1346 fi
1347 # now create the users if they do not exist
1348 # we do not use the -g option allowing the primary group to be set to system default
1349 # this will be a unique group on redhat type systems or the group users on some systems
1350 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1351 if [ -z "$HAVE_BACULA" ]; then
1352         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1353         echo "The user %{storage_daemon_user} has been added to %{user_file}."
1354         echo "See the manual chapter \"Running Bacula\" for details."
1355 fi
1356 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1357 if [ -z "$HAVE_BACULA" ]; then
1358         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1359         echo "The user %{director_daemon_user} has been added to %{user_file}."
1360         echo "See the manual chapter \"Running Bacula\" for details."
1361 fi
1362 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1363 if [ -z "$HAVE_BACULA" ]; then
1364         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1365         echo "The user %{file_daemon_user} has been added to %{user_file}."
1366         echo "See the manual chapter \"Running Bacula\" for details."
1367 fi
1368 # now we add the supplementary groups, this is ok to call even if the users already exist
1369 # we only do this if the user is NOT root
1370 IS_ROOT=%{director_daemon_user}
1371 if [ "$IS_ROOT" != "root" ]; then
1372 %{usermod} -G %{daemon_group} %{director_daemon_user}
1373 fi
1374 IS_ROOT=%{storage_daemon_user}
1375 if [ "$IS_ROOT" != "root" ]; then
1376 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1377 fi
1378 IS_ROOT=%{file_daemon_user}
1379 if [ "$IS_ROOT" != "root" ]; then
1380 %{usermod} -G %{daemon_group} %{file_daemon_user}
1381 fi
1382 %endif
1383
1384 %if %{mysql}
1385 %post mysql
1386 %endif
1387 %if %{sqlite}
1388 %post sqlite
1389 %endif
1390 %if %{postgresql}
1391 %post postgresql
1392 %endif
1393
1394 %if ! %{client_only}
1395 # add our links
1396 if [ "$1" -ge 1 ] ; then
1397 /sbin/chkconfig --add bacula-dir
1398 /sbin/chkconfig --add bacula-fd
1399 /sbin/chkconfig --add bacula-sd
1400 fi
1401 %endif
1402
1403 %if %{mysql}
1404 # test for an existing database
1405 # note: this ASSUMES no password has been set for bacula database
1406 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1407
1408 # grant privileges and create tables if they do not exist
1409 if [ -z "$DB_VER" ]; then
1410         echo "Hmm, doesn't look like you have an existing database."
1411         echo "Granting privileges for MySQL user bacula..."
1412         /etc/bacula/grant_mysql_privileges
1413         echo "Creating MySQL bacula database..."
1414         /etc/bacula/create_mysql_database
1415         echo "Creating bacula tables..."
1416         /etc/bacula/make_mysql_tables
1417
1418 # check to see if we need to upgrade a 1.38 or lower database
1419 elif [ "$DB_VER" -lt "10" ]; then
1420         echo "This release requires an upgrade to your bacula database."
1421         echo "Backing up your current database..."
1422         mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1423         echo "Upgrading bacula database ..."
1424         /etc/bacula/update_mysql_tables
1425         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1426
1427 fi
1428 %endif
1429
1430 %if %{sqlite}
1431 # test for an existing database
1432 if [ -s %{working_dir}/bacula.db ]; then
1433         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1434         # check to see if we need to upgrade a 1.38 or lower database
1435         if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then
1436                 echo "This release requires an upgrade to your bacula database."
1437                 echo "Backing up your current database..."
1438                 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1439                 echo "Upgrading bacula database ..."
1440                 /etc/bacula/update_sqlite_tables
1441                 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1442         fi
1443 else
1444         # create the database and tables
1445         echo "Hmm, doesn't look like you have an existing database."
1446         echo "Creating SQLite database..."
1447         /etc/bacula/create_sqlite_database
1448         echo "Creating the SQLite tables..."
1449         /etc/bacula/make_sqlite_tables
1450 fi
1451 %endif
1452
1453 %if %{postgresql}
1454 # test for an existing database
1455 # note: this ASSUMES no password has been set for bacula database
1456 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1457
1458 # grant privileges and create tables if they do not exist
1459 if [ -z "$DB_VER" ]; then
1460         echo "Hmm, doesn't look like you have an existing database."
1461         echo "Creating PostgreSQL bacula database..."
1462         /etc/bacula/create_postgresql_database
1463         echo "Creating bacula tables..."
1464         /etc/bacula/make_postgresql_tables
1465         echo "Granting privileges for PostgreSQL user bacula..."
1466         /etc/bacula/grant_postgresql_privileges
1467
1468 # check to see if we need to upgrade a 1.38 or lower database
1469 elif [ "$DB_VER" -lt "10" ]; then
1470         echo "This release requires an upgrade to your bacula database."
1471         echo "Backing up your current database..."
1472         pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1473         echo "Upgrading bacula database ..."
1474         /etc/bacula/update_postgresql_tables
1475         echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1476         
1477 fi
1478 %endif
1479
1480 %if ! %{client_only}
1481 # generate passwords if needed
1482 if [ -d /etc/bacula ]; then
1483         cd /etc/bacula
1484         for file in *.conf; do
1485                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1486                         need_password=`grep $string $file 2>/dev/null`
1487                         if [ -n "$need_password" ]; then
1488                                 pass=`openssl rand -base64 33`
1489                                 sed "s-$string-$pass-g" $file > $file.new
1490                                 cp -f $file.new $file; rm -f $file.new
1491                         fi
1492                 done
1493         done
1494 fi
1495 %endif
1496
1497 %if %{mysql}
1498 %preun mysql
1499 %endif
1500 %if %{sqlite}
1501 %preun sqlite
1502 %endif
1503 %if %{postgresql}
1504 %preun postgresql
1505 %endif
1506
1507 %if ! %{client_only}
1508 # delete our links
1509 if [ $1 = 0 ]; then
1510 /sbin/chkconfig --del bacula-dir
1511 /sbin/chkconfig --del bacula-fd
1512 /sbin/chkconfig --del bacula-sd
1513 fi
1514 %endif
1515
1516
1517 %if ! %{client_only}
1518 %files mtx
1519 %defattr(-,root,root)
1520 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1521 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1522 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1523 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1524 %{_mandir}/man1/loaderinfo.1.%{manpage_ext}
1525 %{_mandir}/man1/mtx.1.%{manpage_ext}
1526 %{_mandir}/man1/scsitape.1.%{manpage_ext}
1527 %{_mandir}/man1/tapeinfo.1.%{manpage_ext}
1528 %endif
1529
1530
1531 %files client
1532 %defattr(-,root,root)
1533 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1534 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1535 /etc/bacula/bacula-ctl-fd
1536 /etc/init.d/bacula-fd
1537 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1538
1539 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo 
1540 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1541
1542 /etc/logrotate.d/bacula
1543
1544 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1545 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1546
1547 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1548
1549 /usr/sbin/bacula-fd
1550 /usr/sbin/btraceback
1551 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1552 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1553 /usr/sbin/bconsole
1554 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1555 %{_mandir}/man8/bacula.8.%{manpage_ext}
1556 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1557 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1558
1559
1560 %pre client
1561 # create the daemon group and user
1562 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1563 if [ -z "$HAVE_BACULA" ]; then
1564         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1565         echo "The group %{daemon_group} has been added to %{group_file}."
1566         echo "See the manual chapter \"Running Bacula\" for details."
1567 fi
1568 # we do not use the -g option allowing the primary group to be set to system default
1569 # this will be a unique group on redhat type systems or the group users on some systems
1570 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1571 if [ -z "$HAVE_BACULA" ]; then
1572         %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1573         echo "The user %{file_daemon_user} has been added to %{user_file}."
1574         echo "See the manual chapter \"Running Bacula\" for details."
1575 fi
1576 # now we add the supplementary group, this is ok to call even if the user already exists
1577 # we only do this if the user is NOT root
1578 IS_ROOT=%{file_daemon_user}
1579 if [ "$IS_ROOT" != "root" ]; then
1580 %{usermod} -G %{daemon_group} %{file_daemon_user}
1581 fi
1582
1583 %post client
1584 # add our link
1585 if [ "$1" -ge 1 ] ; then
1586 /sbin/chkconfig --add bacula-fd
1587 fi
1588
1589 # generate passwords if needed
1590 if [ -d /etc/bacula ]; then
1591         cd /etc/bacula
1592         for file in *.conf; do
1593                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1594                         need_password=`grep $string $file 2>/dev/null`
1595                         if [ -n "$need_password" ]; then
1596                                 pass=`openssl rand -base64 33`
1597                                 sed "s-$string-$pass-g" $file > $file.new
1598                                 cp -f $file.new $file; rm -f $file.new
1599                         fi
1600                 done
1601         done
1602 fi
1603
1604 %preun client
1605 # delete our link
1606 if [ $1 = 0 ]; then
1607 /sbin/chkconfig --del bacula-fd
1608 fi
1609
1610 %if ! %{client_only}
1611 %files updatedb
1612 %defattr(-,root,%{daemon_group})
1613 /etc/bacula/updatedb/*
1614
1615 %pre updatedb
1616 # create the daemon group
1617 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1618 if [ -z "$HAVE_BACULA" ]; then
1619         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1620         echo "The group %{daemon_group} has been added to %{group_file}."
1621         echo "See the manual chapter \"Running Bacula\" for details."
1622 fi
1623
1624 %post updatedb
1625 echo "The database update scripts were installed to /etc/bacula/updatedb"
1626 %endif
1627
1628 %if %{gconsole}
1629 %files gconsole
1630 %defattr(-,root,root)
1631 /usr/sbin/gnome-console
1632 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1633 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1634 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1635 /usr/share/pixmaps/bacula.png
1636 /usr/share/applications/bacula.desktop
1637 %{_mandir}/man1/bacula-console-gnome.1.%{manpage_ext}
1638 %endif
1639
1640 %if %{gconsole} && ! %{rh8}
1641 /usr/sbin/bacula-tray-monitor
1642 %config(noreplace) /etc/bacula/tray-monitor.conf
1643 /usr/share/pixmaps/bacula-tray-monitor.xpm
1644 /usr/share/applications/bacula-tray-monitor.desktop
1645 %{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
1646 %endif
1647
1648 %if %{gconsole} && ! %{su9} && ! %{su10}
1649 # add the console helper files
1650 %config(noreplace,missingok) /etc/pam.d/gnome-console
1651 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1652 /usr/bin/gnome-console
1653 %endif
1654
1655 %if %{gconsole}
1656 %pre gconsole
1657 # create the daemon group
1658 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1659 if [ -z "$HAVE_BACULA" ]; then
1660         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1661         echo "The group %{daemon_group} has been added to %{group_file}."
1662         echo "See the manual chapter \"Running Bacula\" for details."
1663 fi
1664
1665 %post gconsole
1666 # generate passwords if needed
1667 if [ -d /etc/bacula ]; then
1668         cd /etc/bacula
1669         for file in *.conf; do
1670                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1671                         need_password=`grep $string $file 2>/dev/null`
1672                         if [ -n "$need_password" ]; then
1673                                 pass=`openssl rand -base64 33`
1674                                 sed "s-$string-$pass-g" $file > $file.new
1675                                 cp -f $file.new $file; rm -f $file.new
1676                         fi
1677                 done
1678         done
1679 fi
1680 %endif
1681
1682 %if %{wxconsole}
1683 %files wxconsole
1684 %defattr(-,root,root)
1685 /usr/sbin/wxconsole
1686 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1687 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1688 /usr/share/pixmaps/wxwin16x16.xpm
1689 /usr/share/applications/wxconsole.desktop
1690 %{_mandir}/man1/bacula-wxconsole.1.%{manpage_ext}
1691 %endif
1692
1693 %if %{wxconsole} && ! %{su9} && ! %{su10}
1694 # add the console helper files
1695 %config(noreplace,missingok) /etc/pam.d/wxconsole
1696 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1697 /usr/bin/wxconsole
1698 %endif
1699
1700 %if %{wxconsole}
1701 %pre wxconsole
1702 # create the daemon group
1703 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1704 if [ -z "$HAVE_BACULA" ]; then
1705         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1706         echo "The group %{daemon_group} has been added to %{group_file}."
1707         echo "See the manual chapter \"Running Bacula\" for details."
1708 fi
1709
1710 %post wxconsole
1711 # generate passwords if needed
1712 if [ -d /etc/bacula ]; then
1713         cd /etc/bacula
1714         for file in *.conf; do
1715                 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1716                         need_password=`grep $string $file 2>/dev/null`
1717                         if [ -n "$need_password" ]; then
1718                                 pass=`openssl rand -base64 33`
1719                                 sed "s-$string-$pass-g" $file > $file.new
1720                                 cp -f $file.new $file; rm -f $file.new
1721                         fi
1722                 done
1723         done
1724 fi
1725 %endif
1726
1727 %changelog
1728 * Sun Jan 14 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
1729 - 2.0.1 release
1730 - change determination of gcc version per patch from Marc Hennes
1731 - move BuildRequire for atk-devel to gnome only builds
1732 - add fc6 build tag
1733 * Sat Jan 06 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
1734 - 2.0.0 release
1735 * Sun Oct 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1736 - 1.39.26 remove create_sqlite_database.in.patch
1737 * Sun Sep 24 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1738 - change ownership of working_dir on server packages to bacula.bacula so that
1739 - bacula-sd can create bootstrap files
1740 * Sat Sep 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1741 - 1.39.22 remove separate cd and make of manpages the main Makefile does it now
1742 * Sun Aug 06 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1743 - fix manpages file extension for mdk
1744 * Sat Aug 05 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1745 - bug 648 re-enable and update sqlite patches
1746 - 1.39.18 changes
1747 - updatedb 9 to 10
1748 - install man pages
1749 - lock out gconsole build for gtk+ < 2.4
1750 * Mon Jul 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1751 - move pango-devel BuildRequires into gconsole only build
1752 * Sat Jul 15 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1753 - add provides and conflicts for standard suse packages
1754 - add third party packager tag support
1755 - add build_client_only tag
1756 - remove bsmtp from client package
1757 - add bacula-ctl-fd to client package
1758 * Thu Jul 13 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1759 - fix directory creation when wxconsole and not gconsole
1760 * Tue Jul 04 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1761 - add check to buildrequires to make sure libstdc++ version matches gcc
1762 * Mon Jul 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1763 - add python build support
1764 - fix LDFLAGS declarations
1765 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1766 - add requires for standard compiler toolchain
1767 - move version and release tags up
1768 - move patches up
1769 - add docs_version tag
1770 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1771 - update rescuever to 1.8.6
1772 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1773 - update depkgs to 25Jun06
1774 - add mysql5 build tag
1775 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1776 - 1.38.10 bump rescue version
1777 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1778 - fix usermod statements
1779 - add fc5 target
1780 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1781 - add -g param back to useradd statements Bug 605
1782 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1783 - redundant code cleanup
1784 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1785 - add wxconsole package
1786 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1787 - 1.38.8 release
1788 - dependency update for Mandriva
1789 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1790 - 1.38.7 release
1791 - remove -n option from useradd scripts
1792 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1793 - 1.38.6 release
1794 - fix problem specifying more than one primary group for user bacula
1795 - add build switch to not build gconsole regardless of platform
1796 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1797 - add centos3 build tag
1798 - fix link error of static-fd on Mandrake with --disable-nls
1799 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1800 - add fc4 dependencies
1801 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1802 - add SuSE 10.0 build
1803 - remove specific permission in attrib macros
1804 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1805 - 1.38.5 release
1806 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1807 - refix compat for _dist on SLES9 which seems to have been removed
1808 - added note regarding Aleksandar's use of specific permissions in attrib macros
1809 - need to review and add specific fc4 build currently using fc3 Requires
1810 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1811 - 1.38.2 release
1812 - Reorganize files and pre/post sections to remove repetitions
1813 - Always build separate mtx package
1814 - Fix file ownerships for /etc/bacula and Bacula's working dir
1815 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1816 - Disable GNOME on RH7
1817 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1818 - Red Hat and look alikes have mtx RPM, do not build/package our version
1819 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1820 - minor edit to _dist for SLES9 compatibility
1821 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1822 - 1.38.0 release
1823 - kern changed location of pdf files and html manual in docs package
1824 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1825 - 1.38.0 release
1826 - add docs (from prebuilt tarball) and rescue packages back in
1827 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1828 - remove 3 of 4 sqlite script patches as not needed
1829 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1830 - changes for 1.38
1831 - remove docs and rescue sections (remove static fd)
1832 - add dvd-freespace and dvd-writepart files
1833 - update depkgs to 22Jun05
1834 - change database update to 8 to 9
1835 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1836 - minor cleanups before 1.38 changes
1837 - add popt and popt-devel build dependencies
1838 - add tetex and tetex-dvips dependencies for doc build
1839 - replace deprecated Copyright tag with License
1840 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1841 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1842 - conflict with sqlite packages. remove readline dependency.
1843 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1844 - release 1.36.3 update docs
1845 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1846 - add centos4 build tag
1847 - add x86_64 build tag
1848 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1849 - add rhel4 build tag
1850 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1851 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1852 - add rhel3 build tag
1853 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1854 - fix tray-monitor.conf for noreplace
1855 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1856 - fix distribution check for Fedora and Whitebox
1857 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1858 - add logwatch script
1859 - add dvd scripts
1860 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1861 - add build for Fedora Core 3 (linc now included in ORDit2)
1862 - add mysql4 define for Mandrake 10.1
1863 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1864 - fix {group_file} variable in post scripts
1865 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1866 - add distribution checking and custom Distribution tag
1867 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1868 - ASSIGNMENT OF COPYRIGHT
1869 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
1870 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
1871 - all right, title and interest in and to the copyright in this software RPM
1872 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
1873 - free of all liens, encumbrances or any known claims against said copyright.
1874 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1875 - bug 183 fixes
1876 - thanks to Daniel Widyono
1877 - update description for rescue package to describe cdrom creation
1878 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1879 - update depkgs to 29Oct04
1880 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1881 - add cdrom rescue to bacula-rescue package
1882 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1883 - misc fixes from 1.36.0 suse feedback
1884 - fix situation where sqlite database exists but sqlite has been removed.
1885 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1886 - remove tray-monitor from RH8 build
1887 - fix permissions on tray-monitor files
1888 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1889 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1890 - change database update to 7 to 8 upgrade,
1891 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1892 - build in 30Jul04, add freetype dependancy to gnome package.
1893 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1894 - add documentation to console for groupadd
1895 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1896 - add support for running daemons as root.bacula
1897 - correct for change in location of floppy rescue files in 1.35.2
1898 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1899 - updated depgkgs to 30Jul04
1900 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1901 - really, really fix symlink creation for gconsole
1902 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1903 - fix symlink creation in gconsole post install
1904 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1905 - fixed error in gconsole post script
1906 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1907 - add check for gconsole symlink before trying to create it
1908 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1909 - fix some minor permissions issues on doc files that CVS won't let us fix
1910 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1911 - add pkgconfig to BuildRequires
1912 - clean up gnome1/2 menu entries for appropriate packages
1913 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1914 - tightened up doc distribution
1915 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1916 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1917 - rpm's horrible bug that prevents nested conditional macros prevents me
1918 - from implementing these 2 separate approaches within the conditionals which
1919 - create the separate server packages.
1920 - the solution adopted is to remove the gnome-console files from the server packages
1921 - so bacula-gconsole is now an add on for both client and server packages.
1922 - this also now allows the server packages to be install on machines without
1923 - an X-server and we can still maintain a single spec file.
1924 - added tests to make sure we have defined platform and database macros.
1925 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1926 - corrected mysql prerequisites for suse
1927 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1928 - replaced all cp commands with cp -p
1929 - removed addition of a+x permissions on gnome-console
1930 - corrected permissions on init scripts
1931 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1932 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1933 -
1934 - various cleanup patches from Michael K. Johnson:
1935 - corrected post install routines for nicer chkconfig
1936 - removed chmod changes in post routines and moved to install section
1937 - removed interactive nature of post routine for rescue package
1938 - added description of building rescue disks to the description of rescue package
1939 - added clean of build root to beginning of install
1940 - removed specifying attr in all file lists
1941 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1942 - added bconsole to client package
1943 - added gconsole package as add-on to client
1944 - removed spurious dependancies on updatedb package (!cut/paste)
1945 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1946 - added updatedb package
1947 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1948 - added postgresql package
1949 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1950 - corrected the if else logic in the dependancy sections
1951 - changes for 1.34 release
1952 - /etc/bacula/console is now /etc/bacula/bconsole
1953 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1954 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1955 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1956 - added new /etc/bacula/drop_mysql_database
1957 - added new /etc/bacula/drop_sqlite_database
1958 - added new /etc/bacula/grant_sqlite_privileges
1959 - added new generic bacula database scripts in /etc/bacula
1960 - added pre-install sections to check for database versions older than 6
1961 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1962 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1963 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1964 - added testing for existing databases before executing any of the database creation scripts
1965 - added defines working_dir and sqlite_bindir in place of hard coded paths
1966 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1967 - added build configuration for SuSE.
1968 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1969 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1970 - added patch for create_sqlite_database to fix the installed bindir
1971 - added execute of create_sqlite_database to post of sqlite package
1972 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1973 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1974 - added bacula-fd as Requires for rescue package
1975 - added build tag for Fedora Core 1
1976 - cleaned up dependancies for all builds
1977 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1978 - removed rh_version from package names
1979 - added platform build configuration section to beginning of file
1980 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1981 - removed make_static_bacula script from rescue package install
1982 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1983 - Added define at top of file for depkgs version
1984 - Added rescue sub-package
1985 - Moved requires statements into proper sub-package locations
1986 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1987 - Corrected Requires for Gnome 1.4/2.0 builds
1988 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1989 - Added separate source declaration for depkgs
1990 - added patch for make_catalog_backup script
1991 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1992 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1993 - Added rh_version to sub-package names
1994 - Added installed but missing file /etc/bacula/gconsole
1995 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1996 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1997 - Update spec for version 1.31 and combine client
1998 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1999 - Initial spec file