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 25Jun06
9 %define sqlite_bindir /usr/lib/bacula/sqlite
10 %define working_dir /var/bacula
12 # NOTE these defines are used in some rather complex useradd and groupadd
13 # commands. If you change them examine the post scripts for consequences.
14 %define director_daemon_user bacula
15 %define storage_daemon_user bacula
16 %define file_daemon_user root
17 %define daemon_group bacula
18 # group that has write access to tape devices, usually disk on Linux
19 %define storage_daemon_group disk
21 %define user_file /etc/passwd
22 %define group_file /etc/group
23 %define useradd /usr/sbin/useradd
24 %define groupadd /usr/sbin/groupadd
25 %define usermod /usr/sbin/usermod
26 %define _rescuever 1.8.4
28 # platform defines - set one below or define the build_xxx on the command line
31 %{?build_rh7:%define rh7 1}
33 %{?build_rh8:%define rh8 1}
35 %{?build_rh9:%define rh9 1}
38 %{?build_fc1:%define fc1 1}
40 %{?build_fc3:%define fc3 1}
42 %{?build_fc4:%define fc4 1}
44 %{?build_fc5:%define fc5 1}
45 # Whitebox Enterprise build
47 %{?build_wb3:%define wb3 1}
48 # RedHat Enterprise builds
50 %{?build_rhel3:%define rhel3 1}
51 %{?build_rhel3:%define wb3 1}
53 %{?build_rhel4:%define rhel4 1}
54 %{?build_rhel4:%define fc3 1}
57 %{?build_centos3:%define centos3 1}
58 %{?build_centos3:%define wb3 1}
60 %{?build_centos4:%define centos4 1}
61 %{?build_centos4:%define fc3 1}
64 %{?build_su9:%define su9 1}
66 %{?build_su10:%define su10 1}
69 %{?build_mdk:%define mdk 1}
71 %{?build_mdv:%define mdv 1}
72 %{?build_mdv:%define mdk 1}
74 # test for a platform definition
75 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
76 %{error: You must specify a platform. Please examine the spec file.}
81 # set for database support desired or define the build_xxx on the command line
83 %{?build_mysql:%define mysql 1}
84 # if using mysql 4.x define this and mysql above
85 # currently: Mandrake 10.1, SuSE 9.x & 10.x, RHEL4 and Fedora Core 4 & 5
87 %{?build_mysql4:%define mysql4 1}
88 %{?build_mysql4:%define mysql 1}
90 %{?build_sqlite:%define sqlite 1}
92 %{?build_postgresql:%define postgresql 1}
94 # test for a database definition
95 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
96 %{error: You must specify database support. Please examine the spec file.}
101 %define db_backend mysql
104 %define db_backend sqlite
107 %define db_backend postgresql
112 %{?build_x86_64:%define x86_64 1}
114 # check what distribution we are
115 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
116 %define _dist %(grep Red /etc/redhat-release)
118 %if %{fc1} || %{fc4} || %{fc5}
119 %define _dist %(grep Fedora /etc/redhat-release)
121 %if %{centos4} || %{centos3}
122 %define _dist %(grep CentOS /etc/redhat-release)
124 %if %{fc3} && ! %{rhel4} && ! %{centos4}
125 %define _dist %(grep Fedora /etc/redhat-release)
127 %if %{wb3} && ! %{rhel3} && ! %{centos3}
128 %define _dist %(grep White /etc/whitebox-release)
130 %if %{su9} || %{su10}
131 %define _dist %(grep -i SuSE /etc/SuSE-release)
134 %define _dist %(grep Mand /etc/mandrake-release)
137 # Should we build gconsole, possible only if gnome >= 2.0 available
143 # specifically disallow gconsole if desired
144 %{?nobuild_gconsole:%define gconsole 0}
146 # Should we build wxconsole, only wxWidgets >=2.6 is supported
147 # currently only SuSE 10 and FC4
149 %{?build_wxconsole:%define wxconsole 1}
151 # define the basic package description
152 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
153 %define blurb2 Bacula is a set of computer programs that permit you (or the system
154 %define blurb3 administrator) to manage backup, recovery, and verification of computer
155 %define blurb4 data across a network of computers of different kinds. In technical terms,
156 %define blurb5 it is a network client/server based backup program. Bacula is relatively
157 %define blurb6 easy to use and efficient, while offering many advanced storage management
158 %define blurb7 features that make it easy to find and recover lost or damaged files.
159 %define blurb8 Bacula source code has been released under the GPL version 2 license.
161 Summary: Bacula - The Network Backup Solution
165 Group: System Environment/Daemons
167 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
168 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
169 Source2: Release_Notes-%{version}-%{release}.tar.gz
170 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
171 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
172 Patch0: bacula-1.38.9-gnome2console.patch
173 BuildRoot: %{_tmppath}/%{name}-root
174 URL: http://www.bacula.org/
175 Vendor: The Bacula Team
176 Distribution: %{_dist}
177 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
179 %define _docsrc ../%{name}-docs-%{version}
180 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
182 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
183 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
184 BuildRequires: openssl-devel
186 BuildRequires: pkgconfig
189 BuildRequires: libtermcap-devel
190 BuildRequires: glibc-devel >= 2.2
193 BuildRequires: termcap
194 BuildRequires: glibc-devel >= 2.3
196 %if %{su9} && %{gconsole}
197 BuildRequires: libgnome >= 2.0
198 BuildRequires: gtk2-devel >= 2.0
199 BuildRequires: libgnomeui-devel >= 2.0
200 BuildRequires: ORBit2-devel
201 BuildRequires: libart_lgpl-devel >= 2.0
202 BuildRequires: libbonobo-devel >= 2.0
203 BuildRequires: libbonoboui-devel >= 2.0
204 BuildRequires: bonobo-activation-devel
205 BuildRequires: gconf2-devel
206 BuildRequires: linc-devel
207 BuildRequires: freetype2-devel
210 BuildRequires: termcap
211 BuildRequires: glibc-devel >= 2.3
213 %if %{su10} && %{gconsole}
214 BuildRequires: libgnome >= 2.12
215 BuildRequires: gtk2-devel >= 2.8
216 BuildRequires: libgnomeui-devel >= 2.12
217 BuildRequires: ORBit2-devel
218 BuildRequires: libart_lgpl-devel >= 2.3
219 BuildRequires: libbonobo-devel >= 2.10
220 BuildRequires: libbonoboui-devel >= 2.10
221 BuildRequires: bonobo-activation-devel
222 BuildRequires: gconf2-devel
223 BuildRequires: freetype2-devel
224 BuildRequires: cairo-devel
225 BuildRequires: fontconfig-devel >= 2.3
226 BuildRequires: gnome-vfs2-devel >= 2.12
227 BuildRequires: libpng-devel
230 BuildRequires: libtermcap-devel
231 BuildRequires: libstdc++-static-devel
232 BuildRequires: glibc-static-devel
233 BuildRequires: glibc-devel >= 2.3
235 %if %{mdk} && !%{mdv} && %{gconsole}
236 BuildRequires: gtk2-devel >= 2.0
237 BuildRequires: libgnomeui2-devel >= 2.0
238 BuildRequires: libORBit2-devel
239 BuildRequires: libart_lgpl-devel >= 2.0
240 BuildRequires: libbonobo2_0-devel
241 BuildRequires: libbonoboui2_0-devel
242 BuildRequires: libbonobo-activation-devel
243 BuildRequires: libGConf2-devel
244 BuildRequires: freetype2-devel
246 %if %{mdv} && %{gconsole}
247 BuildRequires: gtk2-devel >= 2.8
248 BuildRequires: libgnomeui2-devel >= 2.10
249 BuildRequires: libORBit2-devel
250 BuildRequires: libart_lgpl-devel >= 2.3
251 BuildRequires: libbonobo2_0-devel
252 BuildRequires: libbonoboui2_0-devel
253 BuildRequires: libbonobo-activation-devel
254 BuildRequires: libGConf2-devel
255 BuildRequires: freetype2-devel
258 BuildRequires: libtermcap-devel
259 BuildRequires: glibc-devel >= 2.3
261 %if %{fc3} && %{gconsole}
262 BuildRequires: gtk2-devel >= 2.4
263 BuildRequires: libgnomeui-devel >= 2.8
264 BuildRequires: ORBit2-devel
265 BuildRequires: libart_lgpl-devel >= 2.3
266 BuildRequires: libbonobo-devel >= 2.8
267 BuildRequires: libbonoboui-devel >= 2.8
268 BuildRequires: bonobo-activation-devel
269 BuildRequires: GConf2-devel
270 BuildRequires: freetype-devel
273 BuildRequires: libtermcap-devel
274 BuildRequires: glibc-devel >= 2.3
276 %if %{fc4} && %{gconsole}
277 BuildRequires: gtk2-devel >= 2.6
278 BuildRequires: libgnomeui-devel >= 2.10
279 BuildRequires: ORBit2-devel
280 BuildRequires: libart_lgpl-devel >= 2.3
281 BuildRequires: libbonobo-devel >= 2.8
282 BuildRequires: libbonoboui-devel >= 2.8
283 BuildRequires: bonobo-activation-devel
284 BuildRequires: GConf2-devel
285 BuildRequires: freetype-devel
288 BuildRequires: libtermcap-devel
289 BuildRequires: glibc-devel >= 2.4
291 %if %{fc5} && %{gconsole}
292 BuildRequires: gtk2-devel >= 2.8
293 BuildRequires: libgnomeui-devel >= 2.14
294 BuildRequires: ORBit2-devel
295 BuildRequires: libart_lgpl-devel >= 2.3
296 BuildRequires: libbonobo-devel >= 2.14
297 BuildRequires: libbonoboui-devel >= 2.14
298 BuildRequires: GConf2-devel
299 BuildRequires: freetype-devel
301 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
302 BuildRequires: libtermcap-devel
303 BuildRequires: glibc-devel >= 2.3
305 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
306 BuildRequires: gtk2-devel >= 2.0
307 BuildRequires: libgnomeui-devel >= 2.0
308 BuildRequires: ORBit2-devel
309 BuildRequires: libart_lgpl-devel >= 2.0
310 BuildRequires: libbonobo-devel >= 2.0
311 BuildRequires: libbonoboui-devel >= 2.0
312 BuildRequires: bonobo-activation-devel
313 BuildRequires: GConf2-devel
314 BuildRequires: linc-devel
315 BuildRequires: freetype-devel
318 %if %{mysql} && ! %{mysql4}
319 BuildRequires: mysql-devel >= 3.23
322 %if %{mysql} && %{mysql4}
323 BuildRequires: mysql-devel >= 4.0
326 %if %{postgresql} && %{wb3}
327 BuildRequires: rh-postgresql-devel >= 7
330 %if %{postgresql} && ! %{wb3}
331 BuildRequires: postgresql-devel >= 7
335 BuildRequires: wxGTK-devel >= 2.6
359 Summary: Bacula - The Network Backup Solution
360 Group: System Environment/Daemons
361 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
362 Conflicts: bacula-client
363 Obsoletes: bacula-rescue
364 Requires: ncurses, libstdc++, zlib, openssl, mtx
367 Requires: glibc >= 2.2
370 %if %{su9} || %{su10}
371 Requires: glibc >= 2.3
374 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
375 Requires: glibc >= 2.3
379 Requires: glibc >= 2.4
383 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
384 Requires: mysql >= 3.23
385 Requires: mysql-server >= 3.23
387 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
388 Requires: mysql >= 4.0
389 Requires: mysql-server >= 4.0
392 %if %{mysql} && %{su9} && ! %{mysql4}
393 Requires: mysql >= 3.23
394 Requires: mysql-client >= 3.23
396 %if %{mysql} && %{su9} && %{mysql4}
397 Requires: mysql >= 4.0
398 Requires: mysql-client >= 4.0
400 %if %{mysql} && %{su10} && %{mysql4}
401 Requires: mysql >= 4.0
402 Requires: mysql-client >= 4.0
405 %if %{mysql} && %{mdk} && ! %{mysql4}
406 Requires: mysql >= 3.23
407 Requires: mysql-client >= 3.23
409 %if %{mysql} && %{mdk} && %{mysql4}
410 Requires: mysql >= 4.0
411 Requires: mysql-client >= 4.0
414 %if %{postgresql} && %{wb3}
415 Requires: rh-postgresql >= 7
416 Requires: rh-postgresql-server >= 7
418 %if %{postgresql} && ! %{wb3}
419 Requires: postgresql >= 7
420 Requires: postgresql-server >= 7
430 %description postgresql
444 This build requires MySQL to be installed separately as the catalog database.
447 This build requires PostgreSQL to be installed separately as the catalog database.
450 This build incorporates sqlite as the catalog database, statically compiled.
454 Summary: Bacula - The Network Backup Solution
455 Group: System Environment/Daemons
459 This is Bacula's version of mtx tape utilities for Linux distributions that
460 do not provide their own mtx package
463 Summary: Bacula - The Network Backup Solution
464 Group: System Environment/Daemons
466 Conflicts: bacula-mysql
467 Conflicts: bacula-sqlite
468 Conflicts: bacula-postgresql
469 Obsoletes: bacula-rescue
470 Requires: libstdc++, zlib, openssl
473 Requires: glibc >= 2.2
476 %if %{su9} || %{su10}
477 Requires: glibc >= 2.3
480 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
481 Requires: glibc >= 2.3
485 Requires: glibc >= 2.4
500 This is the File daemon (Client) only package. It includes the command line
505 Summary: Bacula - The Network Backup Solution
506 Group: System Environment/Daemons
508 %description updatedb
519 This package installs scripts for updating older versions of the bacula
524 Summary: Bacula - The Network Backup Solution
525 Group: System Environment/Daemons
526 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
529 %if %{gconsole} && %{su9}
530 Requires: gtk2 >= 2.0
531 Requires: libgnome >= 2.0
532 Requires: libgnomeui >= 2.0
533 Requires: glibc >= 2.3
535 Requires: libart_lgpl >= 2.0
536 Requires: libbonobo >= 2.0
537 Requires: libbonoboui >= 2.0
538 Requires: bonobo-activation
543 %if %{gconsole} && %{su10}
544 Requires: gtk2 >= 2.8
545 Requires: libgnome >= 2.12
546 Requires: libgnomeui >= 2.12
547 Requires: glibc >= 2.3
549 Requires: libart_lgpl >= 2.3
550 Requires: libbonobo >= 2.10
551 Requires: libbonoboui >= 2.10
552 Requires: bonobo-activation
556 Requires: fontconfig >= 2.3
557 Requires: gnome-vfs2 >= 2.12
560 %if %{gconsole} && %{mdk} && !%{mdv}
561 Requires: gtk2 >= 2.0
562 Requires: libgnomeui2
563 Requires: glibc >= 2.3
565 Requires: libart_lgpl >= 2.0
566 Requires: libbonobo >= 2.0
567 Requires: libbonoboui >= 2.0
571 %if %{gconsole} && %{mdv}
572 Requires: gtk2 >= 2.8
573 Requires: libgnomeui2
574 Requires: glibc >= 2.3
576 Requires: libart_lgpl >= 2.3
577 Requires: libbonobo >= 2.10
578 Requires: libbonoboui >= 2.10
582 %if %{gconsole} && %{fc3}
583 Requires: gtk2 >= 2.4
584 Requires: libgnomeui >= 2.8
585 Requires: glibc >= 2.3
587 Requires: libart_lgpl >= 2.3
588 Requires: libbonobo >= 2.8
589 Requires: libbonoboui >= 2.8
590 Requires: bonobo-activation
594 %if %{gconsole} && %{fc4}
595 Requires: gtk2 >= 2.6
596 Requires: libgnomeui >= 2.10
597 Requires: glibc >= 2.3
599 Requires: libart_lgpl >= 2.3
600 Requires: libbonobo >= 2.8
601 Requires: libbonoboui >= 2.8
602 Requires: bonobo-activation
606 %if %{gconsole} && %{fc5}
607 Requires: gtk2 >= 2.8
608 Requires: libgnomeui >= 2.14
609 Requires: glibc >= 2.4
611 Requires: libart_lgpl >= 2.3
612 Requires: libbonobo >= 2.14
613 Requires: libbonoboui >= 2.14
617 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
618 Requires: gtk2 >= 2.0
619 Requires: libgnomeui >= 2.0
620 Requires: glibc >= 2.3
622 Requires: libart_lgpl >= 2.0
623 Requires: libbonobo >= 2.0
624 Requires: libbonoboui >= 2.0
625 Requires: bonobo-activation
630 %if %{gconsole} && %{su9}
633 %if %{gconsole} && %{su10}
636 %if %{gconsole} && ! %{su9} && ! %{su10}
641 %description gconsole
652 This is the Gnome Console package. It is an add-on to the client or
658 Summary: Bacula - The Network Backup Solution
659 Group: System Environment/Daemons
660 Requires: wxGTK >= 2.6, libstdc++, openssl
663 %if %{wxconsole} && %{su10}
664 Requires: gtk2 >= 2.8
667 %if %{wxconsole} && %{fc3}
668 Requires: gtk2 >= 2.4
671 %if %{wxconsole} && %{fc4}
672 Requires: gtk2 >= 2.6
675 %if %{wxconsole} && %{fc5}
676 Requires: gtk2 >= 2.8
680 %description wxconsole
691 This is the WXWindows Console package. It is an add-on to the client or
707 %if %{su9} || %{su10}
708 export LDFLAGS="-L/usr/lib/termcap"
719 # patches for the bundled sqlite scripts
720 # as of 1.38.0 first 3 patches no longer needed
722 # patch the make_sqlite_tables script for installation bindir
723 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
725 # patch the create_sqlite_database script for installation bindir
726 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
728 # patch the make_catalog_backup script for installation bindir
729 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
731 # patch the update_sqlite_tables script for installation bindir
732 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
734 # patch the bacula-dir init script to remove sqlite service
735 %if %{sqlite} && %{su9}
736 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
738 %if %{sqlite} && %{su10}
739 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
742 # 64 bit lib location hacks
744 export LDFLAGS=-L/usr/lib64
746 %if %{mysql} && %{x86_64}
747 export LDFLAGS=-L/usr/lib64/mysql
752 --sbindir=/usr/sbin \
753 --sysconfdir=/etc/bacula \
754 --with-scriptdir=/etc/bacula \
755 --enable-smartalloc \
756 --enable-client-only \
766 --sbindir=/usr/sbin \
767 --sysconfdir=/etc/bacula \
768 --with-scriptdir=/etc/bacula \
769 --enable-smartalloc \
773 %if %{gconsole} && ! %{rh8}
774 --enable-tray-monitor \
780 --with-sqlite=${cwd}/%{depkgs}/sqlite \
786 --enable-wx-console \
788 --with-working-dir=%{working_dir} \
789 --with-pid-dir=/var/run \
790 --with-subsys-dir=/var/lock/subsys \
791 --with-dir-user=%{director_daemon_user} \
792 --with-dir-group=%{daemon_group} \
793 --with-sd-user=%{storage_daemon_user} \
794 --with-sd-group=%{storage_daemon_group} \
795 --with-fd-user=%{file_daemon_user} \
796 --with-fd-group=%{daemon_group} \
797 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
798 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
799 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
800 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
801 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
802 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
810 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
811 mkdir -p $RPM_BUILD_ROOT/etc/init.d
812 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
813 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
814 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
815 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
816 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
818 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
820 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
821 %if %{gconsole} && ! %{su9} && ! %{su10}
822 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
823 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
824 mkdir -p $RPM_BUILD_ROOT/usr/bin
828 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
832 prefix=$RPM_BUILD_ROOT/usr \
833 sbindir=$RPM_BUILD_ROOT/usr/sbin \
834 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
835 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
836 working_dir=$RPM_BUILD_ROOT%{working_dir} \
841 prefix=$RPM_BUILD_ROOT/usr \
842 sbindir=$RPM_BUILD_ROOT/usr/sbin \
843 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
844 working_dir=$RPM_BUILD_ROOT%{working_dir} \
845 mandir=$RPM_BUILD_ROOT/usr/man \
849 # fixme - make installs the mysql scripts for sqlite build
851 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
852 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
853 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
856 # fixme - make installs the mysql scripts for postgresql build
858 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
859 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
862 # fixme - make installs gconsole script for build without gconsole
864 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
867 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
869 # install the init scripts
870 %if %{su9} || %{su10}
871 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
872 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
873 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
876 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
877 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
878 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
880 %if ! %{su9} && ! %{su10} && ! %{mdk}
881 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
882 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
883 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
885 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
887 # install the menu stuff
888 %if %{gconsole} && %{su9}
889 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
890 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
891 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
892 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
894 %if %{gconsole} && %{su10}
895 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
896 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
897 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
898 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
900 %if %{wxconsole} && %{su10}
901 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
902 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
904 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
909 %if %{gconsole} && %{iftrick}
910 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
911 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
912 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
913 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
914 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
916 %if %{gconsole} && ! %{rh8}
917 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
918 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
920 %if %{wxconsole} && %{iftrick}
921 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
922 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
923 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
924 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
925 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
930 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
931 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
932 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
935 # install the logrotate file
936 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
938 # install the updatedb scripts
939 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
941 # install the logwatch scripts
942 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
943 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
944 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
945 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
946 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
947 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
949 # install the rescue files
950 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
951 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
952 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
953 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
954 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
955 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
956 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
957 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
958 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
959 rm -f src/filed/static-bacula-fd
962 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
963 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
966 # now clean up permissions that are left broken by the install
967 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
968 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
969 %if %{gconsole} && ! %{rh8}
970 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
971 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
975 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
978 # MySQL specific files
980 %defattr(-, root, root)
981 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
982 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
983 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
984 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
985 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
986 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
987 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
988 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
993 %defattr(-,root,root)
994 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
995 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
996 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
997 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
998 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
999 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1000 %{sqlite_bindir}/libsqlite.a
1001 %{sqlite_bindir}/sqlite.h
1002 %{sqlite_bindir}/sqlite
1007 %defattr(-,root,root)
1008 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1009 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1010 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1011 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1012 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1013 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1016 # The rest is DB backend independent
1017 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1018 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1019 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1020 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1021 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1022 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1023 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1024 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1025 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1026 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1027 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1028 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1029 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1030 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1031 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1032 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1033 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1034 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1035 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1036 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1037 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1038 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1039 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1041 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1042 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1044 /etc/logrotate.d/bacula
1045 /etc/log.d/scripts/services/bacula
1046 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1047 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1048 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1049 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1050 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1051 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1052 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1053 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1055 /usr/sbin/bacula-dir
1063 /usr/sbin/btraceback
1072 # test for bacula database older than version 8
1073 # note: this ASSUMES no password has been set for bacula database
1074 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1079 # test for bacula database older than version 8
1080 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1081 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1086 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1089 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1090 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1091 echo "You appear to be running database version $DB_VER. You must first update"
1092 echo "your database to version 8 and then install this upgrade. The alternative"
1093 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1094 echo "catalog information, then do the upgrade. Information on updating a"
1095 echo "database older than version 8 can be found in the release notes."
1103 # check for and copy /etc/bacula/console.conf to bconsole.conf
1104 if [ -s /etc/bacula/console.conf ];then
1105 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1108 # create the daemon users and groups
1109 # first create the groups if they don't exist
1110 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1111 if [ -z "$HAVE_BACULA" ]; then
1112 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1113 echo "The group %{daemon_group} has been added to %{group_file}."
1114 echo "See the manual chapter \"Running Bacula\" for details."
1116 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1117 if [ -z "$HAVE_BACULA" ]; then
1118 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1119 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1120 echo "See the manual chapter \"Running Bacula\" for details."
1122 # now create the users if they do not exist
1123 # we do not use the -g option allowing the primary group to be set to system default
1124 # this will be a unique group on redhat type systems or the group users on some systems
1125 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1126 if [ -z "$HAVE_BACULA" ]; then
1127 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1128 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1129 echo "See the manual chapter \"Running Bacula\" for details."
1131 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1132 if [ -z "$HAVE_BACULA" ]; then
1133 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1134 echo "The user %{director_daemon_user} has been added to %{user_file}."
1135 echo "See the manual chapter \"Running Bacula\" for details."
1137 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1138 if [ -z "$HAVE_BACULA" ]; then
1139 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1140 echo "The user %{file_daemon_user} has been added to %{user_file}."
1141 echo "See the manual chapter \"Running Bacula\" for details."
1143 # now we add the supplementary groups, this is ok to call even if the users already exist
1144 # we only do this if the user is NOT root
1145 IS_ROOT=%{director_daemon_user}
1146 if [ "$IS_ROOT" != "root" ]; then
1147 %{usermod} -G %{daemon_group} %{director_daemon_user}
1149 IS_ROOT=%{storage_daemon_user}
1150 if [ "$IS_ROOT" != "root" ]; then
1151 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1153 IS_ROOT=%{file_daemon_user}
1154 if [ "$IS_ROOT" != "root" ]; then
1155 %{usermod} -G %{daemon_group} %{file_daemon_user}
1169 if [ "$1" -ge 1 ] ; then
1170 /sbin/chkconfig --add bacula-dir
1171 /sbin/chkconfig --add bacula-fd
1172 /sbin/chkconfig --add bacula-sd
1176 # test for an existing database
1177 # note: this ASSUMES no password has been set for bacula database
1178 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1180 # grant privileges and create tables if they do not exist
1181 if [ -z "$DB_VER" ]; then
1182 echo "Hmm, doesn't look like you have an existing database."
1183 echo "Granting privileges for MySQL user bacula..."
1184 /etc/bacula/grant_mysql_privileges
1185 echo "Creating MySQL bacula database..."
1186 /etc/bacula/create_mysql_database
1187 echo "Creating bacula tables..."
1188 /etc/bacula/make_mysql_tables
1190 # check to see if we need to upgrade a 1.36 or lower database
1191 elif [ "$DB_VER" -lt "9" ]; then
1192 echo "This release requires an upgrade to your bacula database."
1193 echo "Backing up your current database..."
1194 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1195 echo "Upgrading bacula database ..."
1196 /etc/bacula/update_mysql_tables
1197 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1203 # test for an existing database
1204 if [ -s %{working_dir}/bacula.db ]; then
1205 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1206 # check to see if we need to upgrade a 1.36 or lower database
1207 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1208 echo "This release requires an upgrade to your bacula database."
1209 echo "Backing up your current database..."
1210 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1211 echo "Upgrading bacula database ..."
1212 /etc/bacula/update_sqlite_tables
1213 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1216 # create the database and tables
1217 echo "Hmm, doesn't look like you have an existing database."
1218 echo "Creating SQLite database..."
1219 /etc/bacula/create_sqlite_database
1220 echo "Creating the SQLite tables..."
1221 /etc/bacula/make_sqlite_tables
1226 # test for an existing database
1227 # note: this ASSUMES no password has been set for bacula database
1228 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1230 # grant privileges and create tables if they do not exist
1231 if [ -z "$DB_VER" ]; then
1232 echo "Hmm, doesn't look like you have an existing database."
1233 echo "Creating PostgreSQL bacula database..."
1234 /etc/bacula/create_postgresql_database
1235 echo "Creating bacula tables..."
1236 /etc/bacula/make_postgresql_tables
1237 echo "Granting privileges for PostgreSQL user bacula..."
1238 /etc/bacula/grant_postgresql_privileges
1240 # check to see if we need to upgrade a 1.36 or lower database
1241 elif [ "$DB_VER" -lt "9" ]; then
1242 echo "This release requires an upgrade to your bacula database."
1243 echo "Backing up your current database..."
1244 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1245 echo "Upgrading bacula database ..."
1246 /etc/bacula/update_postgresql_tables
1247 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1252 # generate passwords if needed
1253 if [ -d /etc/bacula ]; then
1255 for file in *.conf; do
1256 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
1257 need_password=`grep $string $file 2>/dev/null`
1258 if [ -n "$need_password" ]; then
1259 pass=`openssl rand -base64 33`
1260 sed "s-$string-$pass-g" $file > $file.new
1261 cp -f $file.new $file; rm -f $file.new
1279 /sbin/chkconfig --del bacula-dir
1280 /sbin/chkconfig --del bacula-fd
1281 /sbin/chkconfig --del bacula-sd
1286 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1287 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1288 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1289 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1294 %defattr(-,root,root)
1295 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1296 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1297 /etc/init.d/bacula-fd
1298 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1300 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1301 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1303 /etc/logrotate.d/bacula
1305 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1306 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1307 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1310 /usr/sbin/btraceback
1311 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1312 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1318 # create the daemon group and user
1319 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1320 if [ -z "$HAVE_BACULA" ]; then
1321 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1322 echo "The group %{daemon_group} has been added to %{group_file}."
1323 echo "See the manual chapter \"Running Bacula\" for details."
1325 # we do not use the -g option allowing the primary group to be set to system default
1326 # this will be a unique group on redhat type systems or the group users on some systems
1327 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1328 if [ -z "$HAVE_BACULA" ]; then
1329 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1330 echo "The user %{file_daemon_user} has been added to %{user_file}."
1331 echo "See the manual chapter \"Running Bacula\" for details."
1333 # now we add the supplementary group, this is ok to call even if the user already exists
1334 # we only do this if the user is NOT root
1335 IS_ROOT=%{file_daemon_user}
1336 if [ "$IS_ROOT" != "root" ]; then
1337 %{usermod} -G %{daemon_group} %{file_daemon_user}
1342 if [ "$1" -ge 1 ] ; then
1343 /sbin/chkconfig --add bacula-fd
1346 # generate passwords if needed
1347 if [ -d /etc/bacula ]; then
1349 for file in *.conf; do
1350 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
1351 need_password=`grep $string $file 2>/dev/null`
1352 if [ -n "$need_password" ]; then
1353 pass=`openssl rand -base64 33`
1354 sed "s-$string-$pass-g" $file > $file.new
1355 cp -f $file.new $file; rm -f $file.new
1364 /sbin/chkconfig --del bacula-fd
1368 %defattr(-,root,%{daemon_group})
1369 /etc/bacula/updatedb/*
1372 # create the daemon group
1373 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1374 if [ -z "$HAVE_BACULA" ]; then
1375 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1376 echo "The group %{daemon_group} has been added to %{group_file}."
1377 echo "See the manual chapter \"Running Bacula\" for details."
1381 echo "The database update scripts were installed to /etc/bacula/updatedb"
1385 %defattr(-,root,root)
1386 /usr/sbin/gnome-console
1387 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1388 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1389 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1390 /usr/share/pixmaps/bacula.png
1391 /usr/share/applications/bacula.desktop
1394 %if %{gconsole} && ! %{rh8}
1395 /usr/sbin/bacula-tray-monitor
1396 %config(noreplace) /etc/bacula/tray-monitor.conf
1397 /usr/share/pixmaps/bacula-tray-monitor.xpm
1398 /usr/share/applications/bacula-tray-monitor.desktop
1401 %if %{gconsole} && ! %{su9} && ! %{su10}
1402 # add the console helper files
1403 %config(noreplace,missingok) /etc/pam.d/gnome-console
1404 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1405 /usr/bin/gnome-console
1410 # create the daemon group
1411 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1412 if [ -z "$HAVE_BACULA" ]; then
1413 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1414 echo "The group %{daemon_group} has been added to %{group_file}."
1415 echo "See the manual chapter \"Running Bacula\" for details."
1419 # generate passwords if needed
1420 if [ -d /etc/bacula ]; then
1422 for file in *.conf; do
1423 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
1424 need_password=`grep $string $file 2>/dev/null`
1425 if [ -n "$need_password" ]; then
1426 pass=`openssl rand -base64 33`
1427 sed "s-$string-$pass-g" $file > $file.new
1428 cp -f $file.new $file; rm -f $file.new
1437 %defattr(-,root,root)
1439 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1440 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1441 /usr/share/pixmaps/wxwin16x16.xpm
1442 /usr/share/applications/wxconsole.desktop
1445 %if %{wxconsole} && ! %{su9} && ! %{su10}
1446 # add the console helper files
1447 %config(noreplace,missingok) /etc/pam.d/wxconsole
1448 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1454 # create the daemon group
1455 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1456 if [ -z "$HAVE_BACULA" ]; then
1457 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1458 echo "The group %{daemon_group} has been added to %{group_file}."
1459 echo "See the manual chapter \"Running Bacula\" for details."
1463 # generate passwords if needed
1464 if [ -d /etc/bacula ]; then
1466 for file in *.conf; do
1467 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
1468 need_password=`grep $string $file 2>/dev/null`
1469 if [ -n "$need_password" ]; then
1470 pass=`openssl rand -base64 33`
1471 sed "s-$string-$pass-g" $file > $file.new
1472 cp -f $file.new $file; rm -f $file.new
1480 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1481 - update depkgs to 25Jun06
1482 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1483 - 1.38.10 bump rescue version
1484 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1485 - fix usermod statements
1487 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1488 - add -g param back to useradd statements Bug 605
1489 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1490 - redundant code cleanup
1491 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1492 - add wxconsole package
1493 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1495 - dependency update for Mandriva
1496 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1498 - remove -n option from useradd scripts
1499 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - fix problem specifying more than one primary group for user bacula
1502 - add build switch to not build gconsole regardless of platform
1503 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add centos3 build tag
1505 - fix link error of static-fd on Mandrake with --disable-nls
1506 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1507 - add fc4 dependencies
1508 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1509 - add SuSE 10.0 build
1510 - remove specific permission in attrib macros
1511 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1514 - refix compat for _dist on SLES9 which seems to have been removed
1515 - added note regarding Aleksandar's use of specific permissions in attrib macros
1516 - need to review and add specific fc4 build currently using fc3 Requires
1517 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1519 - Reorganize files and pre/post sections to remove repetitions
1520 - Always build separate mtx package
1521 - Fix file ownerships for /etc/bacula and Bacula's working dir
1522 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1523 - Disable GNOME on RH7
1524 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1525 - Red Hat and look alikes have mtx RPM, do not build/package our version
1526 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1527 - minor edit to _dist for SLES9 compatibility
1528 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1530 - kern changed location of pdf files and html manual in docs package
1531 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - add docs (from prebuilt tarball) and rescue packages back in
1534 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1535 - remove 3 of 4 sqlite script patches as not needed
1536 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1538 - remove docs and rescue sections (remove static fd)
1539 - add dvd-freespace and dvd-writepart files
1540 - update depkgs to 22Jun05
1541 - change database update to 8 to 9
1542 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - minor cleanups before 1.38 changes
1544 - add popt and popt-devel build dependencies
1545 - add tetex and tetex-dvips dependencies for doc build
1546 - replace deprecated Copyright tag with License
1547 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1549 - conflict with sqlite packages. remove readline dependency.
1550 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 - release 1.36.3 update docs
1552 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1553 - add centos4 build tag
1554 - add x86_64 build tag
1555 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1556 - add rhel4 build tag
1557 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1558 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1559 - add rhel3 build tag
1560 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1561 - fix tray-monitor.conf for noreplace
1562 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1563 - fix distribution check for Fedora and Whitebox
1564 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1565 - add logwatch script
1567 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1568 - add build for Fedora Core 3 (linc now included in ORDit2)
1569 - add mysql4 define for Mandrake 10.1
1570 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1571 - fix {group_file} variable in post scripts
1572 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1573 - add distribution checking and custom Distribution tag
1574 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1575 - ASSIGNMENT OF COPYRIGHT
1576 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1577 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1578 - all right, title and interest in and to the copyright in this software RPM
1579 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1580 - free of all liens, encumbrances or any known claims against said copyright.
1581 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1583 - thanks to Daniel Widyono
1584 - update description for rescue package to describe cdrom creation
1585 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1586 - update depkgs to 29Oct04
1587 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1588 - add cdrom rescue to bacula-rescue package
1589 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1590 - misc fixes from 1.36.0 suse feedback
1591 - fix situation where sqlite database exists but sqlite has been removed.
1592 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1593 - remove tray-monitor from RH8 build
1594 - fix permissions on tray-monitor files
1595 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1596 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1597 - change database update to 7 to 8 upgrade,
1598 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1599 - build in 30Jul04, add freetype dependancy to gnome package.
1600 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1601 - add documentation to console for groupadd
1602 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1603 - add support for running daemons as root.bacula
1604 - correct for change in location of floppy rescue files in 1.35.2
1605 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1606 - updated depgkgs to 30Jul04
1607 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1608 - really, really fix symlink creation for gconsole
1609 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1610 - fix symlink creation in gconsole post install
1611 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1612 - fixed error in gconsole post script
1613 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1614 - add check for gconsole symlink before trying to create it
1615 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1616 - fix some minor permissions issues on doc files that CVS won't let us fix
1617 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1618 - add pkgconfig to BuildRequires
1619 - clean up gnome1/2 menu entries for appropriate packages
1620 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1621 - tightened up doc distribution
1622 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1623 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1624 - rpm's horrible bug that prevents nested conditional macros prevents me
1625 - from implementing these 2 separate approaches within the conditionals which
1626 - create the separate server packages.
1627 - the solution adopted is to remove the gnome-console files from the server packages
1628 - so bacula-gconsole is now an add on for both client and server packages.
1629 - this also now allows the server packages to be install on machines without
1630 - an X-server and we can still maintain a single spec file.
1631 - added tests to make sure we have defined platform and database macros.
1632 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1633 - corrected mysql prerequisites for suse
1634 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1635 - replaced all cp commands with cp -p
1636 - removed addition of a+x permissions on gnome-console
1637 - corrected permissions on init scripts
1638 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1639 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1641 - various cleanup patches from Michael K. Johnson:
1642 - corrected post install routines for nicer chkconfig
1643 - removed chmod changes in post routines and moved to install section
1644 - removed interactive nature of post routine for rescue package
1645 - added description of building rescue disks to the description of rescue package
1646 - added clean of build root to beginning of install
1647 - removed specifying attr in all file lists
1648 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1649 - added bconsole to client package
1650 - added gconsole package as add-on to client
1651 - removed spurious dependancies on updatedb package (!cut/paste)
1652 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1653 - added updatedb package
1654 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1655 - added postgresql package
1656 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1657 - corrected the if else logic in the dependancy sections
1658 - changes for 1.34 release
1659 - /etc/bacula/console is now /etc/bacula/bconsole
1660 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1661 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1662 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1663 - added new /etc/bacula/drop_mysql_database
1664 - added new /etc/bacula/drop_sqlite_database
1665 - added new /etc/bacula/grant_sqlite_privileges
1666 - added new generic bacula database scripts in /etc/bacula
1667 - added pre-install sections to check for database versions older than 6
1668 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1669 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1670 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1671 - added testing for existing databases before executing any of the database creation scripts
1672 - added defines working_dir and sqlite_bindir in place of hard coded paths
1673 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1674 - added build configuration for SuSE.
1675 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1676 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1677 - added patch for create_sqlite_database to fix the installed bindir
1678 - added execute of create_sqlite_database to post of sqlite package
1679 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1680 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1681 - added bacula-fd as Requires for rescue package
1682 - added build tag for Fedora Core 1
1683 - cleaned up dependancies for all builds
1684 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1685 - removed rh_version from package names
1686 - added platform build configuration section to beginning of file
1687 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1688 - removed make_static_bacula script from rescue package install
1689 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1690 - Added define at top of file for depkgs version
1691 - Added rescue sub-package
1692 - Moved requires statements into proper sub-package locations
1693 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1694 - Corrected Requires for Gnome 1.4/2.0 builds
1695 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1696 - Added separate source declaration for depkgs
1697 - added patch for make_catalog_backup script
1698 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1699 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1700 - Added rh_version to sub-package names
1701 - Added installed but missing file /etc/bacula/gconsole
1702 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1703 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1704 - Update spec for version 1.31 and combine client
1705 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>