2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define _version @VERSION@
9 %define depkgs_version 25Jun06
10 %define _rescuever 1.8.6
11 %define docs_version @VERSION@
13 # any patches for this release
14 # be sure to check the setup section for patch macros
17 #--------------------------------------------------------------------------
18 # it should not be necessary to change anything below here for a release
19 # except for patch macros in the setup section
20 #--------------------------------------------------------------------------
22 Summary: Bacula - The Network Backup Solution
26 Group: System Environment/Daemons
28 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
29 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
30 Source2: Release_Notes-%{version}-%{release}.tar.gz
31 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
32 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
33 BuildRoot: %{_tmppath}/%{name}-root
34 URL: http://www.bacula.org/
35 Vendor: The Bacula Team
36 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
38 # define the basic package description
39 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
40 %define blurb2 Bacula is a set of computer programs that permit you (or the system
41 %define blurb3 administrator) to manage backup, recovery, and verification of computer
42 %define blurb4 data across a network of computers of different kinds. In technical terms,
43 %define blurb5 it is a network client/server based backup program. Bacula is relatively
44 %define blurb6 easy to use and efficient, while offering many advanced storage management
45 %define blurb7 features that make it easy to find and recover lost or damaged files.
46 %define blurb8 Bacula source code has been released under the GPL version 2 license.
49 %define sqlite_bindir /usr/lib/bacula/sqlite
50 %define working_dir /var/bacula
51 %define _docsrc ../%{name}-docs-%{docs_version}
52 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
53 %define depkgs ../depkgs
55 # NOTE these defines are used in some rather complex useradd and groupadd
56 # commands. If you change them examine the post scripts for consequences.
57 %define director_daemon_user bacula
58 %define storage_daemon_user bacula
59 %define file_daemon_user root
60 %define daemon_group bacula
61 # group that has write access to tape devices, usually disk on Linux
62 %define storage_daemon_group disk
63 %define user_file /etc/passwd
64 %define group_file /etc/group
65 %define useradd /usr/sbin/useradd
66 %define groupadd /usr/sbin/groupadd
67 %define usermod /usr/sbin/usermod
69 # platform defines - set one below or define the build_xxx on the command line
72 %{?build_rh7:%define rh7 1}
74 %{?build_rh8:%define rh8 1}
76 %{?build_rh9:%define rh9 1}
79 %{?build_fc1:%define fc1 1}
81 %{?build_fc3:%define fc3 1}
83 %{?build_fc4:%define fc4 1}
85 %{?build_fc5:%define fc5 1}
86 # Whitebox Enterprise build
88 %{?build_wb3:%define wb3 1}
89 # RedHat Enterprise builds
91 %{?build_rhel3:%define rhel3 1}
92 %{?build_rhel3:%define wb3 1}
94 %{?build_rhel4:%define rhel4 1}
95 %{?build_rhel4:%define fc3 1}
98 %{?build_centos3:%define centos3 1}
99 %{?build_centos3:%define wb3 1}
101 %{?build_centos4:%define centos4 1}
102 %{?build_centos4:%define fc3 1}
105 %{?build_su9:%define su9 1}
107 %{?build_su10:%define su10 1}
110 %{?build_mdk:%define mdk 1}
112 %{?build_mdv:%define mdv 1}
113 %{?build_mdv:%define mdk 1}
115 # test for a platform definition
116 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
117 %{error: You must specify a platform. Please examine the spec file.}
122 # set for database support desired or define the build_xxx on the command line
124 %{?build_mysql:%define mysql 1}
125 # if using mysql 4.x define this and mysql above
126 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
128 %{?build_mysql4:%define mysql4 1}
129 %{?build_mysql4:%define mysql 1}
130 # if using mysql 5.x define this and mysql above
131 # currently: SuSE 10.1 and Fedora Core 5
133 %{?build_mysql5:%define mysql5 1}
134 %{?build_mysql5:%define mysql 1}
136 %{?build_sqlite:%define sqlite 1}
138 %{?build_postgresql:%define postgresql 1}
140 # test for a database definition
141 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
142 %{error: You must specify database support. Please examine the spec file.}
147 %define db_backend mysql
150 %define db_backend sqlite
153 %define db_backend postgresql
158 %{?build_x86_64:%define x86_64 1}
160 # check what distribution we are
161 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
162 %define _dist %(grep Red /etc/redhat-release)
164 %if %{fc1} || %{fc4} || %{fc5}
165 %define _dist %(grep Fedora /etc/redhat-release)
167 %if %{centos4} || %{centos3}
168 %define _dist %(grep CentOS /etc/redhat-release)
170 %if %{fc3} && ! %{rhel4} && ! %{centos4}
171 %define _dist %(grep Fedora /etc/redhat-release)
173 %if %{wb3} && ! %{rhel3} && ! %{centos3}
174 %define _dist %(grep White /etc/whitebox-release)
176 %if %{su9} || %{su10}
177 %define _dist %(grep -i SuSE /etc/SuSE-release)
180 %define _dist %(grep Mand /etc/mandrake-release)
182 Distribution: %{_dist}
184 # Should we build gconsole, possible only if gnome >= 2.0 available
190 # specifically disallow gconsole if desired
191 %{?nobuild_gconsole:%define gconsole 0}
193 # Should we build wxconsole, only wxWidgets >=2.6 is supported
194 # currently only SuSE 10 and FC4
196 %{?build_wxconsole:%define wxconsole 1}
198 BuildRequires: gcc, gcc-c++, make, autoconf
199 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
200 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
201 BuildRequires: openssl-devel
203 BuildRequires: pkgconfig
206 BuildRequires: libtermcap-devel
207 BuildRequires: glibc-devel >= 2.2
210 BuildRequires: termcap
211 BuildRequires: glibc-devel >= 2.3
213 %if %{su9} && %{gconsole}
214 BuildRequires: libgnome >= 2.0
215 BuildRequires: gtk2-devel >= 2.0
216 BuildRequires: libgnomeui-devel >= 2.0
217 BuildRequires: ORBit2-devel
218 BuildRequires: libart_lgpl-devel >= 2.0
219 BuildRequires: libbonobo-devel >= 2.0
220 BuildRequires: libbonoboui-devel >= 2.0
221 BuildRequires: bonobo-activation-devel
222 BuildRequires: gconf2-devel
223 BuildRequires: linc-devel
224 BuildRequires: freetype2-devel
227 BuildRequires: termcap
228 BuildRequires: glibc-devel >= 2.3
230 %if %{su10} && %{gconsole}
231 BuildRequires: libgnome >= 2.12
232 BuildRequires: gtk2-devel >= 2.8
233 BuildRequires: libgnomeui-devel >= 2.12
234 BuildRequires: ORBit2-devel
235 BuildRequires: libart_lgpl-devel >= 2.3
236 BuildRequires: libbonobo-devel >= 2.10
237 BuildRequires: libbonoboui-devel >= 2.10
238 BuildRequires: bonobo-activation-devel
239 BuildRequires: gconf2-devel
240 BuildRequires: freetype2-devel
241 BuildRequires: cairo-devel
242 BuildRequires: fontconfig-devel >= 2.3
243 BuildRequires: gnome-vfs2-devel >= 2.12
244 BuildRequires: libpng-devel
247 BuildRequires: libtermcap-devel
248 BuildRequires: libstdc++-static-devel
249 BuildRequires: glibc-static-devel
250 BuildRequires: glibc-devel >= 2.3
252 %if %{mdk} && !%{mdv} && %{gconsole}
253 BuildRequires: gtk2-devel >= 2.0
254 BuildRequires: libgnomeui2-devel >= 2.0
255 BuildRequires: libORBit2-devel
256 BuildRequires: libart_lgpl-devel >= 2.0
257 BuildRequires: libbonobo2_0-devel
258 BuildRequires: libbonoboui2_0-devel
259 BuildRequires: libbonobo-activation-devel
260 BuildRequires: libGConf2-devel
261 BuildRequires: freetype2-devel
263 %if %{mdv} && %{gconsole}
264 BuildRequires: gtk2-devel >= 2.8
265 BuildRequires: libgnomeui2-devel >= 2.10
266 BuildRequires: libORBit2-devel
267 BuildRequires: libart_lgpl-devel >= 2.3
268 BuildRequires: libbonobo2_0-devel
269 BuildRequires: libbonoboui2_0-devel
270 BuildRequires: libbonobo-activation-devel
271 BuildRequires: libGConf2-devel
272 BuildRequires: freetype2-devel
275 BuildRequires: libtermcap-devel
276 BuildRequires: glibc-devel >= 2.3
278 %if %{fc3} && %{gconsole}
279 BuildRequires: gtk2-devel >= 2.4
280 BuildRequires: libgnomeui-devel >= 2.8
281 BuildRequires: ORBit2-devel
282 BuildRequires: libart_lgpl-devel >= 2.3
283 BuildRequires: libbonobo-devel >= 2.8
284 BuildRequires: libbonoboui-devel >= 2.8
285 BuildRequires: bonobo-activation-devel
286 BuildRequires: GConf2-devel
287 BuildRequires: freetype-devel
290 BuildRequires: libtermcap-devel
291 BuildRequires: glibc-devel >= 2.3
293 %if %{fc4} && %{gconsole}
294 BuildRequires: gtk2-devel >= 2.6
295 BuildRequires: libgnomeui-devel >= 2.10
296 BuildRequires: ORBit2-devel
297 BuildRequires: libart_lgpl-devel >= 2.3
298 BuildRequires: libbonobo-devel >= 2.8
299 BuildRequires: libbonoboui-devel >= 2.8
300 BuildRequires: bonobo-activation-devel
301 BuildRequires: GConf2-devel
302 BuildRequires: freetype-devel
305 BuildRequires: libtermcap-devel
306 BuildRequires: glibc-devel >= 2.4
308 %if %{fc5} && %{gconsole}
309 BuildRequires: gtk2-devel >= 2.8
310 BuildRequires: libgnomeui-devel >= 2.14
311 BuildRequires: ORBit2-devel
312 BuildRequires: libart_lgpl-devel >= 2.3
313 BuildRequires: libbonobo-devel >= 2.14
314 BuildRequires: libbonoboui-devel >= 2.14
315 BuildRequires: GConf2-devel
316 BuildRequires: freetype-devel
318 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
319 BuildRequires: libtermcap-devel
320 BuildRequires: glibc-devel >= 2.3
322 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
323 BuildRequires: gtk2-devel >= 2.0
324 BuildRequires: libgnomeui-devel >= 2.0
325 BuildRequires: ORBit2-devel
326 BuildRequires: libart_lgpl-devel >= 2.0
327 BuildRequires: libbonobo-devel >= 2.0
328 BuildRequires: libbonoboui-devel >= 2.0
329 BuildRequires: bonobo-activation-devel
330 BuildRequires: GConf2-devel
331 BuildRequires: linc-devel
332 BuildRequires: freetype-devel
335 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
336 BuildRequires: mysql-devel >= 3.23
339 %if %{mysql} && %{mysql4}
340 BuildRequires: mysql-devel >= 4.0
343 %if %{mysql} && %{mysql5}
344 BuildRequires: mysql-devel >= 5.0
347 %if %{postgresql} && %{wb3}
348 BuildRequires: rh-postgresql-devel >= 7
351 %if %{postgresql} && ! %{wb3}
352 BuildRequires: postgresql-devel >= 7
356 BuildRequires: wxGTK-devel >= 2.6
380 Summary: Bacula - The Network Backup Solution
381 Group: System Environment/Daemons
382 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
383 Conflicts: bacula-client
384 Obsoletes: bacula-rescue
385 Requires: ncurses, libstdc++, zlib, openssl, mtx
388 Requires: glibc >= 2.2
391 %if %{su9} || %{su10}
392 Requires: glibc >= 2.3
395 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
396 Requires: glibc >= 2.3
400 Requires: glibc >= 2.4
404 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
405 Requires: mysql >= 3.23
406 Requires: mysql-server >= 3.23
408 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
409 Requires: mysql >= 4.0
410 Requires: mysql-server >= 4.0
412 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
413 Requires: mysql >= 5.0
414 Requires: mysql-server >= 5.0
417 %if %{mysql} && %{su9} && ! %{mysql4}
418 Requires: mysql >= 3.23
419 Requires: mysql-client >= 3.23
421 %if %{mysql} && %{su9} && %{mysql4}
422 Requires: mysql >= 4.0
423 Requires: mysql-client >= 4.0
425 %if %{mysql} && %{su10} && %{mysql4}
426 Requires: mysql >= 4.0
427 Requires: mysql-client >= 4.0
429 %if %{mysql} && %{su10} && %{mysql5}
430 Requires: mysql >= 5.0
431 Requires: mysql-client >= 5.0
434 %if %{mysql} && %{mdk} && ! %{mysql4}
435 Requires: mysql >= 3.23
436 Requires: mysql-client >= 3.23
438 %if %{mysql} && %{mdk} && %{mysql4}
439 Requires: mysql >= 4.0
440 Requires: mysql-client >= 4.0
443 %if %{postgresql} && %{wb3}
444 Requires: rh-postgresql >= 7
445 Requires: rh-postgresql-server >= 7
447 %if %{postgresql} && ! %{wb3}
448 Requires: postgresql >= 7
449 Requires: postgresql-server >= 7
459 %description postgresql
473 This build requires MySQL to be installed separately as the catalog database.
476 This build requires PostgreSQL to be installed separately as the catalog database.
479 This build incorporates sqlite as the catalog database, statically compiled.
483 Summary: Bacula - The Network Backup Solution
484 Group: System Environment/Daemons
488 This is Bacula's version of mtx tape utilities for Linux distributions that
489 do not provide their own mtx package
492 Summary: Bacula - The Network Backup Solution
493 Group: System Environment/Daemons
495 Conflicts: bacula-mysql
496 Conflicts: bacula-sqlite
497 Conflicts: bacula-postgresql
498 Obsoletes: bacula-rescue
499 Requires: libstdc++, zlib, openssl
502 Requires: glibc >= 2.2
505 %if %{su9} || %{su10}
506 Requires: glibc >= 2.3
509 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
510 Requires: glibc >= 2.3
514 Requires: glibc >= 2.4
529 This is the File daemon (Client) only package. It includes the command line
534 Summary: Bacula - The Network Backup Solution
535 Group: System Environment/Daemons
537 %description updatedb
548 This package installs scripts for updating older versions of the bacula
553 Summary: Bacula - The Network Backup Solution
554 Group: System Environment/Daemons
555 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
558 %if %{gconsole} && %{su9}
559 Requires: gtk2 >= 2.0
560 Requires: libgnome >= 2.0
561 Requires: libgnomeui >= 2.0
562 Requires: glibc >= 2.3
564 Requires: libart_lgpl >= 2.0
565 Requires: libbonobo >= 2.0
566 Requires: libbonoboui >= 2.0
567 Requires: bonobo-activation
572 %if %{gconsole} && %{su10}
573 Requires: gtk2 >= 2.8
574 Requires: libgnome >= 2.12
575 Requires: libgnomeui >= 2.12
576 Requires: glibc >= 2.3
578 Requires: libart_lgpl >= 2.3
579 Requires: libbonobo >= 2.10
580 Requires: libbonoboui >= 2.10
581 Requires: bonobo-activation
585 Requires: fontconfig >= 2.3
586 Requires: gnome-vfs2 >= 2.12
589 %if %{gconsole} && %{mdk} && !%{mdv}
590 Requires: gtk2 >= 2.0
591 Requires: libgnomeui2
592 Requires: glibc >= 2.3
594 Requires: libart_lgpl >= 2.0
595 Requires: libbonobo >= 2.0
596 Requires: libbonoboui >= 2.0
600 %if %{gconsole} && %{mdv}
601 Requires: gtk2 >= 2.8
602 Requires: libgnomeui2
603 Requires: glibc >= 2.3
605 Requires: libart_lgpl >= 2.3
606 Requires: libbonobo >= 2.10
607 Requires: libbonoboui >= 2.10
611 %if %{gconsole} && %{fc3}
612 Requires: gtk2 >= 2.4
613 Requires: libgnomeui >= 2.8
614 Requires: glibc >= 2.3
616 Requires: libart_lgpl >= 2.3
617 Requires: libbonobo >= 2.8
618 Requires: libbonoboui >= 2.8
619 Requires: bonobo-activation
623 %if %{gconsole} && %{fc4}
624 Requires: gtk2 >= 2.6
625 Requires: libgnomeui >= 2.10
626 Requires: glibc >= 2.3
628 Requires: libart_lgpl >= 2.3
629 Requires: libbonobo >= 2.8
630 Requires: libbonoboui >= 2.8
631 Requires: bonobo-activation
635 %if %{gconsole} && %{fc5}
636 Requires: gtk2 >= 2.8
637 Requires: libgnomeui >= 2.14
638 Requires: glibc >= 2.4
640 Requires: libart_lgpl >= 2.3
641 Requires: libbonobo >= 2.14
642 Requires: libbonoboui >= 2.14
646 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
647 Requires: gtk2 >= 2.0
648 Requires: libgnomeui >= 2.0
649 Requires: glibc >= 2.3
651 Requires: libart_lgpl >= 2.0
652 Requires: libbonobo >= 2.0
653 Requires: libbonoboui >= 2.0
654 Requires: bonobo-activation
659 %if %{gconsole} && %{su9}
662 %if %{gconsole} && %{su10}
665 %if %{gconsole} && ! %{su9} && ! %{su10}
670 %description gconsole
681 This is the Gnome Console package. It is an add-on to the client or
687 Summary: Bacula - The Network Backup Solution
688 Group: System Environment/Daemons
689 Requires: wxGTK >= 2.6, libstdc++, openssl
692 %if %{wxconsole} && %{su10}
693 Requires: gtk2 >= 2.8
696 %if %{wxconsole} && %{fc3}
697 Requires: gtk2 >= 2.4
700 %if %{wxconsole} && %{fc4}
701 Requires: gtk2 >= 2.6
704 %if %{wxconsole} && %{fc5}
705 Requires: gtk2 >= 2.8
709 %description wxconsole
720 This is the WXWindows Console package. It is an add-on to the client or
734 %if %{su9} || %{su10}
735 export LDFLAGS="-L/usr/lib/termcap"
746 # patches for the bundled sqlite scripts
747 # as of 1.38.0 first 3 patches no longer needed
749 # patch the make_sqlite_tables script for installation bindir
750 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
752 # patch the create_sqlite_database script for installation bindir
753 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
755 # patch the make_catalog_backup script for installation bindir
756 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
758 # patch the update_sqlite_tables script for installation bindir
759 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
761 # patch the bacula-dir init script to remove sqlite service
762 %if %{sqlite} && %{su9}
763 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
765 %if %{sqlite} && %{su10}
766 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
769 # 64 bit lib location hacks
771 export LDFLAGS=-L/usr/lib64
773 %if %{mysql} && %{x86_64}
774 export LDFLAGS=-L/usr/lib64/mysql
779 --sbindir=/usr/sbin \
780 --sysconfdir=/etc/bacula \
781 --with-scriptdir=/etc/bacula \
782 --enable-smartalloc \
783 --enable-client-only \
793 --sbindir=/usr/sbin \
794 --sysconfdir=/etc/bacula \
795 --with-scriptdir=/etc/bacula \
796 --enable-smartalloc \
800 %if %{gconsole} && ! %{rh8}
801 --enable-tray-monitor \
807 --with-sqlite=${cwd}/%{depkgs}/sqlite \
813 --enable-wx-console \
815 --with-working-dir=%{working_dir} \
816 --with-pid-dir=/var/run \
817 --with-subsys-dir=/var/lock/subsys \
818 --with-dir-user=%{director_daemon_user} \
819 --with-dir-group=%{daemon_group} \
820 --with-sd-user=%{storage_daemon_user} \
821 --with-sd-group=%{storage_daemon_group} \
822 --with-fd-user=%{file_daemon_user} \
823 --with-fd-group=%{daemon_group} \
824 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
825 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
826 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
827 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
828 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
829 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
837 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
838 mkdir -p $RPM_BUILD_ROOT/etc/init.d
839 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
840 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
841 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
842 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
843 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
845 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
847 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
848 %if %{gconsole} && ! %{su9} && ! %{su10}
849 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
850 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
851 mkdir -p $RPM_BUILD_ROOT/usr/bin
855 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
859 prefix=$RPM_BUILD_ROOT/usr \
860 sbindir=$RPM_BUILD_ROOT/usr/sbin \
861 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
862 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
863 working_dir=$RPM_BUILD_ROOT%{working_dir} \
868 prefix=$RPM_BUILD_ROOT/usr \
869 sbindir=$RPM_BUILD_ROOT/usr/sbin \
870 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
871 working_dir=$RPM_BUILD_ROOT%{working_dir} \
872 mandir=$RPM_BUILD_ROOT/usr/man \
876 # fixme - make installs the mysql scripts for sqlite build
878 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
879 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
880 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
883 # fixme - make installs the mysql scripts for postgresql build
885 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
886 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
889 # fixme - make installs gconsole script for build without gconsole
891 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
894 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
896 # install the init scripts
897 %if %{su9} || %{su10}
898 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
899 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
900 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
903 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
904 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
905 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
907 %if ! %{su9} && ! %{su10} && ! %{mdk}
908 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
909 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
910 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
912 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
914 # install the menu stuff
915 %if %{gconsole} && %{su9}
916 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
917 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
918 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
919 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
921 %if %{gconsole} && %{su10}
922 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
923 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
924 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
925 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
927 %if %{wxconsole} && %{su10}
928 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
929 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
931 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
936 %if %{gconsole} && %{iftrick}
937 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
938 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
939 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
940 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
941 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
943 %if %{gconsole} && ! %{rh8}
944 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
945 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
947 %if %{wxconsole} && %{iftrick}
948 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
949 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
950 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
951 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
952 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
957 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
958 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
959 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
962 # install the logrotate file
963 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
965 # install the updatedb scripts
966 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
968 # install the logwatch scripts
969 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
970 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
971 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
972 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
973 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
974 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
976 # install the rescue files
977 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
978 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
979 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
980 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
981 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
982 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
983 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
984 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
985 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
986 rm -f src/filed/static-bacula-fd
989 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
990 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
993 # now clean up permissions that are left broken by the install
994 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
995 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
996 %if %{gconsole} && ! %{rh8}
997 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
998 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
1002 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1005 # MySQL specific files
1007 %defattr(-, root, root)
1008 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
1009 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
1010 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
1011 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
1012 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1013 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1014 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1015 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1020 %defattr(-,root,root)
1021 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1022 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1023 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1024 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1025 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1026 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1027 %{sqlite_bindir}/libsqlite.a
1028 %{sqlite_bindir}/sqlite.h
1029 %{sqlite_bindir}/sqlite
1034 %defattr(-,root,root)
1035 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1036 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1037 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1038 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1039 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1040 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1043 # The rest is DB backend independent
1044 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1045 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1046 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1047 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1048 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1049 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1050 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1051 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1052 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1053 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1054 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1055 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1056 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1057 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1058 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1059 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1060 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1061 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1062 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1063 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1064 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1065 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1066 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1068 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1069 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1071 /etc/logrotate.d/bacula
1072 /etc/log.d/scripts/services/bacula
1073 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1074 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1075 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1076 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1077 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1078 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1079 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1080 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1082 /usr/sbin/bacula-dir
1090 /usr/sbin/btraceback
1099 # test for bacula database older than version 8
1100 # note: this ASSUMES no password has been set for bacula database
1101 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1106 # test for bacula database older than version 8
1107 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1108 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1113 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1116 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1117 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1118 echo "You appear to be running database version $DB_VER. You must first update"
1119 echo "your database to version 8 and then install this upgrade. The alternative"
1120 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1121 echo "catalog information, then do the upgrade. Information on updating a"
1122 echo "database older than version 8 can be found in the release notes."
1130 # check for and copy /etc/bacula/console.conf to bconsole.conf
1131 if [ -s /etc/bacula/console.conf ];then
1132 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1135 # create the daemon users and groups
1136 # first create the groups if they don't exist
1137 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1138 if [ -z "$HAVE_BACULA" ]; then
1139 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1140 echo "The group %{daemon_group} has been added to %{group_file}."
1141 echo "See the manual chapter \"Running Bacula\" for details."
1143 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1144 if [ -z "$HAVE_BACULA" ]; then
1145 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1146 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1147 echo "See the manual chapter \"Running Bacula\" for details."
1149 # now create the users if they do not exist
1150 # we do not use the -g option allowing the primary group to be set to system default
1151 # this will be a unique group on redhat type systems or the group users on some systems
1152 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1153 if [ -z "$HAVE_BACULA" ]; then
1154 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1155 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1156 echo "See the manual chapter \"Running Bacula\" for details."
1158 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1159 if [ -z "$HAVE_BACULA" ]; then
1160 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1161 echo "The user %{director_daemon_user} has been added to %{user_file}."
1162 echo "See the manual chapter \"Running Bacula\" for details."
1164 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1165 if [ -z "$HAVE_BACULA" ]; then
1166 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1167 echo "The user %{file_daemon_user} has been added to %{user_file}."
1168 echo "See the manual chapter \"Running Bacula\" for details."
1170 # now we add the supplementary groups, this is ok to call even if the users already exist
1171 # we only do this if the user is NOT root
1172 IS_ROOT=%{director_daemon_user}
1173 if [ "$IS_ROOT" != "root" ]; then
1174 %{usermod} -G %{daemon_group} %{director_daemon_user}
1176 IS_ROOT=%{storage_daemon_user}
1177 if [ "$IS_ROOT" != "root" ]; then
1178 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1180 IS_ROOT=%{file_daemon_user}
1181 if [ "$IS_ROOT" != "root" ]; then
1182 %{usermod} -G %{daemon_group} %{file_daemon_user}
1196 if [ "$1" -ge 1 ] ; then
1197 /sbin/chkconfig --add bacula-dir
1198 /sbin/chkconfig --add bacula-fd
1199 /sbin/chkconfig --add bacula-sd
1203 # test for an existing database
1204 # note: this ASSUMES no password has been set for bacula database
1205 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1207 # grant privileges and create tables if they do not exist
1208 if [ -z "$DB_VER" ]; then
1209 echo "Hmm, doesn't look like you have an existing database."
1210 echo "Granting privileges for MySQL user bacula..."
1211 /etc/bacula/grant_mysql_privileges
1212 echo "Creating MySQL bacula database..."
1213 /etc/bacula/create_mysql_database
1214 echo "Creating bacula tables..."
1215 /etc/bacula/make_mysql_tables
1217 # check to see if we need to upgrade a 1.36 or lower database
1218 elif [ "$DB_VER" -lt "9" ]; then
1219 echo "This release requires an upgrade to your bacula database."
1220 echo "Backing up your current database..."
1221 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1222 echo "Upgrading bacula database ..."
1223 /etc/bacula/update_mysql_tables
1224 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1230 # test for an existing database
1231 if [ -s %{working_dir}/bacula.db ]; then
1232 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1233 # check to see if we need to upgrade a 1.36 or lower database
1234 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1235 echo "This release requires an upgrade to your bacula database."
1236 echo "Backing up your current database..."
1237 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1238 echo "Upgrading bacula database ..."
1239 /etc/bacula/update_sqlite_tables
1240 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1243 # create the database and tables
1244 echo "Hmm, doesn't look like you have an existing database."
1245 echo "Creating SQLite database..."
1246 /etc/bacula/create_sqlite_database
1247 echo "Creating the SQLite tables..."
1248 /etc/bacula/make_sqlite_tables
1253 # test for an existing database
1254 # note: this ASSUMES no password has been set for bacula database
1255 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1257 # grant privileges and create tables if they do not exist
1258 if [ -z "$DB_VER" ]; then
1259 echo "Hmm, doesn't look like you have an existing database."
1260 echo "Creating PostgreSQL bacula database..."
1261 /etc/bacula/create_postgresql_database
1262 echo "Creating bacula tables..."
1263 /etc/bacula/make_postgresql_tables
1264 echo "Granting privileges for PostgreSQL user bacula..."
1265 /etc/bacula/grant_postgresql_privileges
1267 # check to see if we need to upgrade a 1.36 or lower database
1268 elif [ "$DB_VER" -lt "9" ]; then
1269 echo "This release requires an upgrade to your bacula database."
1270 echo "Backing up your current database..."
1271 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1272 echo "Upgrading bacula database ..."
1273 /etc/bacula/update_postgresql_tables
1274 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1279 # generate passwords if needed
1280 if [ -d /etc/bacula ]; then
1282 for file in *.conf; do
1283 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
1284 need_password=`grep $string $file 2>/dev/null`
1285 if [ -n "$need_password" ]; then
1286 pass=`openssl rand -base64 33`
1287 sed "s-$string-$pass-g" $file > $file.new
1288 cp -f $file.new $file; rm -f $file.new
1306 /sbin/chkconfig --del bacula-dir
1307 /sbin/chkconfig --del bacula-fd
1308 /sbin/chkconfig --del bacula-sd
1313 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1314 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1315 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1316 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1321 %defattr(-,root,root)
1322 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1323 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1324 /etc/init.d/bacula-fd
1325 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1327 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1328 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1330 /etc/logrotate.d/bacula
1332 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1333 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1334 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1337 /usr/sbin/btraceback
1338 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1339 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1345 # create the daemon group and user
1346 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1347 if [ -z "$HAVE_BACULA" ]; then
1348 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1349 echo "The group %{daemon_group} has been added to %{group_file}."
1350 echo "See the manual chapter \"Running Bacula\" for details."
1352 # we do not use the -g option allowing the primary group to be set to system default
1353 # this will be a unique group on redhat type systems or the group users on some systems
1354 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1355 if [ -z "$HAVE_BACULA" ]; then
1356 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1357 echo "The user %{file_daemon_user} has been added to %{user_file}."
1358 echo "See the manual chapter \"Running Bacula\" for details."
1360 # now we add the supplementary group, this is ok to call even if the user already exists
1361 # we only do this if the user is NOT root
1362 IS_ROOT=%{file_daemon_user}
1363 if [ "$IS_ROOT" != "root" ]; then
1364 %{usermod} -G %{daemon_group} %{file_daemon_user}
1369 if [ "$1" -ge 1 ] ; then
1370 /sbin/chkconfig --add bacula-fd
1373 # generate passwords if needed
1374 if [ -d /etc/bacula ]; then
1376 for file in *.conf; do
1377 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1378 need_password=`grep $string $file 2>/dev/null`
1379 if [ -n "$need_password" ]; then
1380 pass=`openssl rand -base64 33`
1381 sed "s-$string-$pass-g" $file > $file.new
1382 cp -f $file.new $file; rm -f $file.new
1391 /sbin/chkconfig --del bacula-fd
1395 %defattr(-,root,%{daemon_group})
1396 /etc/bacula/updatedb/*
1399 # create the daemon group
1400 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1401 if [ -z "$HAVE_BACULA" ]; then
1402 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1403 echo "The group %{daemon_group} has been added to %{group_file}."
1404 echo "See the manual chapter \"Running Bacula\" for details."
1408 echo "The database update scripts were installed to /etc/bacula/updatedb"
1412 %defattr(-,root,root)
1413 /usr/sbin/gnome-console
1414 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1415 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1416 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1417 /usr/share/pixmaps/bacula.png
1418 /usr/share/applications/bacula.desktop
1421 %if %{gconsole} && ! %{rh8}
1422 /usr/sbin/bacula-tray-monitor
1423 %config(noreplace) /etc/bacula/tray-monitor.conf
1424 /usr/share/pixmaps/bacula-tray-monitor.xpm
1425 /usr/share/applications/bacula-tray-monitor.desktop
1428 %if %{gconsole} && ! %{su9} && ! %{su10}
1429 # add the console helper files
1430 %config(noreplace,missingok) /etc/pam.d/gnome-console
1431 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1432 /usr/bin/gnome-console
1437 # create the daemon group
1438 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1439 if [ -z "$HAVE_BACULA" ]; then
1440 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1441 echo "The group %{daemon_group} has been added to %{group_file}."
1442 echo "See the manual chapter \"Running Bacula\" for details."
1446 # generate passwords if needed
1447 if [ -d /etc/bacula ]; then
1449 for file in *.conf; do
1450 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
1451 need_password=`grep $string $file 2>/dev/null`
1452 if [ -n "$need_password" ]; then
1453 pass=`openssl rand -base64 33`
1454 sed "s-$string-$pass-g" $file > $file.new
1455 cp -f $file.new $file; rm -f $file.new
1464 %defattr(-,root,root)
1466 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1467 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1468 /usr/share/pixmaps/wxwin16x16.xpm
1469 /usr/share/applications/wxconsole.desktop
1472 %if %{wxconsole} && ! %{su9} && ! %{su10}
1473 # add the console helper files
1474 %config(noreplace,missingok) /etc/pam.d/wxconsole
1475 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1481 # create the daemon group
1482 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1483 if [ -z "$HAVE_BACULA" ]; then
1484 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1485 echo "The group %{daemon_group} has been added to %{group_file}."
1486 echo "See the manual chapter \"Running Bacula\" for details."
1490 # generate passwords if needed
1491 if [ -d /etc/bacula ]; then
1493 for file in *.conf; do
1494 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
1495 need_password=`grep $string $file 2>/dev/null`
1496 if [ -n "$need_password" ]; then
1497 pass=`openssl rand -base64 33`
1498 sed "s-$string-$pass-g" $file > $file.new
1499 cp -f $file.new $file; rm -f $file.new
1507 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - add requires for standard compiler toolchain
1509 - move version and release tags up
1511 - add docs_version tag
1512 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 - update rescuever to 1.8.6
1514 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1515 - update depkgs to 25Jun06
1516 - add mysql5 build tag
1517 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 - 1.38.10 bump rescue version
1519 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1520 - fix usermod statements
1522 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1523 - add -g param back to useradd statements Bug 605
1524 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1525 - redundant code cleanup
1526 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1527 - add wxconsole package
1528 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1530 - dependency update for Mandriva
1531 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - remove -n option from useradd scripts
1534 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1536 - fix problem specifying more than one primary group for user bacula
1537 - add build switch to not build gconsole regardless of platform
1538 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1539 - add centos3 build tag
1540 - fix link error of static-fd on Mandrake with --disable-nls
1541 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1542 - add fc4 dependencies
1543 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1544 - add SuSE 10.0 build
1545 - remove specific permission in attrib macros
1546 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1549 - refix compat for _dist on SLES9 which seems to have been removed
1550 - added note regarding Aleksandar's use of specific permissions in attrib macros
1551 - need to review and add specific fc4 build currently using fc3 Requires
1552 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1554 - Reorganize files and pre/post sections to remove repetitions
1555 - Always build separate mtx package
1556 - Fix file ownerships for /etc/bacula and Bacula's working dir
1557 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1558 - Disable GNOME on RH7
1559 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1560 - Red Hat and look alikes have mtx RPM, do not build/package our version
1561 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1562 - minor edit to _dist for SLES9 compatibility
1563 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1565 - kern changed location of pdf files and html manual in docs package
1566 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1568 - add docs (from prebuilt tarball) and rescue packages back in
1569 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1570 - remove 3 of 4 sqlite script patches as not needed
1571 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1573 - remove docs and rescue sections (remove static fd)
1574 - add dvd-freespace and dvd-writepart files
1575 - update depkgs to 22Jun05
1576 - change database update to 8 to 9
1577 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1578 - minor cleanups before 1.38 changes
1579 - add popt and popt-devel build dependencies
1580 - add tetex and tetex-dvips dependencies for doc build
1581 - replace deprecated Copyright tag with License
1582 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1583 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1584 - conflict with sqlite packages. remove readline dependency.
1585 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1586 - release 1.36.3 update docs
1587 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1588 - add centos4 build tag
1589 - add x86_64 build tag
1590 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1591 - add rhel4 build tag
1592 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1593 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1594 - add rhel3 build tag
1595 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1596 - fix tray-monitor.conf for noreplace
1597 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1598 - fix distribution check for Fedora and Whitebox
1599 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1600 - add logwatch script
1602 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1603 - add build for Fedora Core 3 (linc now included in ORDit2)
1604 - add mysql4 define for Mandrake 10.1
1605 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1606 - fix {group_file} variable in post scripts
1607 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1608 - add distribution checking and custom Distribution tag
1609 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1610 - ASSIGNMENT OF COPYRIGHT
1611 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1612 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1613 - all right, title and interest in and to the copyright in this software RPM
1614 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1615 - free of all liens, encumbrances or any known claims against said copyright.
1616 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1618 - thanks to Daniel Widyono
1619 - update description for rescue package to describe cdrom creation
1620 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1621 - update depkgs to 29Oct04
1622 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1623 - add cdrom rescue to bacula-rescue package
1624 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1625 - misc fixes from 1.36.0 suse feedback
1626 - fix situation where sqlite database exists but sqlite has been removed.
1627 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1628 - remove tray-monitor from RH8 build
1629 - fix permissions on tray-monitor files
1630 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1631 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1632 - change database update to 7 to 8 upgrade,
1633 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1634 - build in 30Jul04, add freetype dependancy to gnome package.
1635 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1636 - add documentation to console for groupadd
1637 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1638 - add support for running daemons as root.bacula
1639 - correct for change in location of floppy rescue files in 1.35.2
1640 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1641 - updated depgkgs to 30Jul04
1642 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1643 - really, really fix symlink creation for gconsole
1644 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1645 - fix symlink creation in gconsole post install
1646 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1647 - fixed error in gconsole post script
1648 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1649 - add check for gconsole symlink before trying to create it
1650 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1651 - fix some minor permissions issues on doc files that CVS won't let us fix
1652 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1653 - add pkgconfig to BuildRequires
1654 - clean up gnome1/2 menu entries for appropriate packages
1655 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1656 - tightened up doc distribution
1657 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1658 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1659 - rpm's horrible bug that prevents nested conditional macros prevents me
1660 - from implementing these 2 separate approaches within the conditionals which
1661 - create the separate server packages.
1662 - the solution adopted is to remove the gnome-console files from the server packages
1663 - so bacula-gconsole is now an add on for both client and server packages.
1664 - this also now allows the server packages to be install on machines without
1665 - an X-server and we can still maintain a single spec file.
1666 - added tests to make sure we have defined platform and database macros.
1667 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1668 - corrected mysql prerequisites for suse
1669 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1670 - replaced all cp commands with cp -p
1671 - removed addition of a+x permissions on gnome-console
1672 - corrected permissions on init scripts
1673 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1674 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1676 - various cleanup patches from Michael K. Johnson:
1677 - corrected post install routines for nicer chkconfig
1678 - removed chmod changes in post routines and moved to install section
1679 - removed interactive nature of post routine for rescue package
1680 - added description of building rescue disks to the description of rescue package
1681 - added clean of build root to beginning of install
1682 - removed specifying attr in all file lists
1683 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1684 - added bconsole to client package
1685 - added gconsole package as add-on to client
1686 - removed spurious dependancies on updatedb package (!cut/paste)
1687 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1688 - added updatedb package
1689 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1690 - added postgresql package
1691 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1692 - corrected the if else logic in the dependancy sections
1693 - changes for 1.34 release
1694 - /etc/bacula/console is now /etc/bacula/bconsole
1695 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1696 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1697 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1698 - added new /etc/bacula/drop_mysql_database
1699 - added new /etc/bacula/drop_sqlite_database
1700 - added new /etc/bacula/grant_sqlite_privileges
1701 - added new generic bacula database scripts in /etc/bacula
1702 - added pre-install sections to check for database versions older than 6
1703 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1704 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1705 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1706 - added testing for existing databases before executing any of the database creation scripts
1707 - added defines working_dir and sqlite_bindir in place of hard coded paths
1708 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1709 - added build configuration for SuSE.
1710 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1711 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1712 - added patch for create_sqlite_database to fix the installed bindir
1713 - added execute of create_sqlite_database to post of sqlite package
1714 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1715 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1716 - added bacula-fd as Requires for rescue package
1717 - added build tag for Fedora Core 1
1718 - cleaned up dependancies for all builds
1719 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1720 - removed rh_version from package names
1721 - added platform build configuration section to beginning of file
1722 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1723 - removed make_static_bacula script from rescue package install
1724 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1725 - Added define at top of file for depkgs version
1726 - Added rescue sub-package
1727 - Moved requires statements into proper sub-package locations
1728 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1729 - Corrected Requires for Gnome 1.4/2.0 builds
1730 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1731 - Added separate source declaration for depkgs
1732 - added patch for make_catalog_backup script
1733 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1734 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1735 - Added rh_version to sub-package names
1736 - Added installed but missing file /etc/bacula/gconsole
1737 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1738 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1739 - Update spec for version 1.31 and combine client
1740 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>