2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define depkgs ../depkgs
8 %define depkgs_version 25Jun06
9 %define sqlite_bindir /usr/lib/bacula/sqlite
10 %define working_dir /var/bacula
12 # NOTE these defines are used in some rather complex useradd and groupadd
13 # commands. If you change them examine the post scripts for consequences.
14 %define director_daemon_user bacula
15 %define storage_daemon_user bacula
16 %define file_daemon_user root
17 %define daemon_group bacula
18 # group that has write access to tape devices, usually disk on Linux
19 %define storage_daemon_group disk
21 %define user_file /etc/passwd
22 %define group_file /etc/group
23 %define useradd /usr/sbin/useradd
24 %define groupadd /usr/sbin/groupadd
25 %define usermod /usr/sbin/usermod
26 %define _rescuever 1.8.6
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.0, RHEL4 and Fedora Core 4
87 %{?build_mysql4:%define mysql4 1}
88 %{?build_mysql4:%define mysql 1}
89 # if using mysql 5.x define this and mysql above
90 # currently: SuSE 10.1 and Fedora Core 5
92 %{?build_mysql5:%define mysql5 1}
93 %{?build_mysql5:%define mysql 1}
95 %{?build_sqlite:%define sqlite 1}
97 %{?build_postgresql:%define postgresql 1}
99 # test for a database definition
100 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
101 %{error: You must specify database support. Please examine the spec file.}
106 %define db_backend mysql
109 %define db_backend sqlite
112 %define db_backend postgresql
117 %{?build_x86_64:%define x86_64 1}
119 # check what distribution we are
120 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
121 %define _dist %(grep Red /etc/redhat-release)
123 %if %{fc1} || %{fc4} || %{fc5}
124 %define _dist %(grep Fedora /etc/redhat-release)
126 %if %{centos4} || %{centos3}
127 %define _dist %(grep CentOS /etc/redhat-release)
129 %if %{fc3} && ! %{rhel4} && ! %{centos4}
130 %define _dist %(grep Fedora /etc/redhat-release)
132 %if %{wb3} && ! %{rhel3} && ! %{centos3}
133 %define _dist %(grep White /etc/whitebox-release)
135 %if %{su9} || %{su10}
136 %define _dist %(grep -i SuSE /etc/SuSE-release)
139 %define _dist %(grep Mand /etc/mandrake-release)
142 # Should we build gconsole, possible only if gnome >= 2.0 available
148 # specifically disallow gconsole if desired
149 %{?nobuild_gconsole:%define gconsole 0}
151 # Should we build wxconsole, only wxWidgets >=2.6 is supported
152 # currently only SuSE 10 and FC4
154 %{?build_wxconsole:%define wxconsole 1}
156 # define the basic package description
157 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
158 %define blurb2 Bacula is a set of computer programs that permit you (or the system
159 %define blurb3 administrator) to manage backup, recovery, and verification of computer
160 %define blurb4 data across a network of computers of different kinds. In technical terms,
161 %define blurb5 it is a network client/server based backup program. Bacula is relatively
162 %define blurb6 easy to use and efficient, while offering many advanced storage management
163 %define blurb7 features that make it easy to find and recover lost or damaged files.
164 %define blurb8 Bacula source code has been released under the GPL version 2 license.
166 Summary: Bacula - The Network Backup Solution
170 Group: System Environment/Daemons
172 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
173 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
174 Source2: Release_Notes-%{version}-%{release}.tar.gz
175 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
176 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
177 BuildRoot: %{_tmppath}/%{name}-root
178 URL: http://www.bacula.org/
179 Vendor: The Bacula Team
180 Distribution: %{_dist}
181 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
183 %define _docsrc ../%{name}-docs-%{version}
184 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
186 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
187 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
188 BuildRequires: openssl-devel
190 BuildRequires: pkgconfig
193 BuildRequires: libtermcap-devel
194 BuildRequires: glibc-devel >= 2.2
197 BuildRequires: termcap
198 BuildRequires: glibc-devel >= 2.3
200 %if %{su9} && %{gconsole}
201 BuildRequires: libgnome >= 2.0
202 BuildRequires: gtk2-devel >= 2.0
203 BuildRequires: libgnomeui-devel >= 2.0
204 BuildRequires: ORBit2-devel
205 BuildRequires: libart_lgpl-devel >= 2.0
206 BuildRequires: libbonobo-devel >= 2.0
207 BuildRequires: libbonoboui-devel >= 2.0
208 BuildRequires: bonobo-activation-devel
209 BuildRequires: gconf2-devel
210 BuildRequires: linc-devel
211 BuildRequires: freetype2-devel
214 BuildRequires: termcap
215 BuildRequires: glibc-devel >= 2.3
217 %if %{su10} && %{gconsole}
218 BuildRequires: libgnome >= 2.12
219 BuildRequires: gtk2-devel >= 2.8
220 BuildRequires: libgnomeui-devel >= 2.12
221 BuildRequires: ORBit2-devel
222 BuildRequires: libart_lgpl-devel >= 2.3
223 BuildRequires: libbonobo-devel >= 2.10
224 BuildRequires: libbonoboui-devel >= 2.10
225 BuildRequires: bonobo-activation-devel
226 BuildRequires: gconf2-devel
227 BuildRequires: freetype2-devel
228 BuildRequires: cairo-devel
229 BuildRequires: fontconfig-devel >= 2.3
230 BuildRequires: gnome-vfs2-devel >= 2.12
231 BuildRequires: libpng-devel
234 BuildRequires: libtermcap-devel
235 BuildRequires: libstdc++-static-devel
236 BuildRequires: glibc-static-devel
237 BuildRequires: glibc-devel >= 2.3
239 %if %{mdk} && !%{mdv} && %{gconsole}
240 BuildRequires: gtk2-devel >= 2.0
241 BuildRequires: libgnomeui2-devel >= 2.0
242 BuildRequires: libORBit2-devel
243 BuildRequires: libart_lgpl-devel >= 2.0
244 BuildRequires: libbonobo2_0-devel
245 BuildRequires: libbonoboui2_0-devel
246 BuildRequires: libbonobo-activation-devel
247 BuildRequires: libGConf2-devel
248 BuildRequires: freetype2-devel
250 %if %{mdv} && %{gconsole}
251 BuildRequires: gtk2-devel >= 2.8
252 BuildRequires: libgnomeui2-devel >= 2.10
253 BuildRequires: libORBit2-devel
254 BuildRequires: libart_lgpl-devel >= 2.3
255 BuildRequires: libbonobo2_0-devel
256 BuildRequires: libbonoboui2_0-devel
257 BuildRequires: libbonobo-activation-devel
258 BuildRequires: libGConf2-devel
259 BuildRequires: freetype2-devel
262 BuildRequires: libtermcap-devel
263 BuildRequires: glibc-devel >= 2.3
265 %if %{fc3} && %{gconsole}
266 BuildRequires: gtk2-devel >= 2.4
267 BuildRequires: libgnomeui-devel >= 2.8
268 BuildRequires: ORBit2-devel
269 BuildRequires: libart_lgpl-devel >= 2.3
270 BuildRequires: libbonobo-devel >= 2.8
271 BuildRequires: libbonoboui-devel >= 2.8
272 BuildRequires: bonobo-activation-devel
273 BuildRequires: GConf2-devel
274 BuildRequires: freetype-devel
277 BuildRequires: libtermcap-devel
278 BuildRequires: glibc-devel >= 2.3
280 %if %{fc4} && %{gconsole}
281 BuildRequires: gtk2-devel >= 2.6
282 BuildRequires: libgnomeui-devel >= 2.10
283 BuildRequires: ORBit2-devel
284 BuildRequires: libart_lgpl-devel >= 2.3
285 BuildRequires: libbonobo-devel >= 2.8
286 BuildRequires: libbonoboui-devel >= 2.8
287 BuildRequires: bonobo-activation-devel
288 BuildRequires: GConf2-devel
289 BuildRequires: freetype-devel
292 BuildRequires: libtermcap-devel
293 BuildRequires: glibc-devel >= 2.4
295 %if %{fc5} && %{gconsole}
296 BuildRequires: gtk2-devel >= 2.8
297 BuildRequires: libgnomeui-devel >= 2.14
298 BuildRequires: ORBit2-devel
299 BuildRequires: libart_lgpl-devel >= 2.3
300 BuildRequires: libbonobo-devel >= 2.14
301 BuildRequires: libbonoboui-devel >= 2.14
302 BuildRequires: GConf2-devel
303 BuildRequires: freetype-devel
305 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
306 BuildRequires: libtermcap-devel
307 BuildRequires: glibc-devel >= 2.3
309 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
310 BuildRequires: gtk2-devel >= 2.0
311 BuildRequires: libgnomeui-devel >= 2.0
312 BuildRequires: ORBit2-devel
313 BuildRequires: libart_lgpl-devel >= 2.0
314 BuildRequires: libbonobo-devel >= 2.0
315 BuildRequires: libbonoboui-devel >= 2.0
316 BuildRequires: bonobo-activation-devel
317 BuildRequires: GConf2-devel
318 BuildRequires: linc-devel
319 BuildRequires: freetype-devel
322 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
323 BuildRequires: mysql-devel >= 3.23
326 %if %{mysql} && %{mysql4}
327 BuildRequires: mysql-devel >= 4.0
330 %if %{mysql} && %{mysql5}
331 BuildRequires: mysql-devel >= 5.0
334 %if %{postgresql} && %{wb3}
335 BuildRequires: rh-postgresql-devel >= 7
338 %if %{postgresql} && ! %{wb3}
339 BuildRequires: postgresql-devel >= 7
343 BuildRequires: wxGTK-devel >= 2.6
367 Summary: Bacula - The Network Backup Solution
368 Group: System Environment/Daemons
369 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
370 Conflicts: bacula-client
371 Obsoletes: bacula-rescue
372 Requires: ncurses, libstdc++, zlib, openssl, mtx
375 Requires: glibc >= 2.2
378 %if %{su9} || %{su10}
379 Requires: glibc >= 2.3
382 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
383 Requires: glibc >= 2.3
387 Requires: glibc >= 2.4
391 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
392 Requires: mysql >= 3.23
393 Requires: mysql-server >= 3.23
395 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
396 Requires: mysql >= 4.0
397 Requires: mysql-server >= 4.0
399 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
400 Requires: mysql >= 5.0
401 Requires: mysql-server >= 5.0
404 %if %{mysql} && %{su9} && ! %{mysql4}
405 Requires: mysql >= 3.23
406 Requires: mysql-client >= 3.23
408 %if %{mysql} && %{su9} && %{mysql4}
409 Requires: mysql >= 4.0
410 Requires: mysql-client >= 4.0
412 %if %{mysql} && %{su10} && %{mysql4}
413 Requires: mysql >= 4.0
414 Requires: mysql-client >= 4.0
416 %if %{mysql} && %{su10} && %{mysql5}
417 Requires: mysql >= 5.0
418 Requires: mysql-client >= 5.0
421 %if %{mysql} && %{mdk} && ! %{mysql4}
422 Requires: mysql >= 3.23
423 Requires: mysql-client >= 3.23
425 %if %{mysql} && %{mdk} && %{mysql4}
426 Requires: mysql >= 4.0
427 Requires: mysql-client >= 4.0
430 %if %{postgresql} && %{wb3}
431 Requires: rh-postgresql >= 7
432 Requires: rh-postgresql-server >= 7
434 %if %{postgresql} && ! %{wb3}
435 Requires: postgresql >= 7
436 Requires: postgresql-server >= 7
446 %description postgresql
460 This build requires MySQL to be installed separately as the catalog database.
463 This build requires PostgreSQL to be installed separately as the catalog database.
466 This build incorporates sqlite as the catalog database, statically compiled.
470 Summary: Bacula - The Network Backup Solution
471 Group: System Environment/Daemons
475 This is Bacula's version of mtx tape utilities for Linux distributions that
476 do not provide their own mtx package
479 Summary: Bacula - The Network Backup Solution
480 Group: System Environment/Daemons
482 Conflicts: bacula-mysql
483 Conflicts: bacula-sqlite
484 Conflicts: bacula-postgresql
485 Obsoletes: bacula-rescue
486 Requires: libstdc++, zlib, openssl
489 Requires: glibc >= 2.2
492 %if %{su9} || %{su10}
493 Requires: glibc >= 2.3
496 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
497 Requires: glibc >= 2.3
501 Requires: glibc >= 2.4
516 This is the File daemon (Client) only package. It includes the command line
521 Summary: Bacula - The Network Backup Solution
522 Group: System Environment/Daemons
524 %description updatedb
535 This package installs scripts for updating older versions of the bacula
540 Summary: Bacula - The Network Backup Solution
541 Group: System Environment/Daemons
542 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
545 %if %{gconsole} && %{su9}
546 Requires: gtk2 >= 2.0
547 Requires: libgnome >= 2.0
548 Requires: libgnomeui >= 2.0
549 Requires: glibc >= 2.3
551 Requires: libart_lgpl >= 2.0
552 Requires: libbonobo >= 2.0
553 Requires: libbonoboui >= 2.0
554 Requires: bonobo-activation
559 %if %{gconsole} && %{su10}
560 Requires: gtk2 >= 2.8
561 Requires: libgnome >= 2.12
562 Requires: libgnomeui >= 2.12
563 Requires: glibc >= 2.3
565 Requires: libart_lgpl >= 2.3
566 Requires: libbonobo >= 2.10
567 Requires: libbonoboui >= 2.10
568 Requires: bonobo-activation
572 Requires: fontconfig >= 2.3
573 Requires: gnome-vfs2 >= 2.12
576 %if %{gconsole} && %{mdk} && !%{mdv}
577 Requires: gtk2 >= 2.0
578 Requires: libgnomeui2
579 Requires: glibc >= 2.3
581 Requires: libart_lgpl >= 2.0
582 Requires: libbonobo >= 2.0
583 Requires: libbonoboui >= 2.0
587 %if %{gconsole} && %{mdv}
588 Requires: gtk2 >= 2.8
589 Requires: libgnomeui2
590 Requires: glibc >= 2.3
592 Requires: libart_lgpl >= 2.3
593 Requires: libbonobo >= 2.10
594 Requires: libbonoboui >= 2.10
598 %if %{gconsole} && %{fc3}
599 Requires: gtk2 >= 2.4
600 Requires: libgnomeui >= 2.8
601 Requires: glibc >= 2.3
603 Requires: libart_lgpl >= 2.3
604 Requires: libbonobo >= 2.8
605 Requires: libbonoboui >= 2.8
606 Requires: bonobo-activation
610 %if %{gconsole} && %{fc4}
611 Requires: gtk2 >= 2.6
612 Requires: libgnomeui >= 2.10
613 Requires: glibc >= 2.3
615 Requires: libart_lgpl >= 2.3
616 Requires: libbonobo >= 2.8
617 Requires: libbonoboui >= 2.8
618 Requires: bonobo-activation
622 %if %{gconsole} && %{fc5}
623 Requires: gtk2 >= 2.8
624 Requires: libgnomeui >= 2.14
625 Requires: glibc >= 2.4
627 Requires: libart_lgpl >= 2.3
628 Requires: libbonobo >= 2.14
629 Requires: libbonoboui >= 2.14
633 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
634 Requires: gtk2 >= 2.0
635 Requires: libgnomeui >= 2.0
636 Requires: glibc >= 2.3
638 Requires: libart_lgpl >= 2.0
639 Requires: libbonobo >= 2.0
640 Requires: libbonoboui >= 2.0
641 Requires: bonobo-activation
646 %if %{gconsole} && %{su9}
649 %if %{gconsole} && %{su10}
652 %if %{gconsole} && ! %{su9} && ! %{su10}
657 %description gconsole
668 This is the Gnome Console package. It is an add-on to the client or
674 Summary: Bacula - The Network Backup Solution
675 Group: System Environment/Daemons
676 Requires: wxGTK >= 2.6, libstdc++, openssl
679 %if %{wxconsole} && %{su10}
680 Requires: gtk2 >= 2.8
683 %if %{wxconsole} && %{fc3}
684 Requires: gtk2 >= 2.4
687 %if %{wxconsole} && %{fc4}
688 Requires: gtk2 >= 2.6
691 %if %{wxconsole} && %{fc5}
692 Requires: gtk2 >= 2.8
696 %description wxconsole
707 This is the WXWindows Console package. It is an add-on to the client or
721 %if %{su9} || %{su10}
722 export LDFLAGS="-L/usr/lib/termcap"
733 # patches for the bundled sqlite scripts
734 # as of 1.38.0 first 3 patches no longer needed
736 # patch the make_sqlite_tables script for installation bindir
737 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
739 # patch the create_sqlite_database script for installation bindir
740 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
742 # patch the make_catalog_backup script for installation bindir
743 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
745 # patch the update_sqlite_tables script for installation bindir
746 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
748 # patch the bacula-dir init script to remove sqlite service
749 %if %{sqlite} && %{su9}
750 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
752 %if %{sqlite} && %{su10}
753 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
756 # 64 bit lib location hacks
758 export LDFLAGS=-L/usr/lib64
760 %if %{mysql} && %{x86_64}
761 export LDFLAGS=-L/usr/lib64/mysql
766 --sbindir=/usr/sbin \
767 --sysconfdir=/etc/bacula \
768 --with-scriptdir=/etc/bacula \
769 --enable-smartalloc \
770 --enable-client-only \
780 --sbindir=/usr/sbin \
781 --sysconfdir=/etc/bacula \
782 --with-scriptdir=/etc/bacula \
783 --enable-smartalloc \
787 %if %{gconsole} && ! %{rh8}
788 --enable-tray-monitor \
794 --with-sqlite=${cwd}/%{depkgs}/sqlite \
800 --enable-wx-console \
802 --with-working-dir=%{working_dir} \
803 --with-pid-dir=/var/run \
804 --with-subsys-dir=/var/lock/subsys \
805 --with-dir-user=%{director_daemon_user} \
806 --with-dir-group=%{daemon_group} \
807 --with-sd-user=%{storage_daemon_user} \
808 --with-sd-group=%{storage_daemon_group} \
809 --with-fd-user=%{file_daemon_user} \
810 --with-fd-group=%{daemon_group} \
811 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
812 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
813 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
814 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
815 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
816 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
824 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
825 mkdir -p $RPM_BUILD_ROOT/etc/init.d
826 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
827 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
828 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
829 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
830 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
832 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
834 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
835 %if %{gconsole} && ! %{su9} && ! %{su10}
836 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
837 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
838 mkdir -p $RPM_BUILD_ROOT/usr/bin
842 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
846 prefix=$RPM_BUILD_ROOT/usr \
847 sbindir=$RPM_BUILD_ROOT/usr/sbin \
848 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
849 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
850 working_dir=$RPM_BUILD_ROOT%{working_dir} \
855 prefix=$RPM_BUILD_ROOT/usr \
856 sbindir=$RPM_BUILD_ROOT/usr/sbin \
857 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
858 working_dir=$RPM_BUILD_ROOT%{working_dir} \
859 mandir=$RPM_BUILD_ROOT/usr/man \
863 # fixme - make installs the mysql scripts for sqlite build
865 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
866 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
867 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
870 # fixme - make installs the mysql scripts for postgresql build
872 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
873 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
876 # fixme - make installs gconsole script for build without gconsole
878 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
881 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
883 # install the init scripts
884 %if %{su9} || %{su10}
885 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
886 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
887 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
890 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
891 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
892 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
894 %if ! %{su9} && ! %{su10} && ! %{mdk}
895 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
896 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
897 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
899 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
901 # install the menu stuff
902 %if %{gconsole} && %{su9}
903 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
904 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
905 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
906 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
908 %if %{gconsole} && %{su10}
909 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
910 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
911 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
912 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
914 %if %{wxconsole} && %{su10}
915 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
916 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
918 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
923 %if %{gconsole} && %{iftrick}
924 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
925 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
926 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
927 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
928 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
930 %if %{gconsole} && ! %{rh8}
931 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
932 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
934 %if %{wxconsole} && %{iftrick}
935 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
936 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
937 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
938 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
939 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
944 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
945 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
946 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
949 # install the logrotate file
950 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
952 # install the updatedb scripts
953 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
955 # install the logwatch scripts
956 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
957 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
958 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
959 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
960 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
961 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
963 # install the rescue files
964 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
965 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
966 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
967 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
968 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
969 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
970 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
971 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
972 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
973 rm -f src/filed/static-bacula-fd
976 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
977 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
980 # now clean up permissions that are left broken by the install
981 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
982 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
983 %if %{gconsole} && ! %{rh8}
984 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
985 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
989 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
992 # MySQL specific files
994 %defattr(-, root, root)
995 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
996 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
997 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
998 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
999 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1000 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1001 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1002 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1007 %defattr(-,root,root)
1008 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1009 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1010 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1011 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1012 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1013 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1014 %{sqlite_bindir}/libsqlite.a
1015 %{sqlite_bindir}/sqlite.h
1016 %{sqlite_bindir}/sqlite
1021 %defattr(-,root,root)
1022 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1023 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1024 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1025 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1026 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1027 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1030 # The rest is DB backend independent
1031 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1032 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1033 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1034 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1035 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1036 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1037 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1038 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1039 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1040 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1041 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1042 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1043 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1044 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1045 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1046 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1047 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1048 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1049 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1050 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1051 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1052 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1053 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1055 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1056 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1058 /etc/logrotate.d/bacula
1059 /etc/log.d/scripts/services/bacula
1060 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1061 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1062 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1063 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1064 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1065 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1066 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1067 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1069 /usr/sbin/bacula-dir
1077 /usr/sbin/btraceback
1086 # test for bacula database older than version 8
1087 # note: this ASSUMES no password has been set for bacula database
1088 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1093 # test for bacula database older than version 8
1094 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1095 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1100 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1103 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1104 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1105 echo "You appear to be running database version $DB_VER. You must first update"
1106 echo "your database to version 8 and then install this upgrade. The alternative"
1107 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1108 echo "catalog information, then do the upgrade. Information on updating a"
1109 echo "database older than version 8 can be found in the release notes."
1117 # check for and copy /etc/bacula/console.conf to bconsole.conf
1118 if [ -s /etc/bacula/console.conf ];then
1119 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1122 # create the daemon users and groups
1123 # first create the groups if they don't exist
1124 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1125 if [ -z "$HAVE_BACULA" ]; then
1126 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1127 echo "The group %{daemon_group} has been added to %{group_file}."
1128 echo "See the manual chapter \"Running Bacula\" for details."
1130 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1131 if [ -z "$HAVE_BACULA" ]; then
1132 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1133 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1134 echo "See the manual chapter \"Running Bacula\" for details."
1136 # now create the users if they do not exist
1137 # we do not use the -g option allowing the primary group to be set to system default
1138 # this will be a unique group on redhat type systems or the group users on some systems
1139 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1140 if [ -z "$HAVE_BACULA" ]; then
1141 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1142 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1143 echo "See the manual chapter \"Running Bacula\" for details."
1145 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1146 if [ -z "$HAVE_BACULA" ]; then
1147 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1148 echo "The user %{director_daemon_user} has been added to %{user_file}."
1149 echo "See the manual chapter \"Running Bacula\" for details."
1151 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1152 if [ -z "$HAVE_BACULA" ]; then
1153 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1154 echo "The user %{file_daemon_user} has been added to %{user_file}."
1155 echo "See the manual chapter \"Running Bacula\" for details."
1157 # now we add the supplementary groups, this is ok to call even if the users already exist
1158 # we only do this if the user is NOT root
1159 IS_ROOT=%{director_daemon_user}
1160 if [ "$IS_ROOT" != "root" ]; then
1161 %{usermod} -G %{daemon_group} %{director_daemon_user}
1163 IS_ROOT=%{storage_daemon_user}
1164 if [ "$IS_ROOT" != "root" ]; then
1165 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1167 IS_ROOT=%{file_daemon_user}
1168 if [ "$IS_ROOT" != "root" ]; then
1169 %{usermod} -G %{daemon_group} %{file_daemon_user}
1183 if [ "$1" -ge 1 ] ; then
1184 /sbin/chkconfig --add bacula-dir
1185 /sbin/chkconfig --add bacula-fd
1186 /sbin/chkconfig --add bacula-sd
1190 # test for an existing database
1191 # note: this ASSUMES no password has been set for bacula database
1192 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1194 # grant privileges and create tables if they do not exist
1195 if [ -z "$DB_VER" ]; then
1196 echo "Hmm, doesn't look like you have an existing database."
1197 echo "Granting privileges for MySQL user bacula..."
1198 /etc/bacula/grant_mysql_privileges
1199 echo "Creating MySQL bacula database..."
1200 /etc/bacula/create_mysql_database
1201 echo "Creating bacula tables..."
1202 /etc/bacula/make_mysql_tables
1204 # check to see if we need to upgrade a 1.36 or lower database
1205 elif [ "$DB_VER" -lt "9" ]; then
1206 echo "This release requires an upgrade to your bacula database."
1207 echo "Backing up your current database..."
1208 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1209 echo "Upgrading bacula database ..."
1210 /etc/bacula/update_mysql_tables
1211 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1217 # test for an existing database
1218 if [ -s %{working_dir}/bacula.db ]; then
1219 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1220 # check to see if we need to upgrade a 1.36 or lower database
1221 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1222 echo "This release requires an upgrade to your bacula database."
1223 echo "Backing up your current database..."
1224 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1225 echo "Upgrading bacula database ..."
1226 /etc/bacula/update_sqlite_tables
1227 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1230 # create the database and tables
1231 echo "Hmm, doesn't look like you have an existing database."
1232 echo "Creating SQLite database..."
1233 /etc/bacula/create_sqlite_database
1234 echo "Creating the SQLite tables..."
1235 /etc/bacula/make_sqlite_tables
1240 # test for an existing database
1241 # note: this ASSUMES no password has been set for bacula database
1242 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1244 # grant privileges and create tables if they do not exist
1245 if [ -z "$DB_VER" ]; then
1246 echo "Hmm, doesn't look like you have an existing database."
1247 echo "Creating PostgreSQL bacula database..."
1248 /etc/bacula/create_postgresql_database
1249 echo "Creating bacula tables..."
1250 /etc/bacula/make_postgresql_tables
1251 echo "Granting privileges for PostgreSQL user bacula..."
1252 /etc/bacula/grant_postgresql_privileges
1254 # check to see if we need to upgrade a 1.36 or lower database
1255 elif [ "$DB_VER" -lt "9" ]; then
1256 echo "This release requires an upgrade to your bacula database."
1257 echo "Backing up your current database..."
1258 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1259 echo "Upgrading bacula database ..."
1260 /etc/bacula/update_postgresql_tables
1261 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1266 # generate passwords if needed
1267 if [ -d /etc/bacula ]; then
1269 for file in *.conf; do
1270 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
1271 need_password=`grep $string $file 2>/dev/null`
1272 if [ -n "$need_password" ]; then
1273 pass=`openssl rand -base64 33`
1274 sed "s-$string-$pass-g" $file > $file.new
1275 cp -f $file.new $file; rm -f $file.new
1293 /sbin/chkconfig --del bacula-dir
1294 /sbin/chkconfig --del bacula-fd
1295 /sbin/chkconfig --del bacula-sd
1300 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1301 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1302 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1303 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1308 %defattr(-,root,root)
1309 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1310 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1311 /etc/init.d/bacula-fd
1312 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1314 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1315 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1317 /etc/logrotate.d/bacula
1319 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1320 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1321 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1324 /usr/sbin/btraceback
1325 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1326 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1332 # create the daemon group and user
1333 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1334 if [ -z "$HAVE_BACULA" ]; then
1335 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1336 echo "The group %{daemon_group} has been added to %{group_file}."
1337 echo "See the manual chapter \"Running Bacula\" for details."
1339 # we do not use the -g option allowing the primary group to be set to system default
1340 # this will be a unique group on redhat type systems or the group users on some systems
1341 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1342 if [ -z "$HAVE_BACULA" ]; then
1343 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1344 echo "The user %{file_daemon_user} has been added to %{user_file}."
1345 echo "See the manual chapter \"Running Bacula\" for details."
1347 # now we add the supplementary group, this is ok to call even if the user already exists
1348 # we only do this if the user is NOT root
1349 IS_ROOT=%{file_daemon_user}
1350 if [ "$IS_ROOT" != "root" ]; then
1351 %{usermod} -G %{daemon_group} %{file_daemon_user}
1356 if [ "$1" -ge 1 ] ; then
1357 /sbin/chkconfig --add bacula-fd
1360 # generate passwords if needed
1361 if [ -d /etc/bacula ]; then
1363 for file in *.conf; do
1364 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
1365 need_password=`grep $string $file 2>/dev/null`
1366 if [ -n "$need_password" ]; then
1367 pass=`openssl rand -base64 33`
1368 sed "s-$string-$pass-g" $file > $file.new
1369 cp -f $file.new $file; rm -f $file.new
1378 /sbin/chkconfig --del bacula-fd
1382 %defattr(-,root,%{daemon_group})
1383 /etc/bacula/updatedb/*
1386 # create the daemon group
1387 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1388 if [ -z "$HAVE_BACULA" ]; then
1389 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1390 echo "The group %{daemon_group} has been added to %{group_file}."
1391 echo "See the manual chapter \"Running Bacula\" for details."
1395 echo "The database update scripts were installed to /etc/bacula/updatedb"
1399 %defattr(-,root,root)
1400 /usr/sbin/gnome-console
1401 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1402 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1403 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1404 /usr/share/pixmaps/bacula.png
1405 /usr/share/applications/bacula.desktop
1408 %if %{gconsole} && ! %{rh8}
1409 /usr/sbin/bacula-tray-monitor
1410 %config(noreplace) /etc/bacula/tray-monitor.conf
1411 /usr/share/pixmaps/bacula-tray-monitor.xpm
1412 /usr/share/applications/bacula-tray-monitor.desktop
1415 %if %{gconsole} && ! %{su9} && ! %{su10}
1416 # add the console helper files
1417 %config(noreplace,missingok) /etc/pam.d/gnome-console
1418 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1419 /usr/bin/gnome-console
1424 # create the daemon group
1425 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1426 if [ -z "$HAVE_BACULA" ]; then
1427 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1428 echo "The group %{daemon_group} has been added to %{group_file}."
1429 echo "See the manual chapter \"Running Bacula\" for details."
1433 # generate passwords if needed
1434 if [ -d /etc/bacula ]; then
1436 for file in *.conf; do
1437 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
1438 need_password=`grep $string $file 2>/dev/null`
1439 if [ -n "$need_password" ]; then
1440 pass=`openssl rand -base64 33`
1441 sed "s-$string-$pass-g" $file > $file.new
1442 cp -f $file.new $file; rm -f $file.new
1451 %defattr(-,root,root)
1453 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1454 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1455 /usr/share/pixmaps/wxwin16x16.xpm
1456 /usr/share/applications/wxconsole.desktop
1459 %if %{wxconsole} && ! %{su9} && ! %{su10}
1460 # add the console helper files
1461 %config(noreplace,missingok) /etc/pam.d/wxconsole
1462 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1468 # create the daemon group
1469 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1470 if [ -z "$HAVE_BACULA" ]; then
1471 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1472 echo "The group %{daemon_group} has been added to %{group_file}."
1473 echo "See the manual chapter \"Running Bacula\" for details."
1477 # generate passwords if needed
1478 if [ -d /etc/bacula ]; then
1480 for file in *.conf; do
1481 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
1482 need_password=`grep $string $file 2>/dev/null`
1483 if [ -n "$need_password" ]; then
1484 pass=`openssl rand -base64 33`
1485 sed "s-$string-$pass-g" $file > $file.new
1486 cp -f $file.new $file; rm -f $file.new
1494 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1495 - update rescuever to 1.8.6
1496 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1497 - update depkgs to 25Jun06
1498 - add mysql5 build tag
1499 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1500 - 1.38.10 bump rescue version
1501 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1502 - fix usermod statements
1504 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1505 - add -g param back to useradd statements Bug 605
1506 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1507 - redundant code cleanup
1508 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1509 - add wxconsole package
1510 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1512 - dependency update for Mandriva
1513 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1515 - remove -n option from useradd scripts
1516 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 - fix problem specifying more than one primary group for user bacula
1519 - add build switch to not build gconsole regardless of platform
1520 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1521 - add centos3 build tag
1522 - fix link error of static-fd on Mandrake with --disable-nls
1523 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1524 - add fc4 dependencies
1525 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1526 - add SuSE 10.0 build
1527 - remove specific permission in attrib macros
1528 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1530 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1531 - refix compat for _dist on SLES9 which seems to have been removed
1532 - added note regarding Aleksandar's use of specific permissions in attrib macros
1533 - need to review and add specific fc4 build currently using fc3 Requires
1534 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1536 - Reorganize files and pre/post sections to remove repetitions
1537 - Always build separate mtx package
1538 - Fix file ownerships for /etc/bacula and Bacula's working dir
1539 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1540 - Disable GNOME on RH7
1541 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1542 - Red Hat and look alikes have mtx RPM, do not build/package our version
1543 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1544 - minor edit to _dist for SLES9 compatibility
1545 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1547 - kern changed location of pdf files and html manual in docs package
1548 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1550 - add docs (from prebuilt tarball) and rescue packages back in
1551 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1552 - remove 3 of 4 sqlite script patches as not needed
1553 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1555 - remove docs and rescue sections (remove static fd)
1556 - add dvd-freespace and dvd-writepart files
1557 - update depkgs to 22Jun05
1558 - change database update to 8 to 9
1559 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1560 - minor cleanups before 1.38 changes
1561 - add popt and popt-devel build dependencies
1562 - add tetex and tetex-dvips dependencies for doc build
1563 - replace deprecated Copyright tag with License
1564 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1565 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1566 - conflict with sqlite packages. remove readline dependency.
1567 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1568 - release 1.36.3 update docs
1569 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1570 - add centos4 build tag
1571 - add x86_64 build tag
1572 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1573 - add rhel4 build tag
1574 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1575 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1576 - add rhel3 build tag
1577 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1578 - fix tray-monitor.conf for noreplace
1579 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1580 - fix distribution check for Fedora and Whitebox
1581 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1582 - add logwatch script
1584 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1585 - add build for Fedora Core 3 (linc now included in ORDit2)
1586 - add mysql4 define for Mandrake 10.1
1587 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1588 - fix {group_file} variable in post scripts
1589 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1590 - add distribution checking and custom Distribution tag
1591 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1592 - ASSIGNMENT OF COPYRIGHT
1593 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1594 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1595 - all right, title and interest in and to the copyright in this software RPM
1596 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1597 - free of all liens, encumbrances or any known claims against said copyright.
1598 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1600 - thanks to Daniel Widyono
1601 - update description for rescue package to describe cdrom creation
1602 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1603 - update depkgs to 29Oct04
1604 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1605 - add cdrom rescue to bacula-rescue package
1606 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1607 - misc fixes from 1.36.0 suse feedback
1608 - fix situation where sqlite database exists but sqlite has been removed.
1609 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1610 - remove tray-monitor from RH8 build
1611 - fix permissions on tray-monitor files
1612 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1613 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1614 - change database update to 7 to 8 upgrade,
1615 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1616 - build in 30Jul04, add freetype dependancy to gnome package.
1617 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1618 - add documentation to console for groupadd
1619 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1620 - add support for running daemons as root.bacula
1621 - correct for change in location of floppy rescue files in 1.35.2
1622 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1623 - updated depgkgs to 30Jul04
1624 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1625 - really, really fix symlink creation for gconsole
1626 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1627 - fix symlink creation in gconsole post install
1628 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1629 - fixed error in gconsole post script
1630 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1631 - add check for gconsole symlink before trying to create it
1632 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1633 - fix some minor permissions issues on doc files that CVS won't let us fix
1634 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1635 - add pkgconfig to BuildRequires
1636 - clean up gnome1/2 menu entries for appropriate packages
1637 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1638 - tightened up doc distribution
1639 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1640 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1641 - rpm's horrible bug that prevents nested conditional macros prevents me
1642 - from implementing these 2 separate approaches within the conditionals which
1643 - create the separate server packages.
1644 - the solution adopted is to remove the gnome-console files from the server packages
1645 - so bacula-gconsole is now an add on for both client and server packages.
1646 - this also now allows the server packages to be install on machines without
1647 - an X-server and we can still maintain a single spec file.
1648 - added tests to make sure we have defined platform and database macros.
1649 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1650 - corrected mysql prerequisites for suse
1651 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1652 - replaced all cp commands with cp -p
1653 - removed addition of a+x permissions on gnome-console
1654 - corrected permissions on init scripts
1655 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1656 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1658 - various cleanup patches from Michael K. Johnson:
1659 - corrected post install routines for nicer chkconfig
1660 - removed chmod changes in post routines and moved to install section
1661 - removed interactive nature of post routine for rescue package
1662 - added description of building rescue disks to the description of rescue package
1663 - added clean of build root to beginning of install
1664 - removed specifying attr in all file lists
1665 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1666 - added bconsole to client package
1667 - added gconsole package as add-on to client
1668 - removed spurious dependancies on updatedb package (!cut/paste)
1669 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1670 - added updatedb package
1671 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1672 - added postgresql package
1673 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1674 - corrected the if else logic in the dependancy sections
1675 - changes for 1.34 release
1676 - /etc/bacula/console is now /etc/bacula/bconsole
1677 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1678 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1679 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1680 - added new /etc/bacula/drop_mysql_database
1681 - added new /etc/bacula/drop_sqlite_database
1682 - added new /etc/bacula/grant_sqlite_privileges
1683 - added new generic bacula database scripts in /etc/bacula
1684 - added pre-install sections to check for database versions older than 6
1685 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1686 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1687 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1688 - added testing for existing databases before executing any of the database creation scripts
1689 - added defines working_dir and sqlite_bindir in place of hard coded paths
1690 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1691 - added build configuration for SuSE.
1692 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1693 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1694 - added patch for create_sqlite_database to fix the installed bindir
1695 - added execute of create_sqlite_database to post of sqlite package
1696 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1697 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1698 - added bacula-fd as Requires for rescue package
1699 - added build tag for Fedora Core 1
1700 - cleaned up dependancies for all builds
1701 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1702 - removed rh_version from package names
1703 - added platform build configuration section to beginning of file
1704 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1705 - removed make_static_bacula script from rescue package install
1706 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1707 - Added define at top of file for depkgs version
1708 - Added rescue sub-package
1709 - Moved requires statements into proper sub-package locations
1710 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1711 - Corrected Requires for Gnome 1.4/2.0 builds
1712 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1713 - Added separate source declaration for depkgs
1714 - added patch for make_catalog_backup script
1715 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1716 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1717 - Added rh_version to sub-package names
1718 - Added installed but missing file /etc/bacula/gconsole
1719 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1720 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1721 - Update spec for version 1.31 and combine client
1722 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>