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