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 # Should we build wxconsole, only wxWidgets >=2.6 is supported
141 # currently only SuSE 10 and FC4
143 %{?build_wxconsole:%define wxconsole 1}
145 # define the basic package description
146 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
147 %define blurb2 Bacula is a set of computer programs that permit you (or the system
148 %define blurb3 administrator) to manage backup, recovery, and verification of computer
149 %define blurb4 data across a network of computers of different kinds. In technical terms,
150 %define blurb5 it is a network client/server based backup program. Bacula is relatively
151 %define blurb6 easy to use and efficient, while offering many advanced storage management
152 %define blurb7 features that make it easy to find and recover lost or damaged files.
153 %define blurb8 Bacula source code has been released under the GPL version 2 license.
155 Summary: Bacula - The Network Backup Solution
159 Group: System Environment/Daemons
161 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
162 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
163 Source2: Release_Notes-%{version}-%{release}.tar.gz
164 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
165 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
166 BuildRoot: %{_tmppath}/%{name}-root
167 URL: http://www.bacula.org/
168 Vendor: The Bacula Team
169 Distribution: %{_dist}
170 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
172 %define _docsrc ../%{name}-docs-%{version}
173 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
175 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
176 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
177 BuildRequires: openssl-devel
179 BuildRequires: pkgconfig
182 BuildRequires: libtermcap-devel
183 BuildRequires: glibc-devel >= 2.2
186 BuildRequires: termcap
187 BuildRequires: glibc-devel >= 2.3
189 %if %{su9} && %{gconsole}
190 BuildRequires: libgnome >= 2.0
191 BuildRequires: gtk2-devel >= 2.0
192 BuildRequires: libgnomeui-devel >= 2.0
193 BuildRequires: ORBit2-devel
194 BuildRequires: libart_lgpl-devel >= 2.0
195 BuildRequires: libbonobo-devel >= 2.0
196 BuildRequires: libbonoboui-devel >= 2.0
197 BuildRequires: bonobo-activation-devel
198 BuildRequires: gconf2-devel
199 BuildRequires: linc-devel
200 BuildRequires: freetype2-devel
203 BuildRequires: termcap
204 BuildRequires: glibc-devel >= 2.3
206 %if %{su10} && %{gconsole}
207 BuildRequires: libgnome >= 2.12
208 BuildRequires: gtk2-devel >= 2.8
209 BuildRequires: libgnomeui-devel >= 2.12
210 BuildRequires: ORBit2-devel
211 BuildRequires: libart_lgpl-devel >= 2.3
212 BuildRequires: libbonobo-devel >= 2.10
213 BuildRequires: libbonoboui-devel >= 2.10
214 BuildRequires: bonobo-activation-devel
215 BuildRequires: gconf2-devel
216 BuildRequires: freetype2-devel
217 BuildRequires: cairo-devel
218 BuildRequires: fontconfig-devel >= 2.3
219 BuildRequires: gnome-vfs2-devel >= 2.12
220 BuildRequires: libpng-devel
223 BuildRequires: libtermcap-devel
224 BuildRequires: libstdc++-static-devel
225 BuildRequires: glibc-static-devel
226 BuildRequires: glibc-devel >= 2.3
228 %if %{mdk} && !%{mdv} && %{gconsole}
229 BuildRequires: gtk2-devel >= 2.0
230 BuildRequires: libgnomeui2-devel >= 2.0
231 BuildRequires: libORBit2-devel
232 BuildRequires: libart_lgpl-devel >= 2.0
233 BuildRequires: libbonobo2_0-devel
234 BuildRequires: libbonoboui2_0-devel
235 BuildRequires: libbonobo-activation-devel
236 BuildRequires: libGConf2-devel
237 BuildRequires: freetype2-devel
239 %if %{mdv} && %{gconsole}
240 BuildRequires: gtk2-devel >= 2.8
241 BuildRequires: libgnomeui2-devel >= 2.10
242 BuildRequires: libORBit2-devel
243 BuildRequires: libart_lgpl-devel >= 2.3
244 BuildRequires: libbonobo2_0-devel
245 BuildRequires: libbonoboui2_0-devel
246 BuildRequires: libbonobo-activation-devel
247 BuildRequires: libGConf2-devel
248 BuildRequires: freetype2-devel
251 BuildRequires: libtermcap-devel
252 BuildRequires: glibc-devel >= 2.3
254 %if %{fc3} && %{gconsole}
255 BuildRequires: gtk2-devel >= 2.4
256 BuildRequires: libgnomeui-devel >= 2.8
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
266 BuildRequires: libtermcap-devel
267 BuildRequires: glibc-devel >= 2.3
269 %if %{fc4} && %{gconsole}
270 BuildRequires: gtk2-devel >= 2.6
271 BuildRequires: libgnomeui-devel >= 2.10
272 BuildRequires: ORBit2-devel
273 BuildRequires: libart_lgpl-devel >= 2.3
274 BuildRequires: libbonobo-devel >= 2.8
275 BuildRequires: libbonoboui-devel >= 2.8
276 BuildRequires: bonobo-activation-devel
277 BuildRequires: GConf2-devel
278 BuildRequires: freetype-devel
280 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
281 BuildRequires: libtermcap-devel
282 BuildRequires: glibc-devel >= 2.3
284 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole}
285 BuildRequires: gtk2-devel >= 2.0
286 BuildRequires: libgnomeui-devel >= 2.0
287 BuildRequires: ORBit2-devel
288 BuildRequires: libart_lgpl-devel >= 2.0
289 BuildRequires: libbonobo-devel >= 2.0
290 BuildRequires: libbonoboui-devel >= 2.0
291 BuildRequires: bonobo-activation-devel
292 BuildRequires: GConf2-devel
293 BuildRequires: linc-devel
294 BuildRequires: freetype-devel
297 %if %{mysql} && ! %{mysql4}
298 BuildRequires: mysql-devel >= 3.23
301 %if %{mysql} && %{mysql4}
302 BuildRequires: mysql-devel >= 4.0
305 %if %{postgresql} && %{wb3}
306 BuildRequires: rh-postgresql-devel >= 7
309 %if %{postgresql} && ! %{wb3}
310 BuildRequires: postgresql-devel >= 7
314 BuildRequires: wxGTK-devel >= 2.6
338 Summary: Bacula - The Network Backup Solution
339 Group: System Environment/Daemons
340 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
341 Conflicts: bacula-client
342 Obsoletes: bacula-rescue
343 Requires: ncurses, libstdc++, zlib, openssl, mtx
346 Requires: glibc >= 2.2
349 %if %{su9} || %{su10}
350 Requires: glibc >= 2.3
353 %if ! %{rh7} && ! %{su9} && ! %{su10}
354 Requires: glibc >= 2.3
358 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
359 Requires: mysql >= 3.23
360 Requires: mysql-server >= 3.23
362 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
363 Requires: mysql >= 4.0
364 Requires: mysql-server >= 4.0
367 %if %{mysql} && %{su9} && ! %{mysql4}
368 Requires: mysql >= 3.23
369 Requires: mysql-client >= 3.23
371 %if %{mysql} && %{su9} && %{mysql4}
372 Requires: mysql >= 4.0
373 Requires: mysql-client >= 4.0
375 %if %{mysql} && %{su10} && %{mysql4}
376 Requires: mysql >= 4.0
377 Requires: mysql-client >= 4.0
380 %if %{mysql} && %{mdk} && ! %{mysql4}
381 Requires: mysql >= 3.23
382 Requires: mysql-client >= 3.23
384 %if %{mysql} && %{mdk} && %{mysql4}
385 Requires: mysql >= 4.0
386 Requires: mysql-client >= 4.0
389 %if %{postgresql} && %{wb3}
390 Requires: rh-postgresql >= 7
391 Requires: rh-postgresql-server >= 7
393 %if %{postgresql} && ! %{wb3}
394 Requires: postgresql >= 7
395 Requires: postgresql-server >= 7
405 %description postgresql
419 This build requires MySQL to be installed separately as the catalog database.
422 This build requires PostgreSQL to be installed separately as the catalog database.
425 This build incorporates sqlite as the catalog database, statically compiled.
429 Summary: Bacula - The Network Backup Solution
430 Group: System Environment/Daemons
434 This is Bacula's version of mtx tape utilities for Linux distributions that
435 do not provide their own mtx package
438 Summary: Bacula - The Network Backup Solution
439 Group: System Environment/Daemons
441 Conflicts: bacula-mysql
442 Conflicts: bacula-sqlite
443 Conflicts: bacula-postgresql
444 Obsoletes: bacula-rescue
445 Requires: libstdc++, zlib, openssl
448 Requires: glibc >= 2.2
451 %if %{su9} || %{su10}
452 Requires: glibc >= 2.3
455 %if ! %{rh7} && ! %{su9} && ! %{su10}
456 Requires: glibc >= 2.3
471 This is the File daemon (Client) only package. It includes the command line
476 Summary: Bacula - The Network Backup Solution
477 Group: System Environment/Daemons
479 %description updatedb
490 This package installs scripts for updating older versions of the bacula
495 Summary: Bacula - The Network Backup Solution
496 Group: System Environment/Daemons
497 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
500 %if %{gconsole} && %{su9}
501 Requires: gtk2 >= 2.0
502 Requires: libgnome >= 2.0
503 Requires: libgnomeui >= 2.0
504 Requires: glibc >= 2.3
506 Requires: libart_lgpl >= 2.0
507 Requires: libbonobo >= 2.0
508 Requires: libbonoboui >= 2.0
509 Requires: bonobo-activation
514 %if %{gconsole} && %{su10}
515 Requires: gtk2 >= 2.8
516 Requires: libgnome >= 2.12
517 Requires: libgnomeui >= 2.12
518 Requires: glibc >= 2.3
520 Requires: libart_lgpl >= 2.3
521 Requires: libbonobo >= 2.10
522 Requires: libbonoboui >= 2.10
523 Requires: bonobo-activation
527 Requires: fontconfig >= 2.3
528 Requires: gnome-vfs2 >= 2.12
531 %if %{gconsole} && %{mdk} && !%{mdv}
532 Requires: gtk2 >= 2.0
533 Requires: libgnomeui2
534 Requires: glibc >= 2.3
536 Requires: libart_lgpl >= 2.0
537 Requires: libbonobo >= 2.0
538 Requires: libbonoboui >= 2.0
542 %if %{gconsole} && %{mdv}
543 Requires: gtk2 >= 2.8
544 Requires: libgnomeui2
545 Requires: glibc >= 2.3
547 Requires: libart_lgpl >= 2.3
548 Requires: libbonobo >= 2.10
549 Requires: libbonoboui >= 2.10
553 %if %{gconsole} && %{fc3}
554 Requires: gtk2 >= 2.4
555 Requires: libgnomeui >= 2.8
556 Requires: glibc >= 2.3
558 Requires: libart_lgpl >= 2.3
559 Requires: libbonobo >= 2.8
560 Requires: libbonoboui >= 2.8
561 Requires: bonobo-activation
565 %if %{gconsole} && %{fc4}
566 Requires: gtk2 >= 2.6
567 Requires: libgnomeui >= 2.10
568 Requires: glibc >= 2.3
570 Requires: libart_lgpl >= 2.3
571 Requires: libbonobo >= 2.8
572 Requires: libbonoboui >= 2.8
573 Requires: bonobo-activation
577 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
578 Requires: gtk2 >= 2.0
579 Requires: libgnomeui >= 2.0
580 Requires: glibc >= 2.3
582 Requires: libart_lgpl >= 2.0
583 Requires: libbonobo >= 2.0
584 Requires: libbonoboui >= 2.0
585 Requires: bonobo-activation
590 %if %{gconsole} && %{su9}
593 %if %{gconsole} && %{su10}
596 %if %{gconsole} && ! %{su9} && ! %{su10}
601 %description gconsole
612 This is the Gnome Console package. It is an add-on to the client or
618 Summary: Bacula - The Network Backup Solution
619 Group: System Environment/Daemons
620 Requires: wxGTK >= 2.6, libstdc++, openssl
623 %if %{wxconsole} && %{su10}
624 Requires: gtk2 >= 2.8
627 %if %{wxconsole} && %{fc3}
628 Requires: gtk2 >= 2.4
631 %if %{wxconsole} && %{fc4}
632 Requires: gtk2 >= 2.6
636 %description wxconsole
647 This is the WXWindows Console package. It is an add-on to the client or
661 %if %{su9} || %{su10}
662 export LDFLAGS="-L/usr/lib/termcap"
673 # patches for the bundled sqlite scripts
674 # as of 1.38.0 first 3 patches no longer needed
676 # patch the make_sqlite_tables script for installation bindir
677 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
679 # patch the create_sqlite_database script for installation bindir
680 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
682 # patch the make_catalog_backup script for installation bindir
683 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
685 # patch the update_sqlite_tables script for installation bindir
686 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
688 # patch the bacula-dir init script to remove sqlite service
689 %if %{sqlite} && %{su9}
690 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
692 %if %{sqlite} && %{su10}
693 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
696 # 64 bit lib location hacks
698 export LDFLAGS=-L/usr/lib64
700 %if %{mysql} && %{x86_64}
701 export LDFLAGS=-L/usr/lib64/mysql
706 --sbindir=/usr/sbin \
707 --sysconfdir=/etc/bacula \
708 --with-scriptdir=/etc/bacula \
709 --enable-smartalloc \
710 --enable-client-only \
720 --sbindir=/usr/sbin \
721 --sysconfdir=/etc/bacula \
722 --with-scriptdir=/etc/bacula \
723 --enable-smartalloc \
727 %if %{gconsole} && ! %{rh8}
728 --enable-tray-monitor \
734 --with-sqlite=${cwd}/%{depkgs}/sqlite \
740 --enable-wx-console \
742 --with-working-dir=%{working_dir} \
743 --with-pid-dir=/var/run \
744 --with-subsys-dir=/var/lock/subsys \
745 --with-dir-user=%{director_daemon_user} \
746 --with-dir-group=%{daemon_group} \
747 --with-sd-user=%{storage_daemon_user} \
748 --with-sd-group=%{storage_daemon_group} \
749 --with-fd-user=%{file_daemon_user} \
750 --with-fd-group=%{daemon_group} \
751 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
752 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
753 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
754 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
755 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
756 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
764 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
765 mkdir -p $RPM_BUILD_ROOT/etc/init.d
766 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
767 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
768 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
769 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
770 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
772 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
774 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
775 %if %{gconsole} && ! %{su9} && ! %{su10}
776 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
777 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
778 mkdir -p $RPM_BUILD_ROOT/usr/bin
782 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
786 prefix=$RPM_BUILD_ROOT/usr \
787 sbindir=$RPM_BUILD_ROOT/usr/sbin \
788 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
789 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
790 working_dir=$RPM_BUILD_ROOT%{working_dir} \
795 prefix=$RPM_BUILD_ROOT/usr \
796 sbindir=$RPM_BUILD_ROOT/usr/sbin \
797 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
798 working_dir=$RPM_BUILD_ROOT%{working_dir} \
799 mandir=$RPM_BUILD_ROOT/usr/man \
803 # fixme - make installs the mysql scripts for sqlite build
805 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
806 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
807 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
810 # fixme - make installs the mysql scripts for postgresql build
812 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
813 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
816 # fixme - make installs gconsole script for build without gconsole
818 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
821 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
823 # install the init scripts
824 %if %{su9} || %{su10}
825 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
826 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
827 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
830 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
831 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
832 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
834 %if ! %{su9} && ! %{su10} && ! %{mdk}
835 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
836 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
837 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
839 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
841 # install the menu stuff
842 %if %{gconsole} && %{su9}
843 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
844 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
845 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
846 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
848 %if %{gconsole} && %{su10}
849 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
850 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
851 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
852 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
854 %if %{wxconsole} && %{su10}
855 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
856 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
858 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
863 %if %{gconsole} && %{iftrick}
864 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
865 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
866 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
867 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
868 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
870 %if %{gconsole} && ! %{rh8}
871 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
872 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
874 %if %{wxconsole} && %{iftrick}
875 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
876 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
877 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
878 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
879 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
884 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
885 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
886 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
889 # install the logrotate file
890 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
892 # install the updatedb scripts
893 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
895 # install the logwatch scripts
896 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
897 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
898 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
899 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
900 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
901 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
903 # install the rescue files
904 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
905 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
906 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
907 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
908 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
909 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
910 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
911 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
912 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
913 rm -f src/filed/static-bacula-fd
916 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
917 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
920 # now clean up permissions that are left broken by the install
921 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
922 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
923 %if %{gconsole} && ! %{rh8}
924 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
925 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
929 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
932 # MySQL specific files
934 %defattr(-, root, root)
935 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
936 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
937 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
938 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
939 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
940 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
941 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
942 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
947 %defattr(-,root,root)
948 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
949 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
950 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
951 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
952 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
953 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
954 %{sqlite_bindir}/libsqlite.a
955 %{sqlite_bindir}/sqlite.h
956 %{sqlite_bindir}/sqlite
961 %defattr(-,root,root)
962 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
963 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
964 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
965 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
966 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
967 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
970 # The rest is DB backend independent
971 %attr(-, root, %{daemon_group}) %dir /etc/bacula
972 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
973 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
974 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
975 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
976 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
977 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
978 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
979 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
980 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
981 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
982 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
983 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
984 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
985 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
986 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
987 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
988 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
989 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
990 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
991 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
992 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
993 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
995 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
996 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
998 /etc/logrotate.d/bacula
999 /etc/log.d/scripts/services/bacula
1000 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1001 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1002 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1003 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1004 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1005 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1006 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1007 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1009 /usr/sbin/bacula-dir
1017 /usr/sbin/btraceback
1026 # test for bacula database older than version 8
1027 # note: this ASSUMES no password has been set for bacula database
1028 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1033 # test for bacula database older than version 8
1034 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1035 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1040 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1043 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1044 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1045 echo "You appear to be running database version $DB_VER. You must first update"
1046 echo "your database to version 8 and then install this upgrade. The alternative"
1047 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1048 echo "catalog information, then do the upgrade. Information on updating a"
1049 echo "database older than version 8 can be found in the release notes."
1057 # check for and copy /etc/bacula/console.conf to bconsole.conf
1058 if [ -s /etc/bacula/console.conf ];then
1059 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1062 # create the daemon users and groups
1063 # first create the groups if they don't exist
1064 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1065 if [ -z "$HAVE_BACULA" ]; then
1066 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1067 echo "The group %{daemon_group} has been added to %{group_file}."
1068 echo "See the manual chapter \"Running Bacula\" for details."
1070 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1071 if [ -z "$HAVE_BACULA" ]; then
1072 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1073 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1074 echo "See the manual chapter \"Running Bacula\" for details."
1076 # now create the users if they do not exist
1077 # we do not use the -g option allowing the primary group to be set to system default
1078 # this will be a unique group on redhat type systems or the group users on some systems
1079 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1080 if [ -z "$HAVE_BACULA" ]; then
1081 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1082 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1083 echo "See the manual chapter \"Running Bacula\" for details."
1085 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1086 if [ -z "$HAVE_BACULA" ]; then
1087 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1088 echo "The user %{director_daemon_user} has been added to %{user_file}."
1089 echo "See the manual chapter \"Running Bacula\" for details."
1091 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1092 if [ -z "$HAVE_BACULA" ]; then
1093 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1094 echo "The user %{file_daemon_user} has been added to %{user_file}."
1095 echo "See the manual chapter \"Running Bacula\" for details."
1097 # now we add the supplementary groups, this is ok to call even if the users already exist
1098 # we only do this if the user is NOT root
1099 IS_ROOT=%{director_daemon_user}
1100 if [ "$IS_ROOT" != "root" ]; then
1101 %{usermod} %{director_daemon_user} -G %{daemon_group}
1103 IS_ROOT=%{storage_daemon_user}
1104 if [ "$IS_ROOT" != "root" ]; then
1105 %{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group}
1107 IS_ROOT=%{file_daemon_user}
1108 if [ "$IS_ROOT" != "root" ]; then
1109 %{usermod} %{file_daemon_user} -G %{daemon_group}
1123 if [ "$1" -ge 1 ] ; then
1124 /sbin/chkconfig --add bacula-dir
1125 /sbin/chkconfig --add bacula-fd
1126 /sbin/chkconfig --add bacula-sd
1130 # test for an existing database
1131 # note: this ASSUMES no password has been set for bacula database
1132 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1134 # grant privileges and create tables if they do not exist
1135 if [ -z "$DB_VER" ]; then
1136 echo "Hmm, doesn't look like you have an existing database."
1137 echo "Granting privileges for MySQL user bacula..."
1138 /etc/bacula/grant_mysql_privileges
1139 echo "Creating MySQL bacula database..."
1140 /etc/bacula/create_mysql_database
1141 echo "Creating bacula tables..."
1142 /etc/bacula/make_mysql_tables
1144 # check to see if we need to upgrade a 1.36 or lower database
1145 elif [ "$DB_VER" -lt "9" ]; then
1146 echo "This release requires an upgrade to your bacula database."
1147 echo "Backing up your current database..."
1148 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1149 echo "Upgrading bacula database ..."
1150 /etc/bacula/update_mysql_tables
1151 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1157 # test for an existing database
1158 if [ -s %{working_dir}/bacula.db ]; then
1159 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1160 # check to see if we need to upgrade a 1.36 or lower database
1161 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1162 echo "This release requires an upgrade to your bacula database."
1163 echo "Backing up your current database..."
1164 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1165 echo "Upgrading bacula database ..."
1166 /etc/bacula/update_sqlite_tables
1167 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1170 # create the database and tables
1171 echo "Hmm, doesn't look like you have an existing database."
1172 echo "Creating SQLite database..."
1173 /etc/bacula/create_sqlite_database
1174 echo "Creating the SQLite tables..."
1175 /etc/bacula/make_sqlite_tables
1180 # test for an existing database
1181 # note: this ASSUMES no password has been set for bacula database
1182 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1184 # grant privileges and create tables if they do not exist
1185 if [ -z "$DB_VER" ]; then
1186 echo "Hmm, doesn't look like you have an existing database."
1187 echo "Creating PostgreSQL bacula database..."
1188 /etc/bacula/create_postgresql_database
1189 echo "Creating bacula tables..."
1190 /etc/bacula/make_postgresql_tables
1191 echo "Granting privileges for PostgreSQL user bacula..."
1192 /etc/bacula/grant_postgresql_privileges
1194 # check to see if we need to upgrade a 1.36 or lower database
1195 elif [ "$DB_VER" -lt "9" ]; then
1196 echo "This release requires an upgrade to your bacula database."
1197 echo "Backing up your current database..."
1198 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1199 echo "Upgrading bacula database ..."
1200 /etc/bacula/update_postgresql_tables
1201 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1206 # generate passwords if needed
1207 if [ -d /etc/bacula ]; then
1209 for file in *.conf; do
1210 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
1211 need_password=`grep $string $file 2>/dev/null`
1212 if [ -n "$need_password" ]; then
1213 pass=`openssl rand -base64 33`
1214 sed "s-$string-$pass-g" $file > $file.new
1215 cp -f $file.new $file; rm -f $file.new
1233 /sbin/chkconfig --del bacula-dir
1234 /sbin/chkconfig --del bacula-fd
1235 /sbin/chkconfig --del bacula-sd
1240 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1241 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1242 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1243 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1248 %defattr(-,root,root)
1249 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1250 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1251 /etc/init.d/bacula-fd
1252 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1254 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1255 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1257 /etc/logrotate.d/bacula
1259 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1260 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1261 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1264 /usr/sbin/btraceback
1265 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1266 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1272 # create the daemon group and user
1273 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1274 if [ -z "$HAVE_BACULA" ]; then
1275 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1276 echo "The group %{daemon_group} has been added to %{group_file}."
1277 echo "See the manual chapter \"Running Bacula\" for details."
1279 # we do not use the -g option allowing the primary group to be set to system default
1280 # this will be a unique group on redhat type systems or the group users on some systems
1281 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1282 if [ -z "$HAVE_BACULA" ]; then
1283 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1284 echo "The user %{file_daemon_user} has been added to %{user_file}."
1285 echo "See the manual chapter \"Running Bacula\" for details."
1287 # now we add the supplementary group, this is ok to call even if the user already exists
1288 # we only do this if the user is NOT root
1289 IS_ROOT=%{file_daemon_user}
1290 if [ "$IS_ROOT" != "root" ]; then
1291 %{usermod} %{file_daemon_user} -G %{daemon_group}
1296 if [ "$1" -ge 1 ] ; then
1297 /sbin/chkconfig --add bacula-fd
1300 # generate passwords if needed
1301 if [ -d /etc/bacula ]; then
1303 for file in *.conf; do
1304 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
1305 need_password=`grep $string $file 2>/dev/null`
1306 if [ -n "$need_password" ]; then
1307 pass=`openssl rand -base64 33`
1308 sed "s-$string-$pass-g" $file > $file.new
1309 cp -f $file.new $file; rm -f $file.new
1318 /sbin/chkconfig --del bacula-fd
1322 %defattr(-,root,%{daemon_group})
1323 /etc/bacula/updatedb/*
1326 # create the daemon group
1327 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1328 if [ -z "$HAVE_BACULA" ]; then
1329 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1330 echo "The group %{daemon_group} has been added to %{group_file}."
1331 echo "See the manual chapter \"Running Bacula\" for details."
1335 echo "The database update scripts were installed to /etc/bacula/updatedb"
1339 %defattr(-,root,root)
1340 /usr/sbin/gnome-console
1341 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1342 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1343 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1344 /usr/share/pixmaps/bacula.png
1345 /usr/share/applications/bacula.desktop
1348 %if %{gconsole} && ! %{rh8}
1349 /usr/sbin/bacula-tray-monitor
1350 %config(noreplace) /etc/bacula/tray-monitor.conf
1351 /usr/share/pixmaps/bacula-tray-monitor.xpm
1352 /usr/share/applications/bacula-tray-monitor.desktop
1355 %if %{gconsole} && ! %{su9} && ! %{su10}
1356 # add the console helper files
1357 %config(noreplace,missingok) /etc/pam.d/gnome-console
1358 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1359 /usr/bin/gnome-console
1364 # create the daemon group
1365 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1366 if [ -z "$HAVE_BACULA" ]; then
1367 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1368 echo "The group %{daemon_group} has been added to %{group_file}."
1369 echo "See the manual chapter \"Running Bacula\" for details."
1373 # generate passwords if needed
1374 if [ -d /etc/bacula ]; then
1376 for file in *.conf; do
1377 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
1378 need_password=`grep $string $file 2>/dev/null`
1379 if [ -n "$need_password" ]; then
1380 pass=`openssl rand -base64 33`
1381 sed "s-$string-$pass-g" $file > $file.new
1382 cp -f $file.new $file; rm -f $file.new
1391 %defattr(-,root,root)
1393 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1394 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1395 /usr/share/pixmaps/wxwin16x16.xpm
1396 /usr/share/applications/wxconsole.desktop
1399 %if %{wxconsole} && ! %{su9} && ! %{su10}
1400 # add the console helper files
1401 %config(noreplace,missingok) /etc/pam.d/wxconsole
1402 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1408 # create the daemon group
1409 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1410 if [ -z "$HAVE_BACULA" ]; then
1411 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1412 echo "The group %{daemon_group} has been added to %{group_file}."
1413 echo "See the manual chapter \"Running Bacula\" for details."
1417 # generate passwords if needed
1418 if [ -d /etc/bacula ]; then
1420 for file in *.conf; do
1421 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
1422 need_password=`grep $string $file 2>/dev/null`
1423 if [ -n "$need_password" ]; then
1424 pass=`openssl rand -base64 33`
1425 sed "s-$string-$pass-g" $file > $file.new
1426 cp -f $file.new $file; rm -f $file.new
1434 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1435 - redundant code cleanup
1436 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1437 - add wxconsole package
1438 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1440 - dependency update for Mandriva
1441 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1443 - remove -n option from useradd scripts
1444 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1446 - fix problem specifying more than one primary group for user bacula
1447 - add build switch to not build gconsole regardless of platform
1448 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1449 - add centos3 build tag
1450 - fix link error of static-fd on Mandrake with --disable-nls
1451 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1452 - add fc4 dependencies
1453 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1454 - add SuSE 10.0 build
1455 - remove specific permission in attrib macros
1456 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1458 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1459 - refix compat for _dist on SLES9 which seems to have been removed
1460 - added note regarding Aleksandar's use of specific permissions in attrib macros
1461 - need to review and add specific fc4 build currently using fc3 Requires
1462 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1464 - Reorganize files and pre/post sections to remove repetitions
1465 - Always build separate mtx package
1466 - Fix file ownerships for /etc/bacula and Bacula's working dir
1467 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1468 - Disable GNOME on RH7
1469 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1470 - Red Hat and look alikes have mtx RPM, do not build/package our version
1471 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1472 - minor edit to _dist for SLES9 compatibility
1473 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1475 - kern changed location of pdf files and html manual in docs package
1476 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1478 - add docs (from prebuilt tarball) and rescue packages back in
1479 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1480 - remove 3 of 4 sqlite script patches as not needed
1481 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1483 - remove docs and rescue sections (remove static fd)
1484 - add dvd-freespace and dvd-writepart files
1485 - update depkgs to 22Jun05
1486 - change database update to 8 to 9
1487 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1488 - minor cleanups before 1.38 changes
1489 - add popt and popt-devel build dependencies
1490 - add tetex and tetex-dvips dependencies for doc build
1491 - replace deprecated Copyright tag with License
1492 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1493 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1494 - conflict with sqlite packages. remove readline dependency.
1495 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1496 - release 1.36.3 update docs
1497 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1498 - add centos4 build tag
1499 - add x86_64 build tag
1500 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - add rhel4 build tag
1502 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1503 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add rhel3 build tag
1505 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1506 - fix tray-monitor.conf for noreplace
1507 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - fix distribution check for Fedora and Whitebox
1509 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1510 - add logwatch script
1512 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 - add build for Fedora Core 3 (linc now included in ORDit2)
1514 - add mysql4 define for Mandrake 10.1
1515 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1516 - fix {group_file} variable in post scripts
1517 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 - add distribution checking and custom Distribution tag
1519 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1520 - ASSIGNMENT OF COPYRIGHT
1521 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1522 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1523 - all right, title and interest in and to the copyright in this software RPM
1524 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1525 - free of all liens, encumbrances or any known claims against said copyright.
1526 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1528 - thanks to Daniel Widyono
1529 - update description for rescue package to describe cdrom creation
1530 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1531 - update depkgs to 29Oct04
1532 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1533 - add cdrom rescue to bacula-rescue package
1534 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1535 - misc fixes from 1.36.0 suse feedback
1536 - fix situation where sqlite database exists but sqlite has been removed.
1537 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1538 - remove tray-monitor from RH8 build
1539 - fix permissions on tray-monitor files
1540 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1541 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1542 - change database update to 7 to 8 upgrade,
1543 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1544 - build in 30Jul04, add freetype dependancy to gnome package.
1545 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1546 - add documentation to console for groupadd
1547 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1548 - add support for running daemons as root.bacula
1549 - correct for change in location of floppy rescue files in 1.35.2
1550 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1551 - updated depgkgs to 30Jul04
1552 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1553 - really, really fix symlink creation for gconsole
1554 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1555 - fix symlink creation in gconsole post install
1556 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1557 - fixed error in gconsole post script
1558 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1559 - add check for gconsole symlink before trying to create it
1560 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1561 - fix some minor permissions issues on doc files that CVS won't let us fix
1562 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1563 - add pkgconfig to BuildRequires
1564 - clean up gnome1/2 menu entries for appropriate packages
1565 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1566 - tightened up doc distribution
1567 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1568 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1569 - rpm's horrible bug that prevents nested conditional macros prevents me
1570 - from implementing these 2 separate approaches within the conditionals which
1571 - create the separate server packages.
1572 - the solution adopted is to remove the gnome-console files from the server packages
1573 - so bacula-gconsole is now an add on for both client and server packages.
1574 - this also now allows the server packages to be install on machines without
1575 - an X-server and we can still maintain a single spec file.
1576 - added tests to make sure we have defined platform and database macros.
1577 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1578 - corrected mysql prerequisites for suse
1579 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1580 - replaced all cp commands with cp -p
1581 - removed addition of a+x permissions on gnome-console
1582 - corrected permissions on init scripts
1583 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1584 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1586 - various cleanup patches from Michael K. Johnson:
1587 - corrected post install routines for nicer chkconfig
1588 - removed chmod changes in post routines and moved to install section
1589 - removed interactive nature of post routine for rescue package
1590 - added description of building rescue disks to the description of rescue package
1591 - added clean of build root to beginning of install
1592 - removed specifying attr in all file lists
1593 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1594 - added bconsole to client package
1595 - added gconsole package as add-on to client
1596 - removed spurious dependancies on updatedb package (!cut/paste)
1597 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1598 - added updatedb package
1599 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1600 - added postgresql package
1601 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1602 - corrected the if else logic in the dependancy sections
1603 - changes for 1.34 release
1604 - /etc/bacula/console is now /etc/bacula/bconsole
1605 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1606 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1607 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1608 - added new /etc/bacula/drop_mysql_database
1609 - added new /etc/bacula/drop_sqlite_database
1610 - added new /etc/bacula/grant_sqlite_privileges
1611 - added new generic bacula database scripts in /etc/bacula
1612 - added pre-install sections to check for database versions older than 6
1613 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1614 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1615 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1616 - added testing for existing databases before executing any of the database creation scripts
1617 - added defines working_dir and sqlite_bindir in place of hard coded paths
1618 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1619 - added build configuration for SuSE.
1620 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1621 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1622 - added patch for create_sqlite_database to fix the installed bindir
1623 - added execute of create_sqlite_database to post of sqlite package
1624 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1625 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1626 - added bacula-fd as Requires for rescue package
1627 - added build tag for Fedora Core 1
1628 - cleaned up dependancies for all builds
1629 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1630 - removed rh_version from package names
1631 - added platform build configuration section to beginning of file
1632 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1633 - removed make_static_bacula script from rescue package install
1634 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1635 - Added define at top of file for depkgs version
1636 - Added rescue sub-package
1637 - Moved requires statements into proper sub-package locations
1638 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1639 - Corrected Requires for Gnome 1.4/2.0 builds
1640 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1641 - Added separate source declaration for depkgs
1642 - added patch for make_catalog_backup script
1643 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1644 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1645 - Added rh_version to sub-package names
1646 - Added installed but missing file /etc/bacula/gconsole
1647 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1648 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1649 - Update spec for version 1.31 and combine client
1650 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>