2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define depkgs ../depkgs
8 %define depkgs_version 28Mar06
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 usermod /usr/sbin/usermod
22 %define _rescuever 1.8.3
24 # platform defines - set one below or define the build_xxx on the command line
27 %{?build_rh7:%define rh7 1}
29 %{?build_rh8:%define rh8 1}
31 %{?build_rh9:%define rh9 1}
34 %{?build_fc1:%define fc1 1}
36 %{?build_fc3:%define fc3 1}
38 %{?build_fc4:%define fc4 1}
39 # Whitebox Enterprise build
41 %{?build_wb3:%define wb3 1}
42 # RedHat Enterprise builds
44 %{?build_rhel3:%define rhel3 1}
45 %{?build_rhel3:%define wb3 1}
47 %{?build_rhel4:%define rhel4 1}
48 %{?build_rhel4:%define fc3 1}
51 %{?build_centos3:%define centos3 1}
52 %{?build_centos3:%define wb3 1}
54 %{?build_centos4:%define centos4 1}
55 %{?build_centos4:%define fc3 1}
58 %{?build_su9:%define su9 1}
60 %{?build_su10:%define su10 1}
63 %{?build_mdk:%define mdk 1}
65 %{?build_mdv:%define mdv 1}
66 %{?build_mdv:%define mdk 1}
68 # test for a platform definition
69 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
70 %{error: You must specify a platform. Please examine the spec file.}
75 # set for database support desired or define the build_xxx on the command line
77 %{?build_mysql:%define mysql 1}
78 # if using mysql 4.x define this and mysql above
79 # currently: Mandrake 10.1, SuSE 9.2, RHEL4 and Fedora Core 4
81 %{?build_mysql4:%define mysql4 1}
82 %{?build_mysql4:%define mysql 1}
84 %{?build_sqlite:%define sqlite 1}
86 %{?build_postgresql:%define postgresql 1}
88 # test for a database definition
89 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
90 %{error: You must specify database support. Please examine the spec file.}
95 %define db_backend mysql
98 %define db_backend sqlite
101 %define db_backend postgresql
106 %{?build_x86_64:%define x86_64 1}
108 # check what distribution we are
109 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
110 %define _dist %(grep Red /etc/redhat-release)
113 %define _dist %(grep Fedora /etc/redhat-release)
115 %if %{centos4} || %{centos3}
116 %define _dist %(grep CentOS /etc/redhat-release)
118 %if %{fc3} && ! %{rhel4} && ! %{centos4}
119 %define _dist %(grep Fedora /etc/redhat-release)
121 %if %{wb3} && ! %{rhel3} && ! %{centos3}
122 %define _dist %(grep White /etc/whitebox-release)
124 %if %{su9} || %{su10}
125 %define _dist %(grep -i SuSE /etc/SuSE-release)
128 %define _dist %(grep Mand /etc/mandrake-release)
131 # Should we build gconsole, possible only if gnome >= 2.0 available
137 # specifically disallow gconsole if desired
138 %{?nobuild_gconsole:%define gconsole 0}
140 Summary: Bacula - The Network Backup Solution
144 Group: System Environment/Daemons
146 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
147 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
148 Source2: Release_Notes-%{version}-%{release}.tar.gz
149 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
150 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
151 BuildRoot: %{_tmppath}/%{name}-root
152 URL: http://www.bacula.org/
153 Vendor: The Bacula Team
154 Distribution: %{_dist}
155 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
157 %define _docsrc ../%{name}-docs-%{version}
158 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
160 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
161 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
162 BuildRequires: openssl-devel
164 BuildRequires: pkgconfig
167 BuildRequires: libtermcap-devel
168 BuildRequires: glibc-devel >= 2.2
171 BuildRequires: termcap
172 BuildRequires: glibc-devel >= 2.3
174 %if %{su9} && %{gconsole}
175 BuildRequires: libgnome >= 2.0
176 BuildRequires: gtk2-devel >= 2.0
177 BuildRequires: libgnomeui-devel >= 2.0
178 BuildRequires: ORBit2-devel
179 BuildRequires: libart_lgpl-devel >= 2.0
180 BuildRequires: libbonobo-devel >= 2.0
181 BuildRequires: libbonoboui-devel >= 2.0
182 BuildRequires: bonobo-activation-devel
183 BuildRequires: gconf2-devel
184 BuildRequires: linc-devel
185 BuildRequires: freetype2-devel
188 BuildRequires: termcap
189 BuildRequires: glibc-devel >= 2.3
191 %if %{su10} && %{gconsole}
192 BuildRequires: libgnome >= 2.12
193 BuildRequires: gtk2-devel >= 2.8
194 BuildRequires: libgnomeui-devel >= 2.12
195 BuildRequires: ORBit2-devel
196 BuildRequires: libart_lgpl-devel >= 2.3
197 BuildRequires: libbonobo-devel >= 2.10
198 BuildRequires: libbonoboui-devel >= 2.10
199 BuildRequires: bonobo-activation-devel
200 BuildRequires: gconf2-devel
201 BuildRequires: freetype2-devel
202 BuildRequires: cairo-devel
203 BuildRequires: fontconfig-devel >= 2.3
204 BuildRequires: gnome-vfs2-devel >= 2.12
205 BuildRequires: libpng-devel
208 BuildRequires: libtermcap-devel
209 BuildRequires: libstdc++-static-devel
210 BuildRequires: glibc-static-devel
211 BuildRequires: glibc-devel >= 2.3
213 %if %{mdk} && !%{mdv} && %{gconsole}
214 BuildRequires: gtk2-devel >= 2.0
215 BuildRequires: libgnomeui2-devel >= 2.0
216 BuildRequires: libORBit2-devel
217 BuildRequires: libart_lgpl-devel >= 2.0
218 BuildRequires: libbonobo2_0-devel
219 BuildRequires: libbonoboui2_0-devel
220 BuildRequires: libbonobo-activation-devel
221 BuildRequires: libGConf2-devel
222 BuildRequires: freetype2-devel
224 %if %{mdv} && %{gconsole}
225 BuildRequires: gtk2-devel >= 2.8
226 BuildRequires: libgnomeui2-devel >= 2.10
227 BuildRequires: libORBit2-devel
228 BuildRequires: libart_lgpl-devel >= 2.3
229 BuildRequires: libbonobo2_0-devel
230 BuildRequires: libbonoboui2_0-devel
231 BuildRequires: libbonobo-activation-devel
232 BuildRequires: libGConf2-devel
233 BuildRequires: freetype2-devel
236 BuildRequires: libtermcap-devel
237 BuildRequires: glibc-devel >= 2.3
239 %if %{fc3} && %{gconsole}
240 BuildRequires: gtk2-devel >= 2.4
241 BuildRequires: libgnomeui-devel >= 2.8
242 BuildRequires: ORBit2-devel
243 BuildRequires: libart_lgpl-devel >= 2.3
244 BuildRequires: libbonobo-devel >= 2.8
245 BuildRequires: libbonoboui-devel >= 2.8
246 BuildRequires: bonobo-activation-devel
247 BuildRequires: GConf2-devel
248 BuildRequires: freetype-devel
251 BuildRequires: libtermcap-devel
252 BuildRequires: glibc-devel >= 2.3
254 %if %{fc4} && %{gconsole}
255 BuildRequires: gtk2-devel >= 2.6
256 BuildRequires: libgnomeui-devel >= 2.10
257 BuildRequires: ORBit2-devel
258 BuildRequires: libart_lgpl-devel >= 2.3
259 BuildRequires: libbonobo-devel >= 2.8
260 BuildRequires: libbonoboui-devel >= 2.8
261 BuildRequires: bonobo-activation-devel
262 BuildRequires: GConf2-devel
263 BuildRequires: freetype-devel
265 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
266 BuildRequires: libtermcap-devel
267 BuildRequires: glibc-devel >= 2.3
269 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole}
270 BuildRequires: gtk2-devel >= 2.0
271 BuildRequires: libgnomeui-devel >= 2.0
272 BuildRequires: ORBit2-devel
273 BuildRequires: libart_lgpl-devel >= 2.0
274 BuildRequires: libbonobo-devel >= 2.0
275 BuildRequires: libbonoboui-devel >= 2.0
276 BuildRequires: bonobo-activation-devel
277 BuildRequires: GConf2-devel
278 BuildRequires: linc-devel
279 BuildRequires: freetype-devel
282 %if %{mysql} && ! %{mysql4}
283 BuildRequires: mysql-devel >= 3.23
286 %if %{mysql} && %{mysql4}
287 BuildRequires: mysql-devel >= 4.0
290 %if %{postgresql} && %{wb3}
291 BuildRequires: rh-postgresql-devel >= 7
294 %if %{postgresql} && ! %{wb3}
295 BuildRequires: postgresql-devel >= 7
299 Bacula - It comes by night and sucks the vital essence from your computers.
301 Bacula is a set of computer programs that permit you (or the system
302 administrator) to manage backup, recovery, and verification of computer
303 data across a network of computers of different kinds. In technical terms,
304 it is a network client/server based backup program. Bacula is relatively
305 easy to use and efficient, while offering many advanced storage management
306 features that make it easy to find and recover lost or damaged files.
307 Bacula source code has been released under the GPL version 2 license.
319 Summary: Bacula - The Network Backup Solution
320 Group: System Environment/Daemons
321 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
322 Conflicts: bacula-client
323 Obsoletes: bacula-rescue
324 Requires: ncurses, libstdc++, zlib, openssl, mtx
327 Requires: glibc >= 2.2
330 %if %{su9} || %{su10}
331 Requires: glibc >= 2.3
334 %if ! %{rh7} && ! %{su9} && ! %{su10}
335 Requires: glibc >= 2.3
339 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
340 Requires: mysql >= 3.23
341 Requires: mysql-server >= 3.23
343 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
344 Requires: mysql >= 4.0
345 Requires: mysql-server >= 4.0
348 %if %{mysql} && %{su9} && ! %{mysql4}
349 Requires: mysql >= 3.23
350 Requires: mysql-client >= 3.23
352 %if %{mysql} && %{su9} && %{mysql4}
353 Requires: mysql >= 4.0
354 Requires: mysql-client >= 4.0
356 %if %{mysql} && %{su10} && %{mysql4}
357 Requires: mysql >= 4.0
358 Requires: mysql-client >= 4.0
361 %if %{mysql} && %{mdk} && ! %{mysql4}
362 Requires: mysql >= 3.23
363 Requires: mysql-client >= 3.23
365 %if %{mysql} && %{mdk} && %{mysql4}
366 Requires: mysql >= 4.0
367 Requires: mysql-client >= 4.0
370 %if %{postgresql} && %{wb3}
371 Requires: rh-postgresql >= 7
372 Requires: rh-postgresql-server >= 7
374 %if %{postgresql} && ! %{wb3}
375 Requires: postgresql >= 7
376 Requires: postgresql-server >= 7
386 %description postgresql
389 Bacula - It comes by night and sucks the vital essence from your computers.
391 Bacula is a set of computer programs that permit you (or the system
392 administrator) to manage backup, recovery, and verification of computer
393 data across a network of computers of different kinds. In technical terms,
394 it is a network client/server based backup program. Bacula is relatively
395 easy to use and efficient, while offering many advanced storage management
396 features that make it easy to find and recover lost or damaged files.
397 Bacula source code has been released under the GPL version 2 license.
400 This build requires MySQL to be installed separately as the catalog database.
403 This build requires PostgreSQL to be installed separately as the catalog database.
406 This build incorporates sqlite as the catalog database, statically compiled.
410 Summary: Bacula - The Network Backup Solution
411 Group: System Environment/Daemons
415 This is Bacula's version of mtx tape utilities for Linux distributions that
416 do not provide their own mtx package
419 Summary: Bacula - The Network Backup Solution
420 Group: System Environment/Daemons
422 Conflicts: bacula-mysql
423 Conflicts: bacula-sqlite
424 Conflicts: bacula-postgresql
425 Obsoletes: bacula-rescue
426 Requires: libstdc++, zlib, openssl
429 Requires: glibc >= 2.2
432 %if %{su9} || %{su10}
433 Requires: glibc >= 2.3
436 %if ! %{rh7} && ! %{su9} && ! %{su10}
437 Requires: glibc >= 2.3
442 Bacula - It comes by night and sucks the vital essence from your computers.
444 Bacula is a set of computer programs that permit you (or the system
445 administrator) to manage backup, recovery, and verification of computer
446 data across a network of computers of different kinds. In technical terms,
447 it is a network client/server based backup program. Bacula is relatively
448 easy to use and efficient, while offering many advanced storage management
449 features that make it easy to find and recover lost or damaged files.
450 Bacula source code has been released under the GPL version 2 license.
452 This is the File daemon (Client) only package. It includes the command line
457 Summary: Bacula - The Network Backup Solution
458 Group: System Environment/Daemons
460 %description updatedb
461 Bacula - It comes by night and sucks the vital essence from your computers.
463 Bacula is a set of computer programs that permit you (or the system
464 administrator) to manage backup, recovery, and verification of computer
465 data across a network of computers of different kinds. In technical terms,
466 it is a network client/server based backup program. Bacula is relatively
467 easy to use and efficient, while offering many advanced storage management
468 features that make it easy to find and recover lost or damaged files.
469 Bacula source code has been released under the GPL version 2 license.
471 This package installs scripts for updating older versions of the bacula
476 Summary: Bacula - The Network Backup Solution
477 Group: System Environment/Daemons
478 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
481 %if %{gconsole} && %{su9}
482 Requires: gtk2 >= 2.0
483 Requires: libgnome >= 2.0
484 Requires: libgnomeui >= 2.0
485 Requires: glibc >= 2.3
487 Requires: libart_lgpl >= 2.0
488 Requires: libbonobo >= 2.0
489 Requires: libbonoboui >= 2.0
490 Requires: bonobo-activation
495 %if %{gconsole} && %{su10}
496 Requires: gtk2 >= 2.8
497 Requires: libgnome >= 2.12
498 Requires: libgnomeui >= 2.12
499 Requires: glibc >= 2.3
501 Requires: libart_lgpl >= 2.3
502 Requires: libbonobo >= 2.10
503 Requires: libbonoboui >= 2.10
504 Requires: bonobo-activation
508 Requires: fontconfig >= 2.3
509 Requires: gnome-vfs2 >= 2.12
512 %if %{gconsole} && %{mdk} && !%{mdv}
513 Requires: gtk2 >= 2.0
514 Requires: libgnomeui2
515 Requires: glibc >= 2.3
517 Requires: libart_lgpl >= 2.0
518 Requires: libbonobo >= 2.0
519 Requires: libbonoboui >= 2.0
523 %if %{gconsole} && %{mdv}
524 Requires: gtk2 >= 2.8
525 Requires: libgnomeui2
526 Requires: glibc >= 2.3
528 Requires: libart_lgpl >= 2.3
529 Requires: libbonobo >= 2.10
530 Requires: libbonoboui >= 2.10
534 %if %{gconsole} && %{fc3}
535 Requires: gtk2 >= 2.4
536 Requires: libgnomeui >= 2.8
537 Requires: glibc >= 2.3
539 Requires: libart_lgpl >= 2.3
540 Requires: libbonobo >= 2.8
541 Requires: libbonoboui >= 2.8
542 Requires: bonobo-activation
546 %if %{gconsole} && %{fc4}
547 Requires: gtk2 >= 2.6
548 Requires: libgnomeui >= 2.10
549 Requires: glibc >= 2.3
551 Requires: libart_lgpl >= 2.3
552 Requires: libbonobo >= 2.8
553 Requires: libbonoboui >= 2.8
554 Requires: bonobo-activation
558 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
559 Requires: gtk2 >= 2.0
560 Requires: libgnomeui >= 2.0
561 Requires: glibc >= 2.3
563 Requires: libart_lgpl >= 2.0
564 Requires: libbonobo >= 2.0
565 Requires: libbonoboui >= 2.0
566 Requires: bonobo-activation
571 %if %{gconsole} && %{su9}
574 %if %{gconsole} && %{su10}
577 %if %{gconsole} && ! %{su9} && ! %{su10}
582 %description gconsole
583 Bacula - It comes by night and sucks the vital essence from your computers.
585 Bacula is a set of computer programs that permit you (or the system
586 administrator) to manage backup, recovery, and verification of computer
587 data across a network of computers of different kinds. In technical terms,
588 it is a network client/server based backup program. Bacula is relatively
589 easy to use and efficient, while offering many advanced storage management
590 features that make it easy to find and recover lost or damaged files.
591 Bacula source code has been released under the GPL version 2 license.
593 This is the Gnome Console package. It is an add-on to the client or
607 %if %{su9} || %{su10}
608 export LDFLAGS="-L/usr/lib/termcap"
619 # patches for the bundled sqlite scripts
620 # as of 1.38.0 first 3 patches no longer needed
622 # patch the make_sqlite_tables script for installation bindir
623 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
625 # patch the create_sqlite_database script for installation bindir
626 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
628 # patch the make_catalog_backup script for installation bindir
629 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
631 # patch the update_sqlite_tables script for installation bindir
632 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
634 # patch the bacula-dir init script to remove sqlite service
635 %if %{sqlite} && %{su9}
636 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
638 %if %{sqlite} && %{su10}
639 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
642 # 64 bit lib location hacks
643 # this is the location on redhat type platforms, don't know about others yet
645 export LDFLAGS=-L/usr/lib64
647 %if %{mysql} && %{x86_64}
648 export LDFLAGS=-L/usr/lib64/mysql
653 --sbindir=/usr/sbin \
654 --sysconfdir=/etc/bacula \
655 --with-scriptdir=/etc/bacula \
656 --enable-smartalloc \
657 --enable-client-only \
667 --sbindir=/usr/sbin \
668 --sysconfdir=/etc/bacula \
669 --with-scriptdir=/etc/bacula \
670 --enable-smartalloc \
674 %if %{gconsole} && ! %{rh8}
675 --enable-tray-monitor \
681 --with-sqlite=${cwd}/%{depkgs}/sqlite \
686 --with-working-dir=%{working_dir} \
687 --with-pid-dir=/var/run \
688 --with-subsys-dir=/var/lock/subsys \
689 --with-dir-user=%{director_daemon_user} \
690 --with-dir-group=%{daemon_group} \
691 --with-sd-user=%{storage_daemon_user} \
692 --with-sd-group=%{storage_daemon_group} \
693 --with-fd-user=%{file_daemon_user} \
694 --with-fd-group=%{daemon_group} \
695 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
696 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
697 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
698 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
699 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
700 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
708 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
709 mkdir -p $RPM_BUILD_ROOT/etc/init.d
710 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
711 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
712 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
713 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
714 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
716 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
718 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
719 %if %{gconsole} && ! %{su9} && ! %{su10}
720 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
721 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
722 mkdir -p $RPM_BUILD_ROOT/usr/bin
726 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
730 prefix=$RPM_BUILD_ROOT/usr \
731 sbindir=$RPM_BUILD_ROOT/usr/sbin \
732 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
733 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
734 working_dir=$RPM_BUILD_ROOT%{working_dir} \
739 prefix=$RPM_BUILD_ROOT/usr \
740 sbindir=$RPM_BUILD_ROOT/usr/sbin \
741 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
742 working_dir=$RPM_BUILD_ROOT%{working_dir} \
743 mandir=$RPM_BUILD_ROOT/usr/man \
747 # fixme - make installs the mysql scripts for sqlite build
749 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
750 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
751 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
754 # fixme - make installs the mysql scripts for postgresql build
756 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
757 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
760 # fixme - make installs gconsole script for build without gconsole
762 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
765 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
767 # install the init scripts
768 %if %{su9} || %{su10}
769 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
770 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
771 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
774 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
775 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
776 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
778 %if ! %{su9} && ! %{su10} && ! %{mdk}
779 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
780 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
781 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
783 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
785 # install the menu stuff
786 %if %{gconsole} && %{su9}
787 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
788 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
789 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
790 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
792 %if %{gconsole} && %{su10}
793 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
794 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
795 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
796 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
798 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
803 %if %{gconsole} && %{iftrick}
804 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
805 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
806 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
807 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
808 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
810 %if %{gconsole} && ! %{rh8}
811 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
812 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
817 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
818 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
819 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
822 # install the logrotate file
823 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
825 # install the updatedb scripts
826 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
828 # install the logwatch scripts
829 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
830 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
831 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
832 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
833 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
834 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
836 # install the rescue files
837 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
838 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
839 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
840 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
841 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
842 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
843 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
844 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
845 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
846 rm -f src/filed/static-bacula-fd
848 # now clean up permissions that are left broken by the install
849 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
850 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
851 %if %{gconsole} && ! %{rh8}
852 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
853 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
857 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
860 # MySQL specific files
862 %defattr(-, root, root)
863 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
864 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
865 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
866 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
867 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
868 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
869 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
870 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
875 %defattr(-,root,root)
876 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
877 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
878 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
879 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
880 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
881 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
882 %{sqlite_bindir}/libsqlite.a
883 %{sqlite_bindir}/sqlite.h
884 %{sqlite_bindir}/sqlite
889 %defattr(-,root,root)
890 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
891 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
892 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
893 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
894 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
895 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
898 # The rest is DB backend independent
899 %attr(-, root, %{daemon_group}) %dir /etc/bacula
900 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
901 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
902 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
903 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
904 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
905 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
906 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
907 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
908 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
909 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
910 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
911 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
912 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
913 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
914 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
915 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
916 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
917 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
918 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
919 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
920 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
921 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
923 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
924 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
926 /etc/logrotate.d/bacula
927 /etc/log.d/scripts/services/bacula
928 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
929 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
930 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
931 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
932 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
933 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
934 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
935 %attr(-, root, %{daemon_group}) %dir %{working_dir}
954 # test for bacula database older than version 8
955 # note: this ASSUMES no password has been set for bacula database
956 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
961 # test for bacula database older than version 8
962 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
963 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
968 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
971 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
972 echo "This bacula upgrade will update a bacula database from version 8 to 9."
973 echo "You appear to be running database version $DB_VER. You must first update"
974 echo "your database to version 8 and then install this upgrade. The alternative"
975 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
976 echo "catalog information, then do the upgrade. Information on updating a"
977 echo "database older than version 8 can be found in the release notes."
985 # check for and copy /etc/bacula/console.conf to bconsole.conf
986 if [ -s /etc/bacula/console.conf ];then
987 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
990 # create the daemon users and groups
991 # first create the groups if they don't exist
992 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
993 if [ -z "$HAVE_BACULA" ]; then
994 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
995 echo "The group %{daemon_group} has been added to %{group_file}."
996 echo "See the manual chapter \"Running Bacula\" for details."
998 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
999 if [ -z "$HAVE_BACULA" ]; then
1000 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1001 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1002 echo "See the manual chapter \"Running Bacula\" for details."
1004 # now create the users if they do not exist
1005 # we do not use the -g option allowing the primary group to be set to system default
1006 # this will be a unique group on redhat type systems or the group users on some systems
1007 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1008 if [ -z "$HAVE_BACULA" ]; then
1009 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1010 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1011 echo "See the manual chapter \"Running Bacula\" for details."
1013 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1014 if [ -z "$HAVE_BACULA" ]; then
1015 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1016 echo "The user %{director_daemon_user} has been added to %{user_file}."
1017 echo "See the manual chapter \"Running Bacula\" for details."
1019 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1020 if [ -z "$HAVE_BACULA" ]; then
1021 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1022 echo "The user %{file_daemon_user} has been added to %{user_file}."
1023 echo "See the manual chapter \"Running Bacula\" for details."
1025 # now we add the supplementary groups, this is ok to call even if the users already exist
1026 # we only do this if the user is NOT root
1027 IS_ROOT=%{director_daemon_user}
1028 if [ "$IS_ROOT" != "root" ]; then
1029 %{usermod} %{director_daemon_user} -G %{daemon_group}
1031 IS_ROOT=%{storage_daemon_user}
1032 if [ "$IS_ROOT" != "root" ]; then
1033 %{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group}
1035 IS_ROOT=%{file_daemon_user}
1036 if [ "$IS_ROOT" != "root" ]; then
1037 %{usermod} %{file_daemon_user} -G %{daemon_group}
1051 if [ "$1" -ge 1 ] ; then
1052 /sbin/chkconfig --add bacula-dir
1053 /sbin/chkconfig --add bacula-fd
1054 /sbin/chkconfig --add bacula-sd
1058 # test for an existing database
1059 # note: this ASSUMES no password has been set for bacula database
1060 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1062 # grant privileges and create tables if they do not exist
1063 if [ -z "$DB_VER" ]; then
1064 echo "Hmm, doesn't look like you have an existing database."
1065 echo "Granting privileges for MySQL user bacula..."
1066 /etc/bacula/grant_mysql_privileges
1067 echo "Creating MySQL bacula database..."
1068 /etc/bacula/create_mysql_database
1069 echo "Creating bacula tables..."
1070 /etc/bacula/make_mysql_tables
1072 # check to see if we need to upgrade a 1.36 or lower database
1073 elif [ "$DB_VER" -lt "9" ]; then
1074 echo "This release requires an upgrade to your bacula database."
1075 echo "Backing up your current database..."
1076 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1077 echo "Upgrading bacula database ..."
1078 /etc/bacula/update_mysql_tables
1079 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1085 # test for an existing database
1086 if [ -s %{working_dir}/bacula.db ]; then
1087 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1088 # check to see if we need to upgrade a 1.36 or lower database
1089 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1090 echo "This release requires an upgrade to your bacula database."
1091 echo "Backing up your current database..."
1092 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1093 echo "Upgrading bacula database ..."
1094 /etc/bacula/update_sqlite_tables
1095 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1098 # create the database and tables
1099 echo "Hmm, doesn't look like you have an existing database."
1100 echo "Creating SQLite database..."
1101 /etc/bacula/create_sqlite_database
1102 echo "Creating the SQLite tables..."
1103 /etc/bacula/make_sqlite_tables
1108 # test for an existing database
1109 # note: this ASSUMES no password has been set for bacula database
1110 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1112 # grant privileges and create tables if they do not exist
1113 if [ -z "$DB_VER" ]; then
1114 echo "Hmm, doesn't look like you have an existing database."
1115 echo "Creating PostgreSQL bacula database..."
1116 /etc/bacula/create_postgresql_database
1117 echo "Creating bacula tables..."
1118 /etc/bacula/make_postgresql_tables
1119 echo "Granting privileges for PostgreSQL user bacula..."
1120 /etc/bacula/grant_postgresql_privileges
1122 # check to see if we need to upgrade a 1.36 or lower database
1123 elif [ "$DB_VER" -lt "9" ]; then
1124 echo "This release requires an upgrade to your bacula database."
1125 echo "Backing up your current database..."
1126 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1127 echo "Upgrading bacula database ..."
1128 /etc/bacula/update_postgresql_tables
1129 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1134 # generate passwords if needed
1135 if [ -d /etc/bacula ]; then
1137 for file in *.conf; do
1138 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
1139 need_password=`grep $string $file 2>/dev/null`
1140 if [ -n "$need_password" ]; then
1141 pass=`openssl rand -base64 33`
1142 sed "s-$string-$pass-g" $file > $file.new
1143 cp -f $file.new $file; rm -f $file.new
1161 /sbin/chkconfig --del bacula-dir
1162 /sbin/chkconfig --del bacula-fd
1163 /sbin/chkconfig --del bacula-sd
1168 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1169 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1170 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1171 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1176 %defattr(-,root,root)
1177 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1178 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1179 /etc/init.d/bacula-fd
1180 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1182 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1183 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1185 /etc/logrotate.d/bacula
1187 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1188 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1189 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1192 /usr/sbin/btraceback
1193 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1194 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1200 # create the daemon group and user
1201 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1202 if [ -z "$HAVE_BACULA" ]; then
1203 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1204 echo "The group %{daemon_group} has been added to %{group_file}."
1205 echo "See the manual chapter \"Running Bacula\" for details."
1207 # we do not use the -g option allowing the primary group to be set to system default
1208 # this will be a unique group on redhat type systems or the group users on some systems
1209 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1210 if [ -z "$HAVE_BACULA" ]; then
1211 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1212 echo "The user %{file_daemon_user} has been added to %{user_file}."
1213 echo "See the manual chapter \"Running Bacula\" for details."
1215 # now we add the supplementary group, this is ok to call even if the user already exists
1216 # we only do this if the user is NOT root
1217 IS_ROOT=%{file_daemon_user}
1218 if [ "$IS_ROOT" != "root" ]; then
1219 %{usermod} %{file_daemon_user} -G %{daemon_group}
1224 if [ "$1" -ge 1 ] ; then
1225 /sbin/chkconfig --add bacula-fd
1228 # generate passwords if needed
1229 if [ -d /etc/bacula ]; then
1231 for file in *.conf; do
1232 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
1233 need_password=`grep $string $file 2>/dev/null`
1234 if [ -n "$need_password" ]; then
1235 pass=`openssl rand -base64 33`
1236 sed "s-$string-$pass-g" $file > $file.new
1237 cp -f $file.new $file; rm -f $file.new
1246 /sbin/chkconfig --del bacula-fd
1250 %defattr(-,root,%{daemon_group})
1251 /etc/bacula/updatedb/*
1254 # create the daemon group
1255 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1256 if [ -z "$HAVE_BACULA" ]; then
1257 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1258 echo "The group %{daemon_group} has been added to %{group_file}."
1259 echo "See the manual chapter \"Running Bacula\" for details."
1263 echo "The database update scripts were installed to /etc/bacula/updatedb"
1267 %defattr(-,root,root)
1268 /usr/sbin/gnome-console
1269 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1270 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1271 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1272 /usr/share/pixmaps/bacula.png
1276 /usr/share/applications/bacula.desktop
1279 %if %{gconsole} && ! %{rh8}
1280 /usr/sbin/bacula-tray-monitor
1281 %config(noreplace) /etc/bacula/tray-monitor.conf
1282 /usr/share/pixmaps/bacula-tray-monitor.xpm
1283 /usr/share/applications/bacula-tray-monitor.desktop
1286 %if %{gconsole} && ! %{su9} && ! %{su10}
1287 # add the console helper files
1288 %config(noreplace,missingok) /etc/pam.d/gnome-console
1289 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1290 /usr/bin/gnome-console
1295 # create the daemon group
1296 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1297 if [ -z "$HAVE_BACULA" ]; then
1298 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1299 echo "The group %{daemon_group} has been added to %{group_file}."
1300 echo "See the manual chapter \"Running Bacula\" for details."
1304 # generate passwords if needed
1305 if [ -d /etc/bacula ]; then
1307 for file in *.conf; do
1308 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
1309 need_password=`grep $string $file 2>/dev/null`
1310 if [ -n "$need_password" ]; then
1311 pass=`openssl rand -base64 33`
1312 sed "s-$string-$pass-g" $file > $file.new
1313 cp -f $file.new $file; rm -f $file.new
1321 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1323 - dependency update for Mandriva
1324 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1326 - remove -n option from useradd scripts
1327 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1329 - fix problem specifying more than one primary group for user bacula
1330 - add build switch to not build gconsole regardless of platform
1331 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1332 - add centos3 build tag
1333 - fix link error of static-fd on Mandrake with --disable-nls
1334 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1335 - add fc4 dependencies
1336 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1337 - add SuSE 10.0 build
1338 - remove specific permission in attrib macros
1339 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1341 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1342 - refix compat for _dist on SLES9 which seems to have been removed
1343 - added note regarding Aleksandar's use of specific permissions in attrib macros
1344 - need to review and add specific fc4 build currently using fc3 Requires
1345 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1347 - Reorganize files and pre/post sections to remove repetitions
1348 - Always build separate mtx package
1349 - Fix file ownerships for /etc/bacula and Bacula's working dir
1350 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1351 - Disable GNOME on RH7
1352 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1353 - Red Hat and look alikes have mtx RPM, do not build/package our version
1354 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1355 - minor edit to _dist for SLES9 compatibility
1356 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1358 - kern changed location of pdf files and html manual in docs package
1359 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1361 - add docs (from prebuilt tarball) and rescue packages back in
1362 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1363 - remove 3 of 4 sqlite script patches as not needed
1364 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1366 - remove docs and rescue sections (remove static fd)
1367 - add dvd-freespace and dvd-writepart files
1368 - update depkgs to 22Jun05
1369 - change database update to 8 to 9
1370 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1371 - minor cleanups before 1.38 changes
1372 - add popt and popt-devel build dependencies
1373 - add tetex and tetex-dvips dependencies for doc build
1374 - replace deprecated Copyright tag with License
1375 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1376 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1377 - conflict with sqlite packages. remove readline dependency.
1378 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1379 - release 1.36.3 update docs
1380 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1381 - add centos4 build tag
1382 - add x86_64 build tag
1383 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1384 - add rhel4 build tag
1385 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1386 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1387 - add rhel3 build tag
1388 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1389 - fix tray-monitor.conf for noreplace
1390 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1391 - fix distribution check for Fedora and Whitebox
1392 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1393 - add logwatch script
1395 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1396 - add build for Fedora Core 3 (linc now included in ORDit2)
1397 - add mysql4 define for Mandrake 10.1
1398 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1399 - fix {group_file} variable in post scripts
1400 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1401 - add distribution checking and custom Distribution tag
1402 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1403 - ASSIGNMENT OF COPYRIGHT
1404 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1405 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1406 - all right, title and interest in and to the copyright in this software RPM
1407 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1408 - free of all liens, encumbrances or any known claims against said copyright.
1409 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1411 - thanks to Daniel Widyono
1412 - update description for rescue package to describe cdrom creation
1413 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1414 - update depkgs to 29Oct04
1415 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1416 - add cdrom rescue to bacula-rescue package
1417 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1418 - misc fixes from 1.36.0 suse feedback
1419 - fix situation where sqlite database exists but sqlite has been removed.
1420 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1421 - remove tray-monitor from RH8 build
1422 - fix permissions on tray-monitor files
1423 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1424 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1425 - change database update to 7 to 8 upgrade,
1426 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1427 - build in 30Jul04, add freetype dependancy to gnome package.
1428 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1429 - add documentation to console for groupadd
1430 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1431 - add support for running daemons as root.bacula
1432 - correct for change in location of floppy rescue files in 1.35.2
1433 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1434 - updated depgkgs to 30Jul04
1435 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1436 - really, really fix symlink creation for gconsole
1437 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1438 - fix symlink creation in gconsole post install
1439 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1440 - fixed error in gconsole post script
1441 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1442 - add check for gconsole symlink before trying to create it
1443 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1444 - fix some minor permissions issues on doc files that CVS won't let us fix
1445 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1446 - add pkgconfig to BuildRequires
1447 - clean up gnome1/2 menu entries for appropriate packages
1448 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1449 - tightened up doc distribution
1450 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1451 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1452 - rpm's horrible bug that prevents nested conditional macros prevents me
1453 - from implementing these 2 separate approaches within the conditionals which
1454 - create the separate server packages.
1455 - the solution adopted is to remove the gnome-console files from the server packages
1456 - so bacula-gconsole is now an add on for both client and server packages.
1457 - this also now allows the server packages to be install on machines without
1458 - an X-server and we can still maintain a single spec file.
1459 - added tests to make sure we have defined platform and database macros.
1460 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1461 - corrected mysql prerequisites for suse
1462 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1463 - replaced all cp commands with cp -p
1464 - removed addition of a+x permissions on gnome-console
1465 - corrected permissions on init scripts
1466 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1467 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1469 - various cleanup patches from Michael K. Johnson:
1470 - corrected post install routines for nicer chkconfig
1471 - removed chmod changes in post routines and moved to install section
1472 - removed interactive nature of post routine for rescue package
1473 - added description of building rescue disks to the description of rescue package
1474 - added clean of build root to beginning of install
1475 - removed specifying attr in all file lists
1476 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1477 - added bconsole to client package
1478 - added gconsole package as add-on to client
1479 - removed spurious dependancies on updatedb package (!cut/paste)
1480 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1481 - added updatedb package
1482 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1483 - added postgresql package
1484 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1485 - corrected the if else logic in the dependancy sections
1486 - changes for 1.34 release
1487 - /etc/bacula/console is now /etc/bacula/bconsole
1488 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1489 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1490 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1491 - added new /etc/bacula/drop_mysql_database
1492 - added new /etc/bacula/drop_sqlite_database
1493 - added new /etc/bacula/grant_sqlite_privileges
1494 - added new generic bacula database scripts in /etc/bacula
1495 - added pre-install sections to check for database versions older than 6
1496 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1497 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1498 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1499 - added testing for existing databases before executing any of the database creation scripts
1500 - added defines working_dir and sqlite_bindir in place of hard coded paths
1501 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1502 - added build configuration for SuSE.
1503 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1504 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1505 - added patch for create_sqlite_database to fix the installed bindir
1506 - added execute of create_sqlite_database to post of sqlite package
1507 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1508 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1509 - added bacula-fd as Requires for rescue package
1510 - added build tag for Fedora Core 1
1511 - cleaned up dependancies for all builds
1512 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1513 - removed rh_version from package names
1514 - added platform build configuration section to beginning of file
1515 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1516 - removed make_static_bacula script from rescue package install
1517 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1518 - Added define at top of file for depkgs version
1519 - Added rescue sub-package
1520 - Moved requires statements into proper sub-package locations
1521 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1522 - Corrected Requires for Gnome 1.4/2.0 builds
1523 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1524 - Added separate source declaration for depkgs
1525 - added patch for make_catalog_backup script
1526 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1527 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1528 - Added rh_version to sub-package names
1529 - Added installed but missing file /etc/bacula/gconsole
1530 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1531 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1532 - Update spec for version 1.31 and combine client
1533 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>