3 # Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
5 # Platform Build Configuration
7 # basic defines for every build
10 %define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
11 %define depkgs_version 18Dec09
14 %{?single_dir_install:%define single_dir 1}
16 # Installation Directory locations
18 %define _prefix /opt/bacula
19 %define _sbindir /opt/bacula/bin
20 %define _bindir /opt/bacula/bin
21 %define _subsysdir /opt/bacula/working
22 %define sqlite_bindir /opt/bacula/sqlite
23 %define _mandir /usr/share/man
24 %define sysconf_dir /opt/bacula/etc
25 %define script_dir /opt/bacula/scripts
26 %define working_dir /opt/bacula/working
27 %define pid_dir /opt/bacula/working
28 %define plugin_dir /opt/bacula/plugins
29 %define lib_dir /opt/bacula/lib
32 %define _sbindir %_prefix/sbin
33 %define _bindir %_prefix/bin
34 %define _subsysdir /var/lock/subsys
35 %define sqlite_bindir %_libdir/bacula/sqlite
36 %define _mandir %_prefix/share/man
37 %define sysconf_dir /etc/bacula
38 %define script_dir %_libdir/bacula
39 %define working_dir /var/lib/bacula
40 %define pid_dir /var/run
41 %define plugin_dir %_libdir/bacula/plugins
42 %define lib_dir %_libdir/bacula/lib
45 # Daemon user:group Don't change them unless you know what you are doing
46 %define director_daemon_user bacula
47 %define storage_daemon_user bacula
48 %define file_daemon_user root
49 %define daemon_group bacula
50 # group that has write access to tape devices, usually disk on Linux
51 %define storage_daemon_group disk
53 %define depkgs ../depkgs
55 # probems with mandriva build:
56 # nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
58 # set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
59 #openSUSE 11.1 %if 0%{?suse_version} == 1110
60 #openSUSE 11.0 %if 0%{?suse_version} == 1100
61 #openSUSE 10.3 %if 0%{?suse_version} == 1030
62 #openSUSE 10.2 %if 0%{?suse_version} == 1020
63 #SUSE Linux 10.1 %if 0%{?suse_version} == 1010
64 #SUSE Linux 10.0 %if 0%{?suse_version} == 1000
65 #SUSE Linux 9.3 %if 0%{?suse_version} == 930
66 #SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910
67 #SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010
68 #SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110
69 #CentOS 5 %if 0%{?centos_version} == 501
70 #RHEL 4 %if 0%{?rhel_version} == 406
71 #RHEL 5 %if 0%{?rhel_version} == 501
72 #Fedora 6 with Extras %if 0%{?fedora_version} == 6
73 #Fedora 7 with Extras %if 0%{?fedora_version} == 7
74 #Fedora 8 with Extras %if 0%{?fedora_version} == 8
75 #Fedora 9 with Extras %if 0%{?fedora_version} == 9
76 #Fedora 10 with Extras %if 0%{?fedora_version} == 10
77 #Mandriva 2006 %if 0%{?mandriva_version} == 2006
78 #Mandriva 2007 %if 0%{?mandriva_version} == 2007
79 #Mandriva 2008 %if 0%{?mandriva_version} == 2008
83 # am I running in opensuse build service?
84 # TODO: seems to make problems
86 # Build Service: Determine Distribution
89 %define build_x86_64 1
93 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
94 BuildRequires: GConf2-devel
95 BuildRequires: freetype-devel
96 BuildRequires: libtermcap-devel
97 BuildRequires: shadow-utils
101 %if 0%{?mandriva_version} == 2007
103 %define _dist "Mandriva 2007"
106 %if 0%{?fedora_version} == 8
108 %define _dist "Fedora Core 8"
109 BuildRequires: redhat-release
112 %if 0%{?fedora_version} == 9
114 %define _dist "Fedora Core 9"
115 BuildRequires: redhat-release
119 %if 0%{?fedora_version} == 10
121 %define _dist "Fedora Core 10"
122 BuildRequires: PolicyKit-gnome
123 BuildRequires: fedora-release
126 %if 0%{?fedora_version} == 11
128 %define _dist "Fedora Core 11"
129 BuildRequires: PolicyKit-gnome
130 BuildRequires: fedora-release
133 %if 0%{?rhel_version} == 501
134 %define build_rhel5 1
135 %define _dist "Red Hat Enterprise Linux Server release 5"
136 BuildRequires: redhat-release
139 %if 0%{?rhel_version} == 406
140 %define build_rhel4 1
141 %define _dist "Red Hat Enterprise Linux Server release 4"
142 BuildRequires: redhat-release
146 %if 0%{?centos_version} == 501
147 %define build_centos5 1
148 %define _dist "CentOS 5"
149 BuildRequires: redhat-release
153 %if 0%{?suse_version} == 1020
154 %define build_su102 1
155 %define _dist "OpenSUSE 10.2"
156 BuildRequires: suse-release
160 %if 0%{?suse_version} == 1030
161 %define build_su103 1
162 %define _dist "OpenSUSE 10.3"
163 BuildRequires: suse-release
166 %if 0%{?suse_version} == 1100
167 %define build_su110 1
168 %define _dist "SUSE 11"
169 BuildRequires: suse-release
173 %if 0%{?suse_version} == 1110
174 %define build_su111 1
175 %define _dist "SUSE 11"
178 %if 0%{?suse_version} == 1120
179 %define build_su112 1
180 %define _dist "SUSE 11"
184 %if 0%{?sles_version} == 9
186 %define _dist "SLES 9"
190 %if 0%{?sles_version} == 10
192 %define _dist "SLE 10"
196 %if 0%{?sles_version} == 11
197 %define build_su111 1
198 %define _dist "SLES 11"
205 # any patches for this release
206 # be sure to check the setup section for patch macros
208 #--------------------------------------------------------------------------
209 # it should not be necessary to change anything below here for a release
210 # except for patch macros in the setup section
211 #--------------------------------------------------------------------------
213 %{?contrib_packager:%define _packager %{contrib_packager}}
215 Summary: Bacula - The Network Backup Solution
219 Group: System Environment/Daemons
221 BuildRoot: %{_tmppath}/%{name}-root
222 URL: http://www.bacula.org/
223 Vendor: The Bacula Team
224 Packager: %{_packager}
227 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
228 # opensuse build service changes the release itself
229 # what happens if the release is not 1? DSB
231 Source1: Release_Notes-%{version}-1.tar.gz
233 Source1: Release_Notes-%{version}-%{release}.tar.gz
235 Source2: bacula-2.2.7-postgresql.patch
236 Source3: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
238 # define the basic package description
239 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
240 %define blurb2 Bacula is a set of computer programs that permit you (or the system
241 %define blurb3 administrator) to manage backup, recovery, and verification of computer
242 %define blurb4 data across a network of computers of different kinds. In technical terms,
243 %define blurb5 it is a network client/server based backup program. Bacula is relatively
244 %define blurb6 easy to use and efficient, while offering many advanced storage management
245 %define blurb7 features that make it easy to find and recover lost or damaged files.
246 %define blurb8 Bacula source code has been released under the GPL version 2 license.
248 %define user_file /etc/passwd
249 %define group_file /etc/group
252 %define useradd /usr/sbin/useradd
253 %define groupadd /usr/sbin/groupadd
254 %define usermod /usr/sbin/usermod
256 # platform defines - set one below or define the build_xxx on the command line
259 %{?build_rh7:%define rh7 1}
261 %{?build_rh8:%define rh8 1}
263 %{?build_rh9:%define rh9 1}
266 %{?build_fc1:%define fc1 1}
268 %{?build_fc3:%define fc3 1}
270 %{?build_fc4:%define fc4 1}
272 %{?build_fc5:%define fc5 1}
274 %{?build_fc6:%define fc6 1}
276 %{?build_fc7:%define fc7 1}
278 %{?build_fc8:%define fc8 1}
280 %{?build_fc9:%define fc9 1}
282 %{?build_fc10:%define fc10 1}
283 # Whitebox Enterprise build
285 %{?build_wb3:%define wb3 1}
286 # RedHat Enterprise builds
288 %{?build_rhel3:%define rhel3 1}
289 %{?build_rhel3:%define wb3 1}
291 %{?build_rhel4:%define rhel4 1}
292 %{?build_rhel4:%define fc3 1}
294 %{?build_rhel5:%define rhel5 1}
295 %{?build_rhel5:%define fc6 1}
298 %{?build_centos3:%define centos3 1}
299 %{?build_centos3:%define wb3 1}
301 %{?build_centos4:%define centos4 1}
302 %{?build_centos4:%define fc3 1}
304 %{?build_centos5:%define centos5 1}
305 %{?build_centos5:%define fc6 1}
308 %{?build_sl3:%define sl3 1}
309 %{?build_sl3:%define wb3 1}
311 %{?build_sl4:%define sl4 1}
312 %{?build_sl4:%define fc3 1}
314 %{?build_sl5:%define sl5 1}
315 %{?build_sl5:%define fc6 1}
318 %{?build_su9:%define su9 1}
320 %{?build_su10:%define su10 1}
322 %{?build_su102:%define su102 1}
324 %{?build_su103:%define su103 1}
326 %{?build_su110:%define su110 1}
328 %{?build_su111:%define su111 1}
330 %{?build_su112:%define su112 1}
333 %{?build_mdk:%define mdk 1}
335 %{?build_mdv:%define mdv 1}
336 %{?build_mdv:%define mdk 1}
339 %define client_only 0
340 %{?build_client_only:%define client_only 1}
342 # Setup some short cuts
344 %if %{rh7} || %{rh8} || %{rh9}
348 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
352 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
356 %if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
360 %if %{sl3} || %{sl4} || %{sl5}
365 # test for a platform definition
366 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
367 %{error: You must specify a platform. Please examine the spec file.}
371 # distribution-specific directory for logwatch
372 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
373 %define logwatch_dir /etc/log.d
375 %define logwatch_dir /etc/logwatch
379 # set for database support desired or define the build_xxx on the command line
381 %{?build_mysql:%define mysql 1}
383 %{?build_sqlite:%define sqlite 1}
385 %{?build_postgresql:%define postgresql 1}
387 # test for a database definition
388 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
389 %{error: You must specify database support, by passing one of the following to rpmbuild:}
390 %{error: --define build_postgresql=1}
391 %{error: --define build_sqlite=1}
392 %{error: --define build_mysql=1}
397 %define db_backend mysql
400 %define db_backend sqlite3
403 %define db_backend postgresql
408 %{?build_x86_64:%define x86_64 1}
410 # check what distribution we are
411 %if %{rhat} || %{rhel}
412 %define _dist %(grep Red /etc/redhat-release)
414 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
415 %define _dist %(grep Fedora /etc/redhat-release)
417 %if %{centos5} || %{centos4} || %{centos3}
418 %define _dist %(grep CentOS /etc/redhat-release)
420 %if %{sl5} ||%{sl4} || %{sl3}
421 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
423 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
424 %define _dist %(grep White /etc/whitebox-release)
427 %define _dist %(grep -i SuSE /etc/SuSE-release)
430 %define _dist %(grep Mand /etc/mandrake-release)
432 %{?DISTNAME:%define _dist %{DISTNAME}}
434 # only set Disribution if not in opensuse build service, as it sets it itself
435 %if ! 0%{?opensuse_bs}
436 Distribution: %{_dist}
439 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
440 # needed in opensuse_bs, as rpm is installed during build process
441 BuildRequires: libmysqlclient-devel
442 BuildRequires: mysql-client
445 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
446 BuildRequires: postgresql
447 BuildRequires: postgresql-server
449 BuildRequires: openssl
451 %if 0%{?opensuse_bs} && %{suse}
452 BuildRequires: pwdutils
453 BuildRequires: sysconfig
456 # should we turn on python support
458 %{?build_python:%define python 1}
460 # should we enable tcp wrappers support
461 %define tcpwrappers 0
462 %{?build_tcpwrappers:%define tcpwrappers 1}
464 # do we need to patch for old postgresql version?
466 %{?build_old_pgsql:%define old_pgsql 1}
468 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
470 %define manpage_ext bz2
472 %define manpage_ext gz
475 # for client only build
482 BuildRequires: gcc, gcc-c++, make, autoconf
483 BuildRequires: glibc, glibc-devel
484 BuildRequires: ncurses-devel, perl, readline-devel
485 BuildRequires: libstdc++-devel, zlib-devel
486 BuildRequires: openssl-devel
487 BuildRequires: libacl-devel
488 BuildRequires: pkgconfig
490 BuildRequires: libxml2-devel
493 BuildRequires: python, python-devel
494 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
498 BuildRequires: libxml-devel
501 BuildRequires: libstdc++-static-devel
502 BuildRequires: glibc-static-devel
506 BuildRequires: termcap
508 BuildRequires: libtermcap-devel
512 BuildRequires: sqlite-devel
516 BuildRequires: mysql-devel
519 %if %{postgresql} && %{wb3}
520 BuildRequires: rh-postgresql-devel >= 7
523 %if %{postgresql} && ! %{wb3}
524 BuildRequires: postgresql-devel >= 7
548 Summary: Bacula - The Network Backup Solution
549 Group: System Environment/Daemons
550 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
551 Conflicts: bacula-client
553 Requires: ncurses, libstdc++, zlib, openssl
554 Requires: glibc, readline
567 %if %{postgresql} && %{wb3}
568 Requires: rh-postgresql >= 7
570 %if %{postgresql} && ! %{wb3}
571 Requires: postgresql >= 7
581 %description postgresql
585 Requires: python >= %{pyver}
599 This build requires MySQL to be installed separately as the catalog database.
602 This build requires PostgreSQL to be installed separately as the catalog database.
605 This build incorporates sqlite3 as the catalog database, statically compiled.
608 This build includes python scripting support.
611 This build includes tcp-wrappers support.
615 Summary: Bacula - The Network Backup Solution
616 Group: System Environment/Daemons
618 Conflicts: bacula-mysql
619 Conflicts: bacula-sqlite
620 Conflicts: bacula-postgresql
626 Requires: libstdc++, zlib, openssl
627 Requires: glibc, readline
636 Requires: python >= %{pyver}
650 This is the File daemon (Client) only package. It includes the command line
653 This build includes python scripting support.
656 This build includes tcp-wrappers support.
662 Summary: Bacula - The Network Backup Solution
663 Group: System Environment/Daemons
665 %description updatedb
676 This package installs scripts for updating older versions of the bacula
680 # Must explicitly enable debug pkg on SuSE
681 # but not in opensuse_bs
682 %if %{suse} && ! 0%{?opensuse_bs}
694 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
704 %if %{wb3} || %{old_pgsql}
705 patch -p3 src/cats/postgresql.c < %SOURCE2
709 # patches for the bundled sqlite scripts
711 # patch the make_sqlite_tables script for installation bindir
712 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
714 # patch the create_sqlite_database script for installation bindir
715 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
717 # patch the make_catalog_backup script for installation bindir
718 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
720 # patch the update_sqlite_tables script for installation bindir
721 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
723 # patch the bacula-dir init script to remove sqlite service
724 %if %{sqlite} && %{suse}
725 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
729 # 64 bit lib location hacks
730 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
731 # reported to be fixed to properly detect lib locations.
733 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
735 %if %{mysql} && %{x86_64}
736 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
738 %if %{python} && %{x86_64}
739 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
742 # Main Bacula configuration
744 --prefix=%{_prefix} \
745 --sbindir=%{_sbindir} \
746 --sysconfdir=%{sysconf_dir} \
747 --mandir=%{_mandir} \
748 --with-scriptdir=%{script_dir} \
749 --with-working-dir=%{working_dir} \
750 --with-plugindir=%{script_dir} \
751 --with-pid-dir=%{pid_dir} \
752 --with-subsys-dir=%{_subsysdir} \
753 --enable-smartalloc \
755 --disable-bwx-console \
756 --disable-tray-monitor \
763 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
774 --with-tcp-wrappers \
777 --enable-client-only \
779 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
780 --disable-batch-insert \
782 --with-dir-user=%{director_daemon_user} \
783 --with-dir-group=%{daemon_group} \
784 --with-sd-user=%{storage_daemon_user} \
785 --with-sd-group=%{storage_daemon_group} \
786 --with-fd-user=%{file_daemon_user} \
787 --with-fd-group=%{daemon_group} \
788 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
789 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
790 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
791 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
792 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
793 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
801 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
802 mkdir -p $RPM_BUILD_ROOT/etc/init.d
803 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
804 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
805 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
806 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
807 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
808 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
810 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
811 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
814 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
817 make DESTDIR=$RPM_BUILD_ROOT install
820 # Program docs not installed on client
821 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
822 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
823 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
824 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
825 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
826 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
827 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
828 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
829 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
831 # Docs for programs that are depreciated
832 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
833 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
834 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
835 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
837 # fixme - make installs the mysql scripts for sqlite build
839 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
840 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
841 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
844 # fixme - make installs the mysql scripts for postgresql build
846 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
847 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
850 # install the init scripts
852 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
853 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
854 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
857 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
858 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
859 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
861 %if ! %{suse} && ! %{mdk}
862 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
863 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
864 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
866 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
868 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
869 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
874 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
875 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
876 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
880 # install the logrotate file
881 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
883 # install the updatedb scripts
884 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
886 # install the sample-query.sql file
887 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
889 # install the logwatch scripts
891 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
892 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
893 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
894 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
895 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
896 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
897 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
898 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
901 # now clean up permissions that are left broken by the install
902 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
904 # fix me - building enable-client-only installs files not included in bacula-client package
906 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
907 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
908 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
909 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
910 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
911 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
912 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
913 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
914 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
915 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
916 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
917 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
918 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
919 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
923 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
925 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
927 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
932 # MySQL specific files
934 %defattr(-, root, root)
935 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
936 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
937 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
938 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
939 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
940 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
941 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
942 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
947 %defattr(-,root,root)
948 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
949 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
950 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
951 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
952 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
953 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
954 %{sqlite_bindir}/libsqlite3.a
955 %{sqlite_bindir}/sqlite3.h
956 %{sqlite_bindir}/sqlite3
963 %defattr(-,root,root)
964 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
965 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
966 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
967 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
968 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
969 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
970 # The rest is DB backend independent
972 # opensuse_bs: directories not owned by any package
973 %dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
976 %attr(-, root, %{daemon_group}) %dir %{script_dir}
977 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
978 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
979 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
980 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
981 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
982 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
983 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
984 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
985 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
986 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
987 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
988 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
989 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
990 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
991 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
992 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
993 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
994 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
995 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
996 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
997 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
998 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
999 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1000 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1001 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1002 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
1004 /etc/logrotate.d/bacula
1005 %{logwatch_dir}/scripts/services/bacula
1006 %{logwatch_dir}/scripts/shared/applybaculadate
1007 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1008 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1009 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1010 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1011 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1012 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1013 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1014 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
1016 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1018 %{_sbindir}/bacula-dir
1019 %{_sbindir}/bacula-fd
1020 %{_sbindir}/bacula-sd
1023 %{_sbindir}/bextract
1027 %{_sbindir}/btraceback
1028 %{_sbindir}/bconsole
1032 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1033 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1034 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1035 %{_mandir}/man8/bacula.8.%{manpage_ext}
1036 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1037 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1038 %{_mandir}/man8/bextract.8.%{manpage_ext}
1039 %{_mandir}/man8/bls.8.%{manpage_ext}
1040 %{_mandir}/man8/bscan.8.%{manpage_ext}
1041 %{_mandir}/man8/btape.8.%{manpage_ext}
1042 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1043 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1044 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1045 %{_mandir}/man1/bat.1.%{manpage_ext}
1047 %_prefix/share/doc/*
1049 # opensuse build service changes the release itself
1050 %if 0%{?opensuse_bs}
1051 %doc ../Release_Notes-%{version}-1.txt
1053 %doc ../Release_Notes-%{version}-%{release}.txt
1059 # test for bacula database older than version 12
1060 # note: this ASSUMES no password has been set for bacula database
1061 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1066 # are we upgrading from sqlite to sqlite3?
1067 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1068 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1069 echo "Your catalog database file is not compatible with sqlite3, thus"
1070 echo "you will need to dump the data, delete the old file, and re-run"
1071 echo "this rpm upgrade."
1073 echo "Backing up your current database..."
1074 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1075 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1076 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1077 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1079 echo "Please re-run this rpm package upgrade."
1080 echo "After the upgrade is complete, restore your catalog"
1081 echo "with the following commands:"
1082 echo "%{script_dir}/drop_sqlite3_tables"
1083 echo "cd %{working_dir}"
1084 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1085 echo "chown bacula.bacula bacula.db"
1088 # test for bacula database older than version 11 and sqlite3
1089 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1090 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1095 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1098 %if ! %{client_only}
1099 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "11" ]; then
1100 echo "This bacula upgrade will update a bacula database from version 11 to 12."
1101 echo "You appear to be running database version $DB_VER. You must first update"
1102 echo "your database to version 11 and then install this upgrade. The alternative"
1103 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1104 echo "catalog information, then do the upgrade. Information on updating a"
1105 echo "database older than version 11 can be found in the release notes."
1114 %if ! %{client_only}
1115 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1116 if [ -s %{sysconf_dir}/console.conf ];then
1117 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1120 # create the daemon users and groups
1121 # first create the groups if they don't exist
1122 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1123 if [ -z "$HAVE_BACULA" ]; then
1124 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1125 echo "The group %{daemon_group} has been added to %{group_file}."
1126 echo "See the manual chapter \"Running Bacula\" for details."
1128 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1129 if [ -z "$HAVE_BACULA" ]; then
1130 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1131 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1132 echo "See the manual chapter \"Running Bacula\" for details."
1134 # now create the users if they do not exist
1135 # we do not use the -g option allowing the primary group to be set to system default
1136 # this will be a unique group on redhat type systems or the group users on some systems
1137 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1138 if [ -z "$HAVE_BACULA" ]; then
1139 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1140 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1141 echo "See the manual chapter \"Running Bacula\" for details."
1143 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1144 if [ -z "$HAVE_BACULA" ]; then
1145 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1146 echo "The user %{director_daemon_user} has been added to %{user_file}."
1147 echo "See the manual chapter \"Running Bacula\" for details."
1149 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1150 if [ -z "$HAVE_BACULA" ]; then
1151 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1152 echo "The user %{file_daemon_user} has been added to %{user_file}."
1153 echo "See the manual chapter \"Running Bacula\" for details."
1155 # now we add the supplementary groups, this is ok to call even if the users already exist
1156 # we only do this if the user is NOT root
1157 IS_ROOT=%{director_daemon_user}
1158 if [ "$IS_ROOT" != "root" ]; then
1159 %{usermod} -G %{daemon_group} %{director_daemon_user}
1161 IS_ROOT=%{storage_daemon_user}
1162 if [ "$IS_ROOT" != "root" ]; then
1163 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1165 IS_ROOT=%{file_daemon_user}
1166 if [ "$IS_ROOT" != "root" ]; then
1167 %{usermod} -G %{daemon_group} %{file_daemon_user}
1180 %if ! %{client_only}
1182 if [ "$1" -ge 1 ] ; then
1183 %if %{suse} && %{mysql}
1184 /sbin/chkconfig --add mysql
1186 %if %{suse} && %{postgresql}
1187 /sbin/chkconfig --add postgresql
1189 /sbin/chkconfig --add bacula-dir
1190 /sbin/chkconfig --add bacula-fd
1191 /sbin/chkconfig --add bacula-sd
1197 #check, if mysql can be called successfully at all
1198 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1200 # test for an existing database
1201 # note: this ASSUMES no password has been set for bacula database
1202 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1204 # grant privileges and create tables if they do not exist
1205 if [ -z "$DB_VER" ]; then
1206 echo "Hmm, it doesn't look like you have an existing database."
1207 echo "Granting privileges for MySQL user bacula..."
1208 %{script_dir}/grant_mysql_privileges
1209 echo "Creating MySQL bacula database..."
1210 %{script_dir}/create_mysql_database
1211 echo "Creating bacula tables..."
1212 %{script_dir}/make_mysql_tables
1214 # check to see if we need to upgrade a 3.x database
1215 elif [ "$DB_VER" -lt "12" ]; then
1216 echo "This release requires an upgrade to your bacula database."
1217 echo "Backing up your current database..."
1218 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1219 echo "Upgrading bacula database ..."
1220 %{script_dir}/update_mysql_tables
1221 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1228 # test for an existing database
1229 if [ -s %{working_dir}/bacula.db ]; then
1230 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1231 # check to see if we need to upgrade a 3.x database
1232 if [ "$DB_VER" -lt "12" ] && [ "$DB_VER" -ge "11" ]; then
1233 echo "This release requires an upgrade to your bacula database."
1234 echo "Backing up your current database..."
1235 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1236 echo "Upgrading bacula database ..."
1237 %{script_dir}/update_sqlite3_tables
1238 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1241 # create the database and tables
1242 echo "Hmm, doesn't look like you have an existing database."
1243 echo "Creating SQLite database..."
1244 %{script_dir}/create_sqlite3_database
1245 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1246 echo "Creating the SQLite tables..."
1247 %{script_dir}/make_sqlite3_tables
1252 # check if psql can be called successfully at all
1253 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1255 # test for an existing database
1256 # note: this ASSUMES no password has been set for bacula database
1257 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1259 # grant privileges and create tables if they do not exist
1260 if [ -z "$DB_VER" ]; then
1261 echo "Hmm, doesn't look like you have an existing database."
1262 echo "Creating PostgreSQL bacula database..."
1263 %{script_dir}/create_postgresql_database
1264 echo "Creating bacula tables..."
1265 %{script_dir}/make_postgresql_tables
1266 echo "Granting privileges for PostgreSQL user bacula..."
1267 %{script_dir}/grant_postgresql_privileges
1269 # check to see if we need to upgrade a 3.x database
1270 elif [ "$DB_VER" -lt "12" ]; then
1271 echo "This release requires an upgrade to your bacula database."
1272 echo "Backing up your current database..."
1273 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1274 echo "Upgrading bacula database ..."
1275 %{script_dir}/update_postgresql_tables
1276 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1282 %if ! %{client_only}
1283 if [ -d %{sysconf_dir} ]; then
1285 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
1286 pass=`openssl rand -base64 33`
1287 for file in *.conf; do
1288 sed "s@${string}@${pass}@g" $file > $file.new
1289 cp -f $file.new $file; rm -f $file.new
1292 # put actual hostname in conf file
1294 string="XXX_HOSTNAME_XXX"
1295 for file in *.conf; do
1296 sed "s@${string}@${host}@g" $file >$file.new
1297 cp -f $file.new $file; rm -f $file.new
1302 exit 0 # always exit successfull, as otherwise opensuse build service complains
1314 %if ! %{client_only}
1317 /sbin/chkconfig --del bacula-dir
1318 /sbin/chkconfig --del bacula-fd
1319 /sbin/chkconfig --del bacula-sd
1324 # added: run ldconfig in postun
1337 %defattr(-,root,root)
1338 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1339 %{script_dir}/bacula-ctl-fd
1340 /etc/init.d/bacula-fd
1342 /etc/logrotate.d/bacula
1344 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1345 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1346 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1348 %{_sbindir}/bacula-fd
1349 %{_sbindir}/btraceback
1350 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1351 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1352 %{_sbindir}/bconsole
1353 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1354 %{_mandir}/man8/bacula.8.%{manpage_ext}
1355 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1356 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1357 %{_mandir}/man1/bat.1.%{manpage_ext}
1359 %{_libdir}/libbaccfg.*
1360 %{_libdir}/libbacfind.*
1361 %{_libdir}/libbacpy.*
1362 %_prefix/share/doc/*
1364 #opensuse_bs: directories not owned by any package
1365 %dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
1368 # create the daemon group and user
1369 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1370 if [ -z "$HAVE_BACULA" ]; then
1371 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1372 echo "The group %{daemon_group} has been added to %{group_file}."
1373 echo "See the manual chapter \"Running Bacula\" for details."
1375 # we do not use the -g option allowing the primary group to be set to system default
1376 # this will be a unique group on redhat type systems or the group users on some systems
1377 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1378 if [ -z "$HAVE_BACULA" ]; then
1379 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1380 echo "The user %{file_daemon_user} has been added to %{user_file}."
1381 echo "See the manual chapter \"Running Bacula\" for details."
1383 # now we add the supplementary group, this is ok to call even if the user already exists
1384 # we only do this if the user is NOT root
1385 IS_ROOT=%{file_daemon_user}
1386 if [ "$IS_ROOT" != "root" ]; then
1387 %{usermod} -G %{daemon_group} %{file_daemon_user}
1392 if [ "$1" -ge 1 ] ; then
1393 /sbin/chkconfig --add bacula-fd
1396 if [ -d %{sysconf_dir} ]; then
1398 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
1399 pass=`openssl rand -base64 33`
1400 for file in *.conf; do
1401 sed "s@${string}@${pass}@g" $file > $file.new
1402 cp -f $file.new $file; rm -f $file.new
1405 # put actual hostname in conf file
1407 string="XXX_HOSTNAME_XXX"
1408 for file in *.conf; do
1409 sed "s@${string}@${host}@g" $file >$file.new
1410 cp -f $file.new $file; rm -f $file.new
1419 /sbin/chkconfig --del bacula-fd
1425 %if ! %{client_only}
1427 %defattr(-,root,%{daemon_group})
1428 %{script_dir}/updatedb/*
1429 #oensuse_bs: directories not owned by any package
1430 #%{script_dir}/updatedb
1433 # create the daemon group
1434 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1435 if [ -z "$HAVE_BACULA" ]; then
1436 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1437 echo "The group %{daemon_group} has been added to %{group_file}."
1438 echo "See the manual chapter \"Running Bacula\" for details."
1442 echo "The database update scripts were installed to %{script_dir}/updatedb"
1446 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1447 - remove deprecated mysql4 and mysql5 build defines
1448 - add build support for tcpwrappers
1449 - remove bacula_config file for client only build
1450 - remove requirements for database server packages
1451 - enable readline support
1452 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1454 - fix client only build
1455 - clean up requirements for termcap
1456 - query.sql now empty by default so we install sample-query.sql along side it
1457 - remove old nobuild_mtx switch
1458 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1459 - fix mysql database upgrade
1460 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1461 - fix permissions of dbcheck
1463 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1465 - add su112 and fc10 builds, remove doc package declaration.
1466 - fix source path for logwatch files.
1467 - restore static bundled build of sqlite (who took that out?) and remove use
1468 - of system sqlite. we don't support use of sqlite2.
1469 - upgrade database from version 11 to 12.
1470 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1471 - changes to work with opensuse build service
1472 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1473 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1474 - removed build of rescue, gnome console and wxconsole
1475 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1476 - Fix bat install which is now handled by make and uses shared libs
1477 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1478 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1479 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1480 - Fix post ldconfig problem in client only build
1481 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1482 - remove more files installed by client-only build not needed by client package
1483 - remove libbacsql files from client package
1484 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1486 - update for new docs configuration
1487 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1488 - add switch to pass Distribution tag
1489 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1491 - database update version 10 to 11
1492 - make now installs docs so we rm from buildroot
1493 - add shared libs in %_libdir and other misc new files
1494 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1496 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1497 - set paths for QT using pkgconfig
1498 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1500 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - adjust /opt/bacula install
1502 - add build switch to supress rescue package
1503 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add support for install to /opt/bacula
1505 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1506 - remove libtermcap dependancy for FC9
1507 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - fix bat dependencies
1509 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1511 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1514 - FHS compatibility changes
1515 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1516 - remove fix for false buffer overflow detection with glibc >= 2.7
1517 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 - fix for false buffer overflow detection with glibc >= 2.7