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
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 BuildRoot: %{_tmppath}/%{name}-root
173 URL: http://www.bacula.org/
174 Vendor: The Bacula Team
175 Distribution: %{_dist}
176 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
178 %define _docsrc ../%{name}-docs-%{version}
179 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
181 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
182 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
183 BuildRequires: openssl-devel
185 BuildRequires: pkgconfig
188 BuildRequires: libtermcap-devel
189 BuildRequires: glibc-devel >= 2.2
192 BuildRequires: termcap
193 BuildRequires: glibc-devel >= 2.3
195 %if %{su9} && %{gconsole}
196 BuildRequires: libgnome >= 2.0
197 BuildRequires: gtk2-devel >= 2.0
198 BuildRequires: libgnomeui-devel >= 2.0
199 BuildRequires: ORBit2-devel
200 BuildRequires: libart_lgpl-devel >= 2.0
201 BuildRequires: libbonobo-devel >= 2.0
202 BuildRequires: libbonoboui-devel >= 2.0
203 BuildRequires: bonobo-activation-devel
204 BuildRequires: gconf2-devel
205 BuildRequires: linc-devel
206 BuildRequires: freetype2-devel
209 BuildRequires: termcap
210 BuildRequires: glibc-devel >= 2.3
212 %if %{su10} && %{gconsole}
213 BuildRequires: libgnome >= 2.12
214 BuildRequires: gtk2-devel >= 2.8
215 BuildRequires: libgnomeui-devel >= 2.12
216 BuildRequires: ORBit2-devel
217 BuildRequires: libart_lgpl-devel >= 2.3
218 BuildRequires: libbonobo-devel >= 2.10
219 BuildRequires: libbonoboui-devel >= 2.10
220 BuildRequires: bonobo-activation-devel
221 BuildRequires: gconf2-devel
222 BuildRequires: freetype2-devel
223 BuildRequires: cairo-devel
224 BuildRequires: fontconfig-devel >= 2.3
225 BuildRequires: gnome-vfs2-devel >= 2.12
226 BuildRequires: libpng-devel
229 BuildRequires: libtermcap-devel
230 BuildRequires: libstdc++-static-devel
231 BuildRequires: glibc-static-devel
232 BuildRequires: glibc-devel >= 2.3
234 %if %{mdk} && !%{mdv} && %{gconsole}
235 BuildRequires: gtk2-devel >= 2.0
236 BuildRequires: libgnomeui2-devel >= 2.0
237 BuildRequires: libORBit2-devel
238 BuildRequires: libart_lgpl-devel >= 2.0
239 BuildRequires: libbonobo2_0-devel
240 BuildRequires: libbonoboui2_0-devel
241 BuildRequires: libbonobo-activation-devel
242 BuildRequires: libGConf2-devel
243 BuildRequires: freetype2-devel
245 %if %{mdv} && %{gconsole}
246 BuildRequires: gtk2-devel >= 2.8
247 BuildRequires: libgnomeui2-devel >= 2.10
248 BuildRequires: libORBit2-devel
249 BuildRequires: libart_lgpl-devel >= 2.3
250 BuildRequires: libbonobo2_0-devel
251 BuildRequires: libbonoboui2_0-devel
252 BuildRequires: libbonobo-activation-devel
253 BuildRequires: libGConf2-devel
254 BuildRequires: freetype2-devel
257 BuildRequires: libtermcap-devel
258 BuildRequires: glibc-devel >= 2.3
260 %if %{fc3} && %{gconsole}
261 BuildRequires: gtk2-devel >= 2.4
262 BuildRequires: libgnomeui-devel >= 2.8
263 BuildRequires: ORBit2-devel
264 BuildRequires: libart_lgpl-devel >= 2.3
265 BuildRequires: libbonobo-devel >= 2.8
266 BuildRequires: libbonoboui-devel >= 2.8
267 BuildRequires: bonobo-activation-devel
268 BuildRequires: GConf2-devel
269 BuildRequires: freetype-devel
272 BuildRequires: libtermcap-devel
273 BuildRequires: glibc-devel >= 2.3
275 %if %{fc4} && %{gconsole}
276 BuildRequires: gtk2-devel >= 2.6
277 BuildRequires: libgnomeui-devel >= 2.10
278 BuildRequires: ORBit2-devel
279 BuildRequires: libart_lgpl-devel >= 2.3
280 BuildRequires: libbonobo-devel >= 2.8
281 BuildRequires: libbonoboui-devel >= 2.8
282 BuildRequires: bonobo-activation-devel
283 BuildRequires: GConf2-devel
284 BuildRequires: freetype-devel
287 BuildRequires: libtermcap-devel
288 BuildRequires: glibc-devel >= 2.4
290 %if %{fc5} && %{gconsole}
291 BuildRequires: gtk2-devel >= 2.8
292 BuildRequires: libgnomeui-devel >= 2.14
293 BuildRequires: ORBit2-devel
294 BuildRequires: libart_lgpl-devel >= 2.3
295 BuildRequires: libbonobo-devel >= 2.14
296 BuildRequires: libbonoboui-devel >= 2.14
297 BuildRequires: GConf2-devel
298 BuildRequires: freetype-devel
300 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
301 BuildRequires: libtermcap-devel
302 BuildRequires: glibc-devel >= 2.3
304 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
305 BuildRequires: gtk2-devel >= 2.0
306 BuildRequires: libgnomeui-devel >= 2.0
307 BuildRequires: ORBit2-devel
308 BuildRequires: libart_lgpl-devel >= 2.0
309 BuildRequires: libbonobo-devel >= 2.0
310 BuildRequires: libbonoboui-devel >= 2.0
311 BuildRequires: bonobo-activation-devel
312 BuildRequires: GConf2-devel
313 BuildRequires: linc-devel
314 BuildRequires: freetype-devel
317 %if %{mysql} && ! %{mysql4}
318 BuildRequires: mysql-devel >= 3.23
321 %if %{mysql} && %{mysql4}
322 BuildRequires: mysql-devel >= 4.0
325 %if %{postgresql} && %{wb3}
326 BuildRequires: rh-postgresql-devel >= 7
329 %if %{postgresql} && ! %{wb3}
330 BuildRequires: postgresql-devel >= 7
334 BuildRequires: wxGTK-devel >= 2.6
358 Summary: Bacula - The Network Backup Solution
359 Group: System Environment/Daemons
360 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
361 Conflicts: bacula-client
362 Obsoletes: bacula-rescue
363 Requires: ncurses, libstdc++, zlib, openssl, mtx
366 Requires: glibc >= 2.2
369 %if %{su9} || %{su10}
370 Requires: glibc >= 2.3
373 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
374 Requires: glibc >= 2.3
378 Requires: glibc >= 2.4
382 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
383 Requires: mysql >= 3.23
384 Requires: mysql-server >= 3.23
386 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
387 Requires: mysql >= 4.0
388 Requires: mysql-server >= 4.0
391 %if %{mysql} && %{su9} && ! %{mysql4}
392 Requires: mysql >= 3.23
393 Requires: mysql-client >= 3.23
395 %if %{mysql} && %{su9} && %{mysql4}
396 Requires: mysql >= 4.0
397 Requires: mysql-client >= 4.0
399 %if %{mysql} && %{su10} && %{mysql4}
400 Requires: mysql >= 4.0
401 Requires: mysql-client >= 4.0
404 %if %{mysql} && %{mdk} && ! %{mysql4}
405 Requires: mysql >= 3.23
406 Requires: mysql-client >= 3.23
408 %if %{mysql} && %{mdk} && %{mysql4}
409 Requires: mysql >= 4.0
410 Requires: mysql-client >= 4.0
413 %if %{postgresql} && %{wb3}
414 Requires: rh-postgresql >= 7
415 Requires: rh-postgresql-server >= 7
417 %if %{postgresql} && ! %{wb3}
418 Requires: postgresql >= 7
419 Requires: postgresql-server >= 7
429 %description postgresql
443 This build requires MySQL to be installed separately as the catalog database.
446 This build requires PostgreSQL to be installed separately as the catalog database.
449 This build incorporates sqlite as the catalog database, statically compiled.
453 Summary: Bacula - The Network Backup Solution
454 Group: System Environment/Daemons
458 This is Bacula's version of mtx tape utilities for Linux distributions that
459 do not provide their own mtx package
462 Summary: Bacula - The Network Backup Solution
463 Group: System Environment/Daemons
465 Conflicts: bacula-mysql
466 Conflicts: bacula-sqlite
467 Conflicts: bacula-postgresql
468 Obsoletes: bacula-rescue
469 Requires: libstdc++, zlib, openssl
472 Requires: glibc >= 2.2
475 %if %{su9} || %{su10}
476 Requires: glibc >= 2.3
479 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
480 Requires: glibc >= 2.3
484 Requires: glibc >= 2.4
499 This is the File daemon (Client) only package. It includes the command line
504 Summary: Bacula - The Network Backup Solution
505 Group: System Environment/Daemons
507 %description updatedb
518 This package installs scripts for updating older versions of the bacula
523 Summary: Bacula - The Network Backup Solution
524 Group: System Environment/Daemons
525 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
528 %if %{gconsole} && %{su9}
529 Requires: gtk2 >= 2.0
530 Requires: libgnome >= 2.0
531 Requires: libgnomeui >= 2.0
532 Requires: glibc >= 2.3
534 Requires: libart_lgpl >= 2.0
535 Requires: libbonobo >= 2.0
536 Requires: libbonoboui >= 2.0
537 Requires: bonobo-activation
542 %if %{gconsole} && %{su10}
543 Requires: gtk2 >= 2.8
544 Requires: libgnome >= 2.12
545 Requires: libgnomeui >= 2.12
546 Requires: glibc >= 2.3
548 Requires: libart_lgpl >= 2.3
549 Requires: libbonobo >= 2.10
550 Requires: libbonoboui >= 2.10
551 Requires: bonobo-activation
555 Requires: fontconfig >= 2.3
556 Requires: gnome-vfs2 >= 2.12
559 %if %{gconsole} && %{mdk} && !%{mdv}
560 Requires: gtk2 >= 2.0
561 Requires: libgnomeui2
562 Requires: glibc >= 2.3
564 Requires: libart_lgpl >= 2.0
565 Requires: libbonobo >= 2.0
566 Requires: libbonoboui >= 2.0
570 %if %{gconsole} && %{mdv}
571 Requires: gtk2 >= 2.8
572 Requires: libgnomeui2
573 Requires: glibc >= 2.3
575 Requires: libart_lgpl >= 2.3
576 Requires: libbonobo >= 2.10
577 Requires: libbonoboui >= 2.10
581 %if %{gconsole} && %{fc3}
582 Requires: gtk2 >= 2.4
583 Requires: libgnomeui >= 2.8
584 Requires: glibc >= 2.3
586 Requires: libart_lgpl >= 2.3
587 Requires: libbonobo >= 2.8
588 Requires: libbonoboui >= 2.8
589 Requires: bonobo-activation
593 %if %{gconsole} && %{fc4}
594 Requires: gtk2 >= 2.6
595 Requires: libgnomeui >= 2.10
596 Requires: glibc >= 2.3
598 Requires: libart_lgpl >= 2.3
599 Requires: libbonobo >= 2.8
600 Requires: libbonoboui >= 2.8
601 Requires: bonobo-activation
605 %if %{gconsole} && %{fc5}
606 Requires: gtk2 >= 2.8
607 Requires: libgnomeui >= 2.14
608 Requires: glibc >= 2.4
610 Requires: libart_lgpl >= 2.3
611 Requires: libbonobo >= 2.14
612 Requires: libbonoboui >= 2.14
616 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
617 Requires: gtk2 >= 2.0
618 Requires: libgnomeui >= 2.0
619 Requires: glibc >= 2.3
621 Requires: libart_lgpl >= 2.0
622 Requires: libbonobo >= 2.0
623 Requires: libbonoboui >= 2.0
624 Requires: bonobo-activation
629 %if %{gconsole} && %{su9}
632 %if %{gconsole} && %{su10}
635 %if %{gconsole} && ! %{su9} && ! %{su10}
640 %description gconsole
651 This is the Gnome Console package. It is an add-on to the client or
657 Summary: Bacula - The Network Backup Solution
658 Group: System Environment/Daemons
659 Requires: wxGTK >= 2.6, libstdc++, openssl
662 %if %{wxconsole} && %{su10}
663 Requires: gtk2 >= 2.8
666 %if %{wxconsole} && %{fc3}
667 Requires: gtk2 >= 2.4
670 %if %{wxconsole} && %{fc4}
671 Requires: gtk2 >= 2.6
674 %if %{wxconsole} && %{fc5}
675 Requires: gtk2 >= 2.8
679 %description wxconsole
690 This is the WXWindows Console package. It is an add-on to the client or
704 %if %{su9} || %{su10}
705 export LDFLAGS="-L/usr/lib/termcap"
716 # patches for the bundled sqlite scripts
717 # as of 1.38.0 first 3 patches no longer needed
719 # patch the make_sqlite_tables script for installation bindir
720 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
722 # patch the create_sqlite_database script for installation bindir
723 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
725 # patch the make_catalog_backup script for installation bindir
726 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
728 # patch the update_sqlite_tables script for installation bindir
729 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
731 # patch the bacula-dir init script to remove sqlite service
732 %if %{sqlite} && %{su9}
733 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
735 %if %{sqlite} && %{su10}
736 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
739 # 64 bit lib location hacks
741 export LDFLAGS=-L/usr/lib64
743 %if %{mysql} && %{x86_64}
744 export LDFLAGS=-L/usr/lib64/mysql
749 --sbindir=/usr/sbin \
750 --sysconfdir=/etc/bacula \
751 --with-scriptdir=/etc/bacula \
752 --enable-smartalloc \
753 --enable-client-only \
763 --sbindir=/usr/sbin \
764 --sysconfdir=/etc/bacula \
765 --with-scriptdir=/etc/bacula \
766 --enable-smartalloc \
770 %if %{gconsole} && ! %{rh8}
771 --enable-tray-monitor \
777 --with-sqlite=${cwd}/%{depkgs}/sqlite \
783 --enable-wx-console \
785 --with-working-dir=%{working_dir} \
786 --with-pid-dir=/var/run \
787 --with-subsys-dir=/var/lock/subsys \
788 --with-dir-user=%{director_daemon_user} \
789 --with-dir-group=%{daemon_group} \
790 --with-sd-user=%{storage_daemon_user} \
791 --with-sd-group=%{storage_daemon_group} \
792 --with-fd-user=%{file_daemon_user} \
793 --with-fd-group=%{daemon_group} \
794 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
795 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
796 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
797 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
798 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
799 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
807 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
808 mkdir -p $RPM_BUILD_ROOT/etc/init.d
809 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
810 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
811 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
812 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
813 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
815 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
817 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
818 %if %{gconsole} && ! %{su9} && ! %{su10}
819 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
820 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
821 mkdir -p $RPM_BUILD_ROOT/usr/bin
825 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
829 prefix=$RPM_BUILD_ROOT/usr \
830 sbindir=$RPM_BUILD_ROOT/usr/sbin \
831 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
832 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
833 working_dir=$RPM_BUILD_ROOT%{working_dir} \
838 prefix=$RPM_BUILD_ROOT/usr \
839 sbindir=$RPM_BUILD_ROOT/usr/sbin \
840 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
841 working_dir=$RPM_BUILD_ROOT%{working_dir} \
842 mandir=$RPM_BUILD_ROOT/usr/man \
846 # fixme - make installs the mysql scripts for sqlite build
848 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
849 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
850 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
853 # fixme - make installs the mysql scripts for postgresql build
855 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
856 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
859 # fixme - make installs gconsole script for build without gconsole
861 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
864 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
866 # install the init scripts
867 %if %{su9} || %{su10}
868 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
869 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
870 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
873 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
874 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
875 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
877 %if ! %{su9} && ! %{su10} && ! %{mdk}
878 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
879 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
880 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
882 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
884 # install the menu stuff
885 %if %{gconsole} && %{su9}
886 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
887 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
888 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
889 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
891 %if %{gconsole} && %{su10}
892 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
893 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
894 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
895 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
897 %if %{wxconsole} && %{su10}
898 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
899 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
901 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
906 %if %{gconsole} && %{iftrick}
907 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
908 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
909 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
910 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
911 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
913 %if %{gconsole} && ! %{rh8}
914 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
915 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
917 %if %{wxconsole} && %{iftrick}
918 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
919 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
920 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
921 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
922 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
927 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
928 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
929 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
932 # install the logrotate file
933 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
935 # install the updatedb scripts
936 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
938 # install the logwatch scripts
939 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
940 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
941 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
942 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
943 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
944 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
946 # install the rescue files
947 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
948 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
949 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
950 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
951 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
952 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
953 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
954 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
955 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
956 rm -f src/filed/static-bacula-fd
959 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
960 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
963 # now clean up permissions that are left broken by the install
964 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
965 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
966 %if %{gconsole} && ! %{rh8}
967 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
968 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
972 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
975 # MySQL specific files
977 %defattr(-, root, root)
978 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
979 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
980 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
981 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
982 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
983 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
984 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
985 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
990 %defattr(-,root,root)
991 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
992 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
993 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
994 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
995 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
996 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
997 %{sqlite_bindir}/libsqlite.a
998 %{sqlite_bindir}/sqlite.h
999 %{sqlite_bindir}/sqlite
1004 %defattr(-,root,root)
1005 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1006 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1007 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1008 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1009 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1010 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1013 # The rest is DB backend independent
1014 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1015 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1016 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1017 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1018 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1019 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1020 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1021 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1022 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1023 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1024 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1025 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1026 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1027 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1028 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1029 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1030 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1031 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1032 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1033 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1034 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1035 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1036 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1038 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1039 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1041 /etc/logrotate.d/bacula
1042 /etc/log.d/scripts/services/bacula
1043 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1044 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1045 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1046 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1047 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1048 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1049 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1050 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1052 /usr/sbin/bacula-dir
1060 /usr/sbin/btraceback
1069 # test for bacula database older than version 8
1070 # note: this ASSUMES no password has been set for bacula database
1071 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1076 # test for bacula database older than version 8
1077 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1078 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1083 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1086 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1087 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1088 echo "You appear to be running database version $DB_VER. You must first update"
1089 echo "your database to version 8 and then install this upgrade. The alternative"
1090 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1091 echo "catalog information, then do the upgrade. Information on updating a"
1092 echo "database older than version 8 can be found in the release notes."
1100 # check for and copy /etc/bacula/console.conf to bconsole.conf
1101 if [ -s /etc/bacula/console.conf ];then
1102 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1105 # create the daemon users and groups
1106 # first create the groups if they don't exist
1107 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1108 if [ -z "$HAVE_BACULA" ]; then
1109 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1110 echo "The group %{daemon_group} has been added to %{group_file}."
1111 echo "See the manual chapter \"Running Bacula\" for details."
1113 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1114 if [ -z "$HAVE_BACULA" ]; then
1115 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1116 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1117 echo "See the manual chapter \"Running Bacula\" for details."
1119 # now create the users if they do not exist
1120 # we do not use the -g option allowing the primary group to be set to system default
1121 # this will be a unique group on redhat type systems or the group users on some systems
1122 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1123 if [ -z "$HAVE_BACULA" ]; then
1124 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1125 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1126 echo "See the manual chapter \"Running Bacula\" for details."
1128 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1129 if [ -z "$HAVE_BACULA" ]; then
1130 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1131 echo "The user %{director_daemon_user} has been added to %{user_file}."
1132 echo "See the manual chapter \"Running Bacula\" for details."
1134 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1135 if [ -z "$HAVE_BACULA" ]; then
1136 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1137 echo "The user %{file_daemon_user} has been added to %{user_file}."
1138 echo "See the manual chapter \"Running Bacula\" for details."
1140 # now we add the supplementary groups, this is ok to call even if the users already exist
1141 # we only do this if the user is NOT root
1142 IS_ROOT=%{director_daemon_user}
1143 if [ "$IS_ROOT" != "root" ]; then
1144 %{usermod} -G %{daemon_group} %{director_daemon_user}
1146 IS_ROOT=%{storage_daemon_user}
1147 if [ "$IS_ROOT" != "root" ]; then
1148 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1150 IS_ROOT=%{file_daemon_user}
1151 if [ "$IS_ROOT" != "root" ]; then
1152 %{usermod} -G %{daemon_group} %{file_daemon_user}
1166 if [ "$1" -ge 1 ] ; then
1167 /sbin/chkconfig --add bacula-dir
1168 /sbin/chkconfig --add bacula-fd
1169 /sbin/chkconfig --add bacula-sd
1173 # test for an existing database
1174 # note: this ASSUMES no password has been set for bacula database
1175 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1177 # grant privileges and create tables if they do not exist
1178 if [ -z "$DB_VER" ]; then
1179 echo "Hmm, doesn't look like you have an existing database."
1180 echo "Granting privileges for MySQL user bacula..."
1181 /etc/bacula/grant_mysql_privileges
1182 echo "Creating MySQL bacula database..."
1183 /etc/bacula/create_mysql_database
1184 echo "Creating bacula tables..."
1185 /etc/bacula/make_mysql_tables
1187 # check to see if we need to upgrade a 1.36 or lower database
1188 elif [ "$DB_VER" -lt "9" ]; then
1189 echo "This release requires an upgrade to your bacula database."
1190 echo "Backing up your current database..."
1191 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1192 echo "Upgrading bacula database ..."
1193 /etc/bacula/update_mysql_tables
1194 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1200 # test for an existing database
1201 if [ -s %{working_dir}/bacula.db ]; then
1202 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1203 # check to see if we need to upgrade a 1.36 or lower database
1204 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1205 echo "This release requires an upgrade to your bacula database."
1206 echo "Backing up your current database..."
1207 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1208 echo "Upgrading bacula database ..."
1209 /etc/bacula/update_sqlite_tables
1210 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1213 # create the database and tables
1214 echo "Hmm, doesn't look like you have an existing database."
1215 echo "Creating SQLite database..."
1216 /etc/bacula/create_sqlite_database
1217 echo "Creating the SQLite tables..."
1218 /etc/bacula/make_sqlite_tables
1223 # test for an existing database
1224 # note: this ASSUMES no password has been set for bacula database
1225 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1227 # grant privileges and create tables if they do not exist
1228 if [ -z "$DB_VER" ]; then
1229 echo "Hmm, doesn't look like you have an existing database."
1230 echo "Creating PostgreSQL bacula database..."
1231 /etc/bacula/create_postgresql_database
1232 echo "Creating bacula tables..."
1233 /etc/bacula/make_postgresql_tables
1234 echo "Granting privileges for PostgreSQL user bacula..."
1235 /etc/bacula/grant_postgresql_privileges
1237 # check to see if we need to upgrade a 1.36 or lower database
1238 elif [ "$DB_VER" -lt "9" ]; then
1239 echo "This release requires an upgrade to your bacula database."
1240 echo "Backing up your current database..."
1241 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1242 echo "Upgrading bacula database ..."
1243 /etc/bacula/update_postgresql_tables
1244 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1249 # generate passwords if needed
1250 if [ -d /etc/bacula ]; then
1252 for file in *.conf; do
1253 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
1254 need_password=`grep $string $file 2>/dev/null`
1255 if [ -n "$need_password" ]; then
1256 pass=`openssl rand -base64 33`
1257 sed "s-$string-$pass-g" $file > $file.new
1258 cp -f $file.new $file; rm -f $file.new
1276 /sbin/chkconfig --del bacula-dir
1277 /sbin/chkconfig --del bacula-fd
1278 /sbin/chkconfig --del bacula-sd
1283 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1284 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1285 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1286 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1291 %defattr(-,root,root)
1292 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1293 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1294 /etc/init.d/bacula-fd
1295 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1297 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1298 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1300 /etc/logrotate.d/bacula
1302 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1303 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1304 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1307 /usr/sbin/btraceback
1308 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1309 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1315 # create the daemon group and user
1316 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1317 if [ -z "$HAVE_BACULA" ]; then
1318 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1319 echo "The group %{daemon_group} has been added to %{group_file}."
1320 echo "See the manual chapter \"Running Bacula\" for details."
1322 # we do not use the -g option allowing the primary group to be set to system default
1323 # this will be a unique group on redhat type systems or the group users on some systems
1324 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1325 if [ -z "$HAVE_BACULA" ]; then
1326 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1327 echo "The user %{file_daemon_user} has been added to %{user_file}."
1328 echo "See the manual chapter \"Running Bacula\" for details."
1330 # now we add the supplementary group, this is ok to call even if the user already exists
1331 # we only do this if the user is NOT root
1332 IS_ROOT=%{file_daemon_user}
1333 if [ "$IS_ROOT" != "root" ]; then
1334 %{usermod} -G %{daemon_group} %{file_daemon_user}
1339 if [ "$1" -ge 1 ] ; then
1340 /sbin/chkconfig --add bacula-fd
1343 # generate passwords if needed
1344 if [ -d /etc/bacula ]; then
1346 for file in *.conf; do
1347 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
1348 need_password=`grep $string $file 2>/dev/null`
1349 if [ -n "$need_password" ]; then
1350 pass=`openssl rand -base64 33`
1351 sed "s-$string-$pass-g" $file > $file.new
1352 cp -f $file.new $file; rm -f $file.new
1361 /sbin/chkconfig --del bacula-fd
1365 %defattr(-,root,%{daemon_group})
1366 /etc/bacula/updatedb/*
1369 # create the daemon group
1370 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1371 if [ -z "$HAVE_BACULA" ]; then
1372 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1373 echo "The group %{daemon_group} has been added to %{group_file}."
1374 echo "See the manual chapter \"Running Bacula\" for details."
1378 echo "The database update scripts were installed to /etc/bacula/updatedb"
1382 %defattr(-,root,root)
1383 /usr/sbin/gnome-console
1384 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1385 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1386 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1387 /usr/share/pixmaps/bacula.png
1388 /usr/share/applications/bacula.desktop
1391 %if %{gconsole} && ! %{rh8}
1392 /usr/sbin/bacula-tray-monitor
1393 %config(noreplace) /etc/bacula/tray-monitor.conf
1394 /usr/share/pixmaps/bacula-tray-monitor.xpm
1395 /usr/share/applications/bacula-tray-monitor.desktop
1398 %if %{gconsole} && ! %{su9} && ! %{su10}
1399 # add the console helper files
1400 %config(noreplace,missingok) /etc/pam.d/gnome-console
1401 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1402 /usr/bin/gnome-console
1407 # create the daemon group
1408 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1409 if [ -z "$HAVE_BACULA" ]; then
1410 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1411 echo "The group %{daemon_group} has been added to %{group_file}."
1412 echo "See the manual chapter \"Running Bacula\" for details."
1416 # generate passwords if needed
1417 if [ -d /etc/bacula ]; then
1419 for file in *.conf; do
1420 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
1421 need_password=`grep $string $file 2>/dev/null`
1422 if [ -n "$need_password" ]; then
1423 pass=`openssl rand -base64 33`
1424 sed "s-$string-$pass-g" $file > $file.new
1425 cp -f $file.new $file; rm -f $file.new
1434 %defattr(-,root,root)
1436 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1437 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1438 /usr/share/pixmaps/wxwin16x16.xpm
1439 /usr/share/applications/wxconsole.desktop
1442 %if %{wxconsole} && ! %{su9} && ! %{su10}
1443 # add the console helper files
1444 %config(noreplace,missingok) /etc/pam.d/wxconsole
1445 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1451 # create the daemon group
1452 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1453 if [ -z "$HAVE_BACULA" ]; then
1454 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1455 echo "The group %{daemon_group} has been added to %{group_file}."
1456 echo "See the manual chapter \"Running Bacula\" for details."
1460 # generate passwords if needed
1461 if [ -d /etc/bacula ]; then
1463 for file in *.conf; do
1464 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
1465 need_password=`grep $string $file 2>/dev/null`
1466 if [ -n "$need_password" ]; then
1467 pass=`openssl rand -base64 33`
1468 sed "s-$string-$pass-g" $file > $file.new
1469 cp -f $file.new $file; rm -f $file.new
1477 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1478 - 1.38.10 bump rescue version
1479 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1480 - fix usermod statements
1482 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1483 - add -g param back to useradd statements Bug 605
1484 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1485 - redundant code cleanup
1486 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1487 - add wxconsole package
1488 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1490 - dependency update for Mandriva
1491 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1493 - remove -n option from useradd scripts
1494 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1496 - fix problem specifying more than one primary group for user bacula
1497 - add build switch to not build gconsole regardless of platform
1498 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - add centos3 build tag
1500 - fix link error of static-fd on Mandrake with --disable-nls
1501 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1502 - add fc4 dependencies
1503 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add SuSE 10.0 build
1505 - remove specific permission in attrib macros
1506 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1509 - refix compat for _dist on SLES9 which seems to have been removed
1510 - added note regarding Aleksandar's use of specific permissions in attrib macros
1511 - need to review and add specific fc4 build currently using fc3 Requires
1512 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1514 - Reorganize files and pre/post sections to remove repetitions
1515 - Always build separate mtx package
1516 - Fix file ownerships for /etc/bacula and Bacula's working dir
1517 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1518 - Disable GNOME on RH7
1519 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1520 - Red Hat and look alikes have mtx RPM, do not build/package our version
1521 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1522 - minor edit to _dist for SLES9 compatibility
1523 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1525 - kern changed location of pdf files and html manual in docs package
1526 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1528 - add docs (from prebuilt tarball) and rescue packages back in
1529 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1530 - remove 3 of 4 sqlite script patches as not needed
1531 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - remove docs and rescue sections (remove static fd)
1534 - add dvd-freespace and dvd-writepart files
1535 - update depkgs to 22Jun05
1536 - change database update to 8 to 9
1537 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1538 - minor cleanups before 1.38 changes
1539 - add popt and popt-devel build dependencies
1540 - add tetex and tetex-dvips dependencies for doc build
1541 - replace deprecated Copyright tag with License
1542 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1544 - conflict with sqlite packages. remove readline dependency.
1545 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - release 1.36.3 update docs
1547 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - add centos4 build tag
1549 - add x86_64 build tag
1550 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 - add rhel4 build tag
1552 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1553 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1554 - add rhel3 build tag
1555 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1556 - fix tray-monitor.conf for noreplace
1557 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1558 - fix distribution check for Fedora and Whitebox
1559 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1560 - add logwatch script
1562 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1563 - add build for Fedora Core 3 (linc now included in ORDit2)
1564 - add mysql4 define for Mandrake 10.1
1565 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1566 - fix {group_file} variable in post scripts
1567 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1568 - add distribution checking and custom Distribution tag
1569 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1570 - ASSIGNMENT OF COPYRIGHT
1571 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1572 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1573 - all right, title and interest in and to the copyright in this software RPM
1574 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1575 - free of all liens, encumbrances or any known claims against said copyright.
1576 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1578 - thanks to Daniel Widyono
1579 - update description for rescue package to describe cdrom creation
1580 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1581 - update depkgs to 29Oct04
1582 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1583 - add cdrom rescue to bacula-rescue package
1584 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1585 - misc fixes from 1.36.0 suse feedback
1586 - fix situation where sqlite database exists but sqlite has been removed.
1587 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1588 - remove tray-monitor from RH8 build
1589 - fix permissions on tray-monitor files
1590 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1591 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1592 - change database update to 7 to 8 upgrade,
1593 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1594 - build in 30Jul04, add freetype dependancy to gnome package.
1595 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1596 - add documentation to console for groupadd
1597 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1598 - add support for running daemons as root.bacula
1599 - correct for change in location of floppy rescue files in 1.35.2
1600 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1601 - updated depgkgs to 30Jul04
1602 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1603 - really, really fix symlink creation for gconsole
1604 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1605 - fix symlink creation in gconsole post install
1606 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1607 - fixed error in gconsole post script
1608 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1609 - add check for gconsole symlink before trying to create it
1610 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1611 - fix some minor permissions issues on doc files that CVS won't let us fix
1612 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1613 - add pkgconfig to BuildRequires
1614 - clean up gnome1/2 menu entries for appropriate packages
1615 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1616 - tightened up doc distribution
1617 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1618 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1619 - rpm's horrible bug that prevents nested conditional macros prevents me
1620 - from implementing these 2 separate approaches within the conditionals which
1621 - create the separate server packages.
1622 - the solution adopted is to remove the gnome-console files from the server packages
1623 - so bacula-gconsole is now an add on for both client and server packages.
1624 - this also now allows the server packages to be install on machines without
1625 - an X-server and we can still maintain a single spec file.
1626 - added tests to make sure we have defined platform and database macros.
1627 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1628 - corrected mysql prerequisites for suse
1629 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1630 - replaced all cp commands with cp -p
1631 - removed addition of a+x permissions on gnome-console
1632 - corrected permissions on init scripts
1633 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1634 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1636 - various cleanup patches from Michael K. Johnson:
1637 - corrected post install routines for nicer chkconfig
1638 - removed chmod changes in post routines and moved to install section
1639 - removed interactive nature of post routine for rescue package
1640 - added description of building rescue disks to the description of rescue package
1641 - added clean of build root to beginning of install
1642 - removed specifying attr in all file lists
1643 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1644 - added bconsole to client package
1645 - added gconsole package as add-on to client
1646 - removed spurious dependancies on updatedb package (!cut/paste)
1647 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1648 - added updatedb package
1649 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1650 - added postgresql package
1651 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1652 - corrected the if else logic in the dependancy sections
1653 - changes for 1.34 release
1654 - /etc/bacula/console is now /etc/bacula/bconsole
1655 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1656 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1657 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1658 - added new /etc/bacula/drop_mysql_database
1659 - added new /etc/bacula/drop_sqlite_database
1660 - added new /etc/bacula/grant_sqlite_privileges
1661 - added new generic bacula database scripts in /etc/bacula
1662 - added pre-install sections to check for database versions older than 6
1663 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1664 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1665 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1666 - added testing for existing databases before executing any of the database creation scripts
1667 - added defines working_dir and sqlite_bindir in place of hard coded paths
1668 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1669 - added build configuration for SuSE.
1670 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1671 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1672 - added patch for create_sqlite_database to fix the installed bindir
1673 - added execute of create_sqlite_database to post of sqlite package
1674 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1675 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1676 - added bacula-fd as Requires for rescue package
1677 - added build tag for Fedora Core 1
1678 - cleaned up dependancies for all builds
1679 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1680 - removed rh_version from package names
1681 - added platform build configuration section to beginning of file
1682 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1683 - removed make_static_bacula script from rescue package install
1684 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1685 - Added define at top of file for depkgs version
1686 - Added rescue sub-package
1687 - Moved requires statements into proper sub-package locations
1688 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1689 - Corrected Requires for Gnome 1.4/2.0 builds
1690 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1691 - Added separate source declaration for depkgs
1692 - added patch for make_catalog_backup script
1693 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1694 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1695 - Added rh_version to sub-package names
1696 - Added installed but missing file /etc/bacula/gconsole
1697 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1698 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1699 - Update spec for version 1.31 and combine client
1700 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>