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.3
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}
43 # Whitebox Enterprise build
45 %{?build_wb3:%define wb3 1}
46 # RedHat Enterprise builds
48 %{?build_rhel3:%define rhel3 1}
49 %{?build_rhel3:%define wb3 1}
51 %{?build_rhel4:%define rhel4 1}
52 %{?build_rhel4:%define fc3 1}
55 %{?build_centos3:%define centos3 1}
56 %{?build_centos3:%define wb3 1}
58 %{?build_centos4:%define centos4 1}
59 %{?build_centos4:%define fc3 1}
62 %{?build_su9:%define su9 1}
64 %{?build_su10:%define su10 1}
67 %{?build_mdk:%define mdk 1}
69 %{?build_mdv:%define mdv 1}
70 %{?build_mdv:%define mdk 1}
72 # test for a platform definition
73 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
74 %{error: You must specify a platform. Please examine the spec file.}
79 # set for database support desired or define the build_xxx on the command line
81 %{?build_mysql:%define mysql 1}
82 # if using mysql 4.x define this and mysql above
83 # currently: Mandrake 10.1, SuSE 9.2, RHEL4 and Fedora Core 4
85 %{?build_mysql4:%define mysql4 1}
86 %{?build_mysql4:%define mysql 1}
88 %{?build_sqlite:%define sqlite 1}
90 %{?build_postgresql:%define postgresql 1}
92 # test for a database definition
93 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
94 %{error: You must specify database support. Please examine the spec file.}
99 %define db_backend mysql
102 %define db_backend sqlite
105 %define db_backend postgresql
110 %{?build_x86_64:%define x86_64 1}
112 # check what distribution we are
113 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
114 %define _dist %(grep Red /etc/redhat-release)
117 %define _dist %(grep Fedora /etc/redhat-release)
119 %if %{centos4} || %{centos3}
120 %define _dist %(grep CentOS /etc/redhat-release)
122 %if %{fc3} && ! %{rhel4} && ! %{centos4}
123 %define _dist %(grep Fedora /etc/redhat-release)
125 %if %{wb3} && ! %{rhel3} && ! %{centos3}
126 %define _dist %(grep White /etc/whitebox-release)
128 %if %{su9} || %{su10}
129 %define _dist %(grep -i SuSE /etc/SuSE-release)
132 %define _dist %(grep Mand /etc/mandrake-release)
135 # Should we build gconsole, possible only if gnome >= 2.0 available
141 # specifically disallow gconsole if desired
142 %{?nobuild_gconsole:%define gconsole 0}
144 # Should we build wxconsole, only wxWidgets >=2.6 is supported
145 # currently only SuSE 10 and FC4
147 %{?build_wxconsole:%define wxconsole 1}
149 # define the basic package description
150 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
151 %define blurb2 Bacula is a set of computer programs that permit you (or the system
152 %define blurb3 administrator) to manage backup, recovery, and verification of computer
153 %define blurb4 data across a network of computers of different kinds. In technical terms,
154 %define blurb5 it is a network client/server based backup program. Bacula is relatively
155 %define blurb6 easy to use and efficient, while offering many advanced storage management
156 %define blurb7 features that make it easy to find and recover lost or damaged files.
157 %define blurb8 Bacula source code has been released under the GPL version 2 license.
159 Summary: Bacula - The Network Backup Solution
163 Group: System Environment/Daemons
165 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
166 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
167 Source2: Release_Notes-%{version}-%{release}.tar.gz
168 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
169 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
170 BuildRoot: %{_tmppath}/%{name}-root
171 URL: http://www.bacula.org/
172 Vendor: The Bacula Team
173 Distribution: %{_dist}
174 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
176 %define _docsrc ../%{name}-docs-%{version}
177 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
179 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
180 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
181 BuildRequires: openssl-devel
183 BuildRequires: pkgconfig
186 BuildRequires: libtermcap-devel
187 BuildRequires: glibc-devel >= 2.2
190 BuildRequires: termcap
191 BuildRequires: glibc-devel >= 2.3
193 %if %{su9} && %{gconsole}
194 BuildRequires: libgnome >= 2.0
195 BuildRequires: gtk2-devel >= 2.0
196 BuildRequires: libgnomeui-devel >= 2.0
197 BuildRequires: ORBit2-devel
198 BuildRequires: libart_lgpl-devel >= 2.0
199 BuildRequires: libbonobo-devel >= 2.0
200 BuildRequires: libbonoboui-devel >= 2.0
201 BuildRequires: bonobo-activation-devel
202 BuildRequires: gconf2-devel
203 BuildRequires: linc-devel
204 BuildRequires: freetype2-devel
207 BuildRequires: termcap
208 BuildRequires: glibc-devel >= 2.3
210 %if %{su10} && %{gconsole}
211 BuildRequires: libgnome >= 2.12
212 BuildRequires: gtk2-devel >= 2.8
213 BuildRequires: libgnomeui-devel >= 2.12
214 BuildRequires: ORBit2-devel
215 BuildRequires: libart_lgpl-devel >= 2.3
216 BuildRequires: libbonobo-devel >= 2.10
217 BuildRequires: libbonoboui-devel >= 2.10
218 BuildRequires: bonobo-activation-devel
219 BuildRequires: gconf2-devel
220 BuildRequires: freetype2-devel
221 BuildRequires: cairo-devel
222 BuildRequires: fontconfig-devel >= 2.3
223 BuildRequires: gnome-vfs2-devel >= 2.12
224 BuildRequires: libpng-devel
227 BuildRequires: libtermcap-devel
228 BuildRequires: libstdc++-static-devel
229 BuildRequires: glibc-static-devel
230 BuildRequires: glibc-devel >= 2.3
232 %if %{mdk} && !%{mdv} && %{gconsole}
233 BuildRequires: gtk2-devel >= 2.0
234 BuildRequires: libgnomeui2-devel >= 2.0
235 BuildRequires: libORBit2-devel
236 BuildRequires: libart_lgpl-devel >= 2.0
237 BuildRequires: libbonobo2_0-devel
238 BuildRequires: libbonoboui2_0-devel
239 BuildRequires: libbonobo-activation-devel
240 BuildRequires: libGConf2-devel
241 BuildRequires: freetype2-devel
243 %if %{mdv} && %{gconsole}
244 BuildRequires: gtk2-devel >= 2.8
245 BuildRequires: libgnomeui2-devel >= 2.10
246 BuildRequires: libORBit2-devel
247 BuildRequires: libart_lgpl-devel >= 2.3
248 BuildRequires: libbonobo2_0-devel
249 BuildRequires: libbonoboui2_0-devel
250 BuildRequires: libbonobo-activation-devel
251 BuildRequires: libGConf2-devel
252 BuildRequires: freetype2-devel
255 BuildRequires: libtermcap-devel
256 BuildRequires: glibc-devel >= 2.3
258 %if %{fc3} && %{gconsole}
259 BuildRequires: gtk2-devel >= 2.4
260 BuildRequires: libgnomeui-devel >= 2.8
261 BuildRequires: ORBit2-devel
262 BuildRequires: libart_lgpl-devel >= 2.3
263 BuildRequires: libbonobo-devel >= 2.8
264 BuildRequires: libbonoboui-devel >= 2.8
265 BuildRequires: bonobo-activation-devel
266 BuildRequires: GConf2-devel
267 BuildRequires: freetype-devel
270 BuildRequires: libtermcap-devel
271 BuildRequires: glibc-devel >= 2.3
273 %if %{fc4} && %{gconsole}
274 BuildRequires: gtk2-devel >= 2.6
275 BuildRequires: libgnomeui-devel >= 2.10
276 BuildRequires: ORBit2-devel
277 BuildRequires: libart_lgpl-devel >= 2.3
278 BuildRequires: libbonobo-devel >= 2.8
279 BuildRequires: libbonoboui-devel >= 2.8
280 BuildRequires: bonobo-activation-devel
281 BuildRequires: GConf2-devel
282 BuildRequires: freetype-devel
284 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
285 BuildRequires: libtermcap-devel
286 BuildRequires: glibc-devel >= 2.3
288 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole}
289 BuildRequires: gtk2-devel >= 2.0
290 BuildRequires: libgnomeui-devel >= 2.0
291 BuildRequires: ORBit2-devel
292 BuildRequires: libart_lgpl-devel >= 2.0
293 BuildRequires: libbonobo-devel >= 2.0
294 BuildRequires: libbonoboui-devel >= 2.0
295 BuildRequires: bonobo-activation-devel
296 BuildRequires: GConf2-devel
297 BuildRequires: linc-devel
298 BuildRequires: freetype-devel
301 %if %{mysql} && ! %{mysql4}
302 BuildRequires: mysql-devel >= 3.23
305 %if %{mysql} && %{mysql4}
306 BuildRequires: mysql-devel >= 4.0
309 %if %{postgresql} && %{wb3}
310 BuildRequires: rh-postgresql-devel >= 7
313 %if %{postgresql} && ! %{wb3}
314 BuildRequires: postgresql-devel >= 7
318 BuildRequires: wxGTK-devel >= 2.6
342 Summary: Bacula - The Network Backup Solution
343 Group: System Environment/Daemons
344 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
345 Conflicts: bacula-client
346 Obsoletes: bacula-rescue
347 Requires: ncurses, libstdc++, zlib, openssl, mtx
350 Requires: glibc >= 2.2
353 %if %{su9} || %{su10}
354 Requires: glibc >= 2.3
357 %if ! %{rh7} && ! %{su9} && ! %{su10}
358 Requires: glibc >= 2.3
362 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
363 Requires: mysql >= 3.23
364 Requires: mysql-server >= 3.23
366 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
367 Requires: mysql >= 4.0
368 Requires: mysql-server >= 4.0
371 %if %{mysql} && %{su9} && ! %{mysql4}
372 Requires: mysql >= 3.23
373 Requires: mysql-client >= 3.23
375 %if %{mysql} && %{su9} && %{mysql4}
376 Requires: mysql >= 4.0
377 Requires: mysql-client >= 4.0
379 %if %{mysql} && %{su10} && %{mysql4}
380 Requires: mysql >= 4.0
381 Requires: mysql-client >= 4.0
384 %if %{mysql} && %{mdk} && ! %{mysql4}
385 Requires: mysql >= 3.23
386 Requires: mysql-client >= 3.23
388 %if %{mysql} && %{mdk} && %{mysql4}
389 Requires: mysql >= 4.0
390 Requires: mysql-client >= 4.0
393 %if %{postgresql} && %{wb3}
394 Requires: rh-postgresql >= 7
395 Requires: rh-postgresql-server >= 7
397 %if %{postgresql} && ! %{wb3}
398 Requires: postgresql >= 7
399 Requires: postgresql-server >= 7
409 %description postgresql
423 This build requires MySQL to be installed separately as the catalog database.
426 This build requires PostgreSQL to be installed separately as the catalog database.
429 This build incorporates sqlite as the catalog database, statically compiled.
433 Summary: Bacula - The Network Backup Solution
434 Group: System Environment/Daemons
438 This is Bacula's version of mtx tape utilities for Linux distributions that
439 do not provide their own mtx package
442 Summary: Bacula - The Network Backup Solution
443 Group: System Environment/Daemons
445 Conflicts: bacula-mysql
446 Conflicts: bacula-sqlite
447 Conflicts: bacula-postgresql
448 Obsoletes: bacula-rescue
449 Requires: libstdc++, zlib, openssl
452 Requires: glibc >= 2.2
455 %if %{su9} || %{su10}
456 Requires: glibc >= 2.3
459 %if ! %{rh7} && ! %{su9} && ! %{su10}
460 Requires: glibc >= 2.3
475 This is the File daemon (Client) only package. It includes the command line
480 Summary: Bacula - The Network Backup Solution
481 Group: System Environment/Daemons
483 %description updatedb
494 This package installs scripts for updating older versions of the bacula
499 Summary: Bacula - The Network Backup Solution
500 Group: System Environment/Daemons
501 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
504 %if %{gconsole} && %{su9}
505 Requires: gtk2 >= 2.0
506 Requires: libgnome >= 2.0
507 Requires: libgnomeui >= 2.0
508 Requires: glibc >= 2.3
510 Requires: libart_lgpl >= 2.0
511 Requires: libbonobo >= 2.0
512 Requires: libbonoboui >= 2.0
513 Requires: bonobo-activation
518 %if %{gconsole} && %{su10}
519 Requires: gtk2 >= 2.8
520 Requires: libgnome >= 2.12
521 Requires: libgnomeui >= 2.12
522 Requires: glibc >= 2.3
524 Requires: libart_lgpl >= 2.3
525 Requires: libbonobo >= 2.10
526 Requires: libbonoboui >= 2.10
527 Requires: bonobo-activation
531 Requires: fontconfig >= 2.3
532 Requires: gnome-vfs2 >= 2.12
535 %if %{gconsole} && %{mdk} && !%{mdv}
536 Requires: gtk2 >= 2.0
537 Requires: libgnomeui2
538 Requires: glibc >= 2.3
540 Requires: libart_lgpl >= 2.0
541 Requires: libbonobo >= 2.0
542 Requires: libbonoboui >= 2.0
546 %if %{gconsole} && %{mdv}
547 Requires: gtk2 >= 2.8
548 Requires: libgnomeui2
549 Requires: glibc >= 2.3
551 Requires: libart_lgpl >= 2.3
552 Requires: libbonobo >= 2.10
553 Requires: libbonoboui >= 2.10
557 %if %{gconsole} && %{fc3}
558 Requires: gtk2 >= 2.4
559 Requires: libgnomeui >= 2.8
560 Requires: glibc >= 2.3
562 Requires: libart_lgpl >= 2.3
563 Requires: libbonobo >= 2.8
564 Requires: libbonoboui >= 2.8
565 Requires: bonobo-activation
569 %if %{gconsole} && %{fc4}
570 Requires: gtk2 >= 2.6
571 Requires: libgnomeui >= 2.10
572 Requires: glibc >= 2.3
574 Requires: libart_lgpl >= 2.3
575 Requires: libbonobo >= 2.8
576 Requires: libbonoboui >= 2.8
577 Requires: bonobo-activation
581 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
582 Requires: gtk2 >= 2.0
583 Requires: libgnomeui >= 2.0
584 Requires: glibc >= 2.3
586 Requires: libart_lgpl >= 2.0
587 Requires: libbonobo >= 2.0
588 Requires: libbonoboui >= 2.0
589 Requires: bonobo-activation
594 %if %{gconsole} && %{su9}
597 %if %{gconsole} && %{su10}
600 %if %{gconsole} && ! %{su9} && ! %{su10}
605 %description gconsole
616 This is the Gnome Console package. It is an add-on to the client or
622 Summary: Bacula - The Network Backup Solution
623 Group: System Environment/Daemons
624 Requires: wxGTK >= 2.6, libstdc++, openssl
627 %if %{wxconsole} && %{su10}
628 Requires: gtk2 >= 2.8
631 %if %{wxconsole} && %{fc3}
632 Requires: gtk2 >= 2.4
635 %if %{wxconsole} && %{fc4}
636 Requires: gtk2 >= 2.6
640 %description wxconsole
651 This is the WXWindows Console package. It is an add-on to the client or
665 %if %{su9} || %{su10}
666 export LDFLAGS="-L/usr/lib/termcap"
677 # patches for the bundled sqlite scripts
678 # as of 1.38.0 first 3 patches no longer needed
680 # patch the make_sqlite_tables script for installation bindir
681 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
683 # patch the create_sqlite_database script for installation bindir
684 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
686 # patch the make_catalog_backup script for installation bindir
687 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
689 # patch the update_sqlite_tables script for installation bindir
690 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
692 # patch the bacula-dir init script to remove sqlite service
693 %if %{sqlite} && %{su9}
694 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
696 %if %{sqlite} && %{su10}
697 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
700 # 64 bit lib location hacks
702 export LDFLAGS=-L/usr/lib64
704 %if %{mysql} && %{x86_64}
705 export LDFLAGS=-L/usr/lib64/mysql
710 --sbindir=/usr/sbin \
711 --sysconfdir=/etc/bacula \
712 --with-scriptdir=/etc/bacula \
713 --enable-smartalloc \
714 --enable-client-only \
724 --sbindir=/usr/sbin \
725 --sysconfdir=/etc/bacula \
726 --with-scriptdir=/etc/bacula \
727 --enable-smartalloc \
731 %if %{gconsole} && ! %{rh8}
732 --enable-tray-monitor \
738 --with-sqlite=${cwd}/%{depkgs}/sqlite \
744 --enable-wx-console \
746 --with-working-dir=%{working_dir} \
747 --with-pid-dir=/var/run \
748 --with-subsys-dir=/var/lock/subsys \
749 --with-dir-user=%{director_daemon_user} \
750 --with-dir-group=%{daemon_group} \
751 --with-sd-user=%{storage_daemon_user} \
752 --with-sd-group=%{storage_daemon_group} \
753 --with-fd-user=%{file_daemon_user} \
754 --with-fd-group=%{daemon_group} \
755 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
756 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
757 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
758 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
759 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
760 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
768 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
769 mkdir -p $RPM_BUILD_ROOT/etc/init.d
770 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
771 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
772 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
773 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
774 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
776 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
778 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
779 %if %{gconsole} && ! %{su9} && ! %{su10}
780 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
781 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
782 mkdir -p $RPM_BUILD_ROOT/usr/bin
786 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
790 prefix=$RPM_BUILD_ROOT/usr \
791 sbindir=$RPM_BUILD_ROOT/usr/sbin \
792 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
793 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
794 working_dir=$RPM_BUILD_ROOT%{working_dir} \
799 prefix=$RPM_BUILD_ROOT/usr \
800 sbindir=$RPM_BUILD_ROOT/usr/sbin \
801 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
802 working_dir=$RPM_BUILD_ROOT%{working_dir} \
803 mandir=$RPM_BUILD_ROOT/usr/man \
807 # fixme - make installs the mysql scripts for sqlite build
809 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
810 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
811 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
814 # fixme - make installs the mysql scripts for postgresql build
816 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
817 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
820 # fixme - make installs gconsole script for build without gconsole
822 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
825 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
827 # install the init scripts
828 %if %{su9} || %{su10}
829 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
830 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
831 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
834 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
835 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
836 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
838 %if ! %{su9} && ! %{su10} && ! %{mdk}
839 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
840 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
841 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
843 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
845 # install the menu stuff
846 %if %{gconsole} && %{su9}
847 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
848 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
849 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
850 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
852 %if %{gconsole} && %{su10}
853 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
854 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
855 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
856 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
858 %if %{wxconsole} && %{su10}
859 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
860 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
862 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
867 %if %{gconsole} && %{iftrick}
868 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
869 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
870 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
871 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
872 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
874 %if %{gconsole} && ! %{rh8}
875 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
876 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
878 %if %{wxconsole} && %{iftrick}
879 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
880 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
881 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
882 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
883 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
888 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
889 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
890 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
893 # install the logrotate file
894 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
896 # install the updatedb scripts
897 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
899 # install the logwatch scripts
900 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
901 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
902 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
903 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
904 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
905 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
907 # install the rescue files
908 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
909 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
910 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
911 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
912 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
913 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
914 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
915 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
916 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
917 rm -f src/filed/static-bacula-fd
920 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
921 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
924 # now clean up permissions that are left broken by the install
925 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
926 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
927 %if %{gconsole} && ! %{rh8}
928 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
929 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
933 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
936 # MySQL specific files
938 %defattr(-, root, root)
939 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
940 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
941 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
942 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
943 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
944 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
945 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
946 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
951 %defattr(-,root,root)
952 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
953 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
954 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
955 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
956 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
957 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
958 %{sqlite_bindir}/libsqlite.a
959 %{sqlite_bindir}/sqlite.h
960 %{sqlite_bindir}/sqlite
965 %defattr(-,root,root)
966 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
967 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
968 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
969 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
970 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
971 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
974 # The rest is DB backend independent
975 %attr(-, root, %{daemon_group}) %dir /etc/bacula
976 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
977 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
978 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
979 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
980 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
981 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
982 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
983 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
984 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
985 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
986 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
987 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
988 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
989 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
990 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
991 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
992 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
993 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
994 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
995 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
996 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
997 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
999 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1000 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1002 /etc/logrotate.d/bacula
1003 /etc/log.d/scripts/services/bacula
1004 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1005 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1006 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1007 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1008 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1009 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1010 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1011 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1013 /usr/sbin/bacula-dir
1021 /usr/sbin/btraceback
1030 # test for bacula database older than version 8
1031 # note: this ASSUMES no password has been set for bacula database
1032 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1037 # test for bacula database older than version 8
1038 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1039 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1044 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1047 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1048 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1049 echo "You appear to be running database version $DB_VER. You must first update"
1050 echo "your database to version 8 and then install this upgrade. The alternative"
1051 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1052 echo "catalog information, then do the upgrade. Information on updating a"
1053 echo "database older than version 8 can be found in the release notes."
1061 # check for and copy /etc/bacula/console.conf to bconsole.conf
1062 if [ -s /etc/bacula/console.conf ];then
1063 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1066 # create the daemon users and groups
1067 # first create the groups if they don't exist
1068 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1069 if [ -z "$HAVE_BACULA" ]; then
1070 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1071 echo "The group %{daemon_group} has been added to %{group_file}."
1072 echo "See the manual chapter \"Running Bacula\" for details."
1074 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1075 if [ -z "$HAVE_BACULA" ]; then
1076 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1077 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1078 echo "See the manual chapter \"Running Bacula\" for details."
1080 # now create the users if they do not exist
1081 # we do not use the -g option allowing the primary group to be set to system default
1082 # this will be a unique group on redhat type systems or the group users on some systems
1083 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1084 if [ -z "$HAVE_BACULA" ]; then
1085 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1086 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1087 echo "See the manual chapter \"Running Bacula\" for details."
1089 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1090 if [ -z "$HAVE_BACULA" ]; then
1091 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1092 echo "The user %{director_daemon_user} has been added to %{user_file}."
1093 echo "See the manual chapter \"Running Bacula\" for details."
1095 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1096 if [ -z "$HAVE_BACULA" ]; then
1097 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1098 echo "The user %{file_daemon_user} has been added to %{user_file}."
1099 echo "See the manual chapter \"Running Bacula\" for details."
1101 # now we add the supplementary groups, this is ok to call even if the users already exist
1102 # we only do this if the user is NOT root
1103 IS_ROOT=%{director_daemon_user}
1104 if [ "$IS_ROOT" != "root" ]; then
1105 %{usermod} %{director_daemon_user} -G %{daemon_group}
1107 IS_ROOT=%{storage_daemon_user}
1108 if [ "$IS_ROOT" != "root" ]; then
1109 %{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group}
1111 IS_ROOT=%{file_daemon_user}
1112 if [ "$IS_ROOT" != "root" ]; then
1113 %{usermod} %{file_daemon_user} -G %{daemon_group}
1127 if [ "$1" -ge 1 ] ; then
1128 /sbin/chkconfig --add bacula-dir
1129 /sbin/chkconfig --add bacula-fd
1130 /sbin/chkconfig --add bacula-sd
1134 # test for an existing database
1135 # note: this ASSUMES no password has been set for bacula database
1136 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1138 # grant privileges and create tables if they do not exist
1139 if [ -z "$DB_VER" ]; then
1140 echo "Hmm, doesn't look like you have an existing database."
1141 echo "Granting privileges for MySQL user bacula..."
1142 /etc/bacula/grant_mysql_privileges
1143 echo "Creating MySQL bacula database..."
1144 /etc/bacula/create_mysql_database
1145 echo "Creating bacula tables..."
1146 /etc/bacula/make_mysql_tables
1148 # check to see if we need to upgrade a 1.36 or lower database
1149 elif [ "$DB_VER" -lt "9" ]; then
1150 echo "This release requires an upgrade to your bacula database."
1151 echo "Backing up your current database..."
1152 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1153 echo "Upgrading bacula database ..."
1154 /etc/bacula/update_mysql_tables
1155 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1161 # test for an existing database
1162 if [ -s %{working_dir}/bacula.db ]; then
1163 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1164 # check to see if we need to upgrade a 1.36 or lower database
1165 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1166 echo "This release requires an upgrade to your bacula database."
1167 echo "Backing up your current database..."
1168 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1169 echo "Upgrading bacula database ..."
1170 /etc/bacula/update_sqlite_tables
1171 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1174 # create the database and tables
1175 echo "Hmm, doesn't look like you have an existing database."
1176 echo "Creating SQLite database..."
1177 /etc/bacula/create_sqlite_database
1178 echo "Creating the SQLite tables..."
1179 /etc/bacula/make_sqlite_tables
1184 # test for an existing database
1185 # note: this ASSUMES no password has been set for bacula database
1186 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1188 # grant privileges and create tables if they do not exist
1189 if [ -z "$DB_VER" ]; then
1190 echo "Hmm, doesn't look like you have an existing database."
1191 echo "Creating PostgreSQL bacula database..."
1192 /etc/bacula/create_postgresql_database
1193 echo "Creating bacula tables..."
1194 /etc/bacula/make_postgresql_tables
1195 echo "Granting privileges for PostgreSQL user bacula..."
1196 /etc/bacula/grant_postgresql_privileges
1198 # check to see if we need to upgrade a 1.36 or lower database
1199 elif [ "$DB_VER" -lt "9" ]; then
1200 echo "This release requires an upgrade to your bacula database."
1201 echo "Backing up your current database..."
1202 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1203 echo "Upgrading bacula database ..."
1204 /etc/bacula/update_postgresql_tables
1205 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1210 # generate passwords if needed
1211 if [ -d /etc/bacula ]; then
1213 for file in *.conf; do
1214 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
1215 need_password=`grep $string $file 2>/dev/null`
1216 if [ -n "$need_password" ]; then
1217 pass=`openssl rand -base64 33`
1218 sed "s-$string-$pass-g" $file > $file.new
1219 cp -f $file.new $file; rm -f $file.new
1237 /sbin/chkconfig --del bacula-dir
1238 /sbin/chkconfig --del bacula-fd
1239 /sbin/chkconfig --del bacula-sd
1244 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1245 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1246 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1247 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1252 %defattr(-,root,root)
1253 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1254 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1255 /etc/init.d/bacula-fd
1256 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1258 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1259 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1261 /etc/logrotate.d/bacula
1263 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1264 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1265 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1268 /usr/sbin/btraceback
1269 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1270 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1276 # create the daemon group and user
1277 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1278 if [ -z "$HAVE_BACULA" ]; then
1279 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1280 echo "The group %{daemon_group} has been added to %{group_file}."
1281 echo "See the manual chapter \"Running Bacula\" for details."
1283 # we do not use the -g option allowing the primary group to be set to system default
1284 # this will be a unique group on redhat type systems or the group users on some systems
1285 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1286 if [ -z "$HAVE_BACULA" ]; then
1287 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1288 echo "The user %{file_daemon_user} has been added to %{user_file}."
1289 echo "See the manual chapter \"Running Bacula\" for details."
1291 # now we add the supplementary group, this is ok to call even if the user already exists
1292 # we only do this if the user is NOT root
1293 IS_ROOT=%{file_daemon_user}
1294 if [ "$IS_ROOT" != "root" ]; then
1295 %{usermod} %{file_daemon_user} -G %{daemon_group}
1300 if [ "$1" -ge 1 ] ; then
1301 /sbin/chkconfig --add bacula-fd
1304 # generate passwords if needed
1305 if [ -d /etc/bacula ]; then
1307 for file in *.conf; do
1308 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1309 need_password=`grep $string $file 2>/dev/null`
1310 if [ -n "$need_password" ]; then
1311 pass=`openssl rand -base64 33`
1312 sed "s-$string-$pass-g" $file > $file.new
1313 cp -f $file.new $file; rm -f $file.new
1322 /sbin/chkconfig --del bacula-fd
1326 %defattr(-,root,%{daemon_group})
1327 /etc/bacula/updatedb/*
1330 # create the daemon group
1331 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1332 if [ -z "$HAVE_BACULA" ]; then
1333 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1334 echo "The group %{daemon_group} has been added to %{group_file}."
1335 echo "See the manual chapter \"Running Bacula\" for details."
1339 echo "The database update scripts were installed to /etc/bacula/updatedb"
1343 %defattr(-,root,root)
1344 /usr/sbin/gnome-console
1345 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1346 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1347 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1348 /usr/share/pixmaps/bacula.png
1349 /usr/share/applications/bacula.desktop
1352 %if %{gconsole} && ! %{rh8}
1353 /usr/sbin/bacula-tray-monitor
1354 %config(noreplace) /etc/bacula/tray-monitor.conf
1355 /usr/share/pixmaps/bacula-tray-monitor.xpm
1356 /usr/share/applications/bacula-tray-monitor.desktop
1359 %if %{gconsole} && ! %{su9} && ! %{su10}
1360 # add the console helper files
1361 %config(noreplace,missingok) /etc/pam.d/gnome-console
1362 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1363 /usr/bin/gnome-console
1368 # create the daemon group
1369 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1370 if [ -z "$HAVE_BACULA" ]; then
1371 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1372 echo "The group %{daemon_group} has been added to %{group_file}."
1373 echo "See the manual chapter \"Running Bacula\" for details."
1377 # generate passwords if needed
1378 if [ -d /etc/bacula ]; then
1380 for file in *.conf; do
1381 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
1382 need_password=`grep $string $file 2>/dev/null`
1383 if [ -n "$need_password" ]; then
1384 pass=`openssl rand -base64 33`
1385 sed "s-$string-$pass-g" $file > $file.new
1386 cp -f $file.new $file; rm -f $file.new
1395 %defattr(-,root,root)
1397 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1398 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1399 /usr/share/pixmaps/wxwin16x16.xpm
1400 /usr/share/applications/wxconsole.desktop
1403 %if %{wxconsole} && ! %{su9} && ! %{su10}
1404 # add the console helper files
1405 %config(noreplace,missingok) /etc/pam.d/wxconsole
1406 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1412 # create the daemon group
1413 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1414 if [ -z "$HAVE_BACULA" ]; then
1415 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1416 echo "The group %{daemon_group} has been added to %{group_file}."
1417 echo "See the manual chapter \"Running Bacula\" for details."
1421 # generate passwords if needed
1422 if [ -d /etc/bacula ]; then
1424 for file in *.conf; do
1425 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
1426 need_password=`grep $string $file 2>/dev/null`
1427 if [ -n "$need_password" ]; then
1428 pass=`openssl rand -base64 33`
1429 sed "s-$string-$pass-g" $file > $file.new
1430 cp -f $file.new $file; rm -f $file.new
1438 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1439 - add -g param back to useradd statements Bug 605
1440 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1441 - redundant code cleanup
1442 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1443 - add wxconsole package
1444 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1446 - dependency update for Mandriva
1447 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1449 - remove -n option from useradd scripts
1450 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1452 - fix problem specifying more than one primary group for user bacula
1453 - add build switch to not build gconsole regardless of platform
1454 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1455 - add centos3 build tag
1456 - fix link error of static-fd on Mandrake with --disable-nls
1457 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1458 - add fc4 dependencies
1459 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1460 - add SuSE 10.0 build
1461 - remove specific permission in attrib macros
1462 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1464 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1465 - refix compat for _dist on SLES9 which seems to have been removed
1466 - added note regarding Aleksandar's use of specific permissions in attrib macros
1467 - need to review and add specific fc4 build currently using fc3 Requires
1468 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1470 - Reorganize files and pre/post sections to remove repetitions
1471 - Always build separate mtx package
1472 - Fix file ownerships for /etc/bacula and Bacula's working dir
1473 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1474 - Disable GNOME on RH7
1475 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1476 - Red Hat and look alikes have mtx RPM, do not build/package our version
1477 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1478 - minor edit to _dist for SLES9 compatibility
1479 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1481 - kern changed location of pdf files and html manual in docs package
1482 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1484 - add docs (from prebuilt tarball) and rescue packages back in
1485 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1486 - remove 3 of 4 sqlite script patches as not needed
1487 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1489 - remove docs and rescue sections (remove static fd)
1490 - add dvd-freespace and dvd-writepart files
1491 - update depkgs to 22Jun05
1492 - change database update to 8 to 9
1493 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1494 - minor cleanups before 1.38 changes
1495 - add popt and popt-devel build dependencies
1496 - add tetex and tetex-dvips dependencies for doc build
1497 - replace deprecated Copyright tag with License
1498 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1500 - conflict with sqlite packages. remove readline dependency.
1501 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1502 - release 1.36.3 update docs
1503 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add centos4 build tag
1505 - add x86_64 build tag
1506 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1507 - add rhel4 build tag
1508 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1509 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1510 - add rhel3 build tag
1511 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1512 - fix tray-monitor.conf for noreplace
1513 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1514 - fix distribution check for Fedora and Whitebox
1515 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1516 - add logwatch script
1518 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1519 - add build for Fedora Core 3 (linc now included in ORDit2)
1520 - add mysql4 define for Mandrake 10.1
1521 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1522 - fix {group_file} variable in post scripts
1523 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1524 - add distribution checking and custom Distribution tag
1525 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1526 - ASSIGNMENT OF COPYRIGHT
1527 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1528 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1529 - all right, title and interest in and to the copyright in this software RPM
1530 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1531 - free of all liens, encumbrances or any known claims against said copyright.
1532 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1534 - thanks to Daniel Widyono
1535 - update description for rescue package to describe cdrom creation
1536 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1537 - update depkgs to 29Oct04
1538 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1539 - add cdrom rescue to bacula-rescue package
1540 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1541 - misc fixes from 1.36.0 suse feedback
1542 - fix situation where sqlite database exists but sqlite has been removed.
1543 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1544 - remove tray-monitor from RH8 build
1545 - fix permissions on tray-monitor files
1546 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1547 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1548 - change database update to 7 to 8 upgrade,
1549 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1550 - build in 30Jul04, add freetype dependancy to gnome package.
1551 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1552 - add documentation to console for groupadd
1553 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1554 - add support for running daemons as root.bacula
1555 - correct for change in location of floppy rescue files in 1.35.2
1556 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1557 - updated depgkgs to 30Jul04
1558 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1559 - really, really fix symlink creation for gconsole
1560 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1561 - fix symlink creation in gconsole post install
1562 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1563 - fixed error in gconsole post script
1564 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1565 - add check for gconsole symlink before trying to create it
1566 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1567 - fix some minor permissions issues on doc files that CVS won't let us fix
1568 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1569 - add pkgconfig to BuildRequires
1570 - clean up gnome1/2 menu entries for appropriate packages
1571 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1572 - tightened up doc distribution
1573 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1574 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1575 - rpm's horrible bug that prevents nested conditional macros prevents me
1576 - from implementing these 2 separate approaches within the conditionals which
1577 - create the separate server packages.
1578 - the solution adopted is to remove the gnome-console files from the server packages
1579 - so bacula-gconsole is now an add on for both client and server packages.
1580 - this also now allows the server packages to be install on machines without
1581 - an X-server and we can still maintain a single spec file.
1582 - added tests to make sure we have defined platform and database macros.
1583 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1584 - corrected mysql prerequisites for suse
1585 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1586 - replaced all cp commands with cp -p
1587 - removed addition of a+x permissions on gnome-console
1588 - corrected permissions on init scripts
1589 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1590 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1592 - various cleanup patches from Michael K. Johnson:
1593 - corrected post install routines for nicer chkconfig
1594 - removed chmod changes in post routines and moved to install section
1595 - removed interactive nature of post routine for rescue package
1596 - added description of building rescue disks to the description of rescue package
1597 - added clean of build root to beginning of install
1598 - removed specifying attr in all file lists
1599 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1600 - added bconsole to client package
1601 - added gconsole package as add-on to client
1602 - removed spurious dependancies on updatedb package (!cut/paste)
1603 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1604 - added updatedb package
1605 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1606 - added postgresql package
1607 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1608 - corrected the if else logic in the dependancy sections
1609 - changes for 1.34 release
1610 - /etc/bacula/console is now /etc/bacula/bconsole
1611 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1612 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1613 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1614 - added new /etc/bacula/drop_mysql_database
1615 - added new /etc/bacula/drop_sqlite_database
1616 - added new /etc/bacula/grant_sqlite_privileges
1617 - added new generic bacula database scripts in /etc/bacula
1618 - added pre-install sections to check for database versions older than 6
1619 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1620 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1621 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1622 - added testing for existing databases before executing any of the database creation scripts
1623 - added defines working_dir and sqlite_bindir in place of hard coded paths
1624 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1625 - added build configuration for SuSE.
1626 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1627 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1628 - added patch for create_sqlite_database to fix the installed bindir
1629 - added execute of create_sqlite_database to post of sqlite package
1630 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1631 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1632 - added bacula-fd as Requires for rescue package
1633 - added build tag for Fedora Core 1
1634 - cleaned up dependancies for all builds
1635 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1636 - removed rh_version from package names
1637 - added platform build configuration section to beginning of file
1638 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1639 - removed make_static_bacula script from rescue package install
1640 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1641 - Added define at top of file for depkgs version
1642 - Added rescue sub-package
1643 - Moved requires statements into proper sub-package locations
1644 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1645 - Corrected Requires for Gnome 1.4/2.0 builds
1646 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1647 - Added separate source declaration for depkgs
1648 - added patch for make_catalog_backup script
1649 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1650 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1651 - Added rh_version to sub-package names
1652 - Added installed but missing file /etc/bacula/gconsole
1653 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1654 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1655 - Update spec for version 1.31 and combine client
1656 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>