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 # choose database backend here
87 # postgres, mysql, sqlite
90 # Build Service: Determine Distribution
93 %define build_x86_64 1
97 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
98 BuildRequires: GConf2-devel
99 BuildRequires: freetype-devel
100 BuildRequires: libtermcap-devel
101 BuildRequires: shadow-utils
105 %if 0%{?mandriva_version} == 2007
107 %define _dist "Mandriva 2007"
110 %if 0%{?fedora_version} == 8
112 %define _dist "Fedora Core 8"
113 BuildRequires: redhat-release
116 %if 0%{?fedora_version} == 9
118 %define _dist "Fedora Core 9"
119 BuildRequires: redhat-release
123 %if 0%{?fedora_version} == 10
125 %define _dist "Fedora Core 10"
126 BuildRequires: PolicyKit-gnome
127 BuildRequires: fedora-release
130 %if 0%{?fedora_version} == 11
132 %define _dist "Fedora Core 11"
133 BuildRequires: PolicyKit-gnome
134 BuildRequires: fedora-release
137 %if 0%{?rhel_version} == 501
138 %define build_rhel5 1
139 %define _dist "Red Hat Enterprise Linux Server release 5"
140 BuildRequires: redhat-release
143 %if 0%{?rhel_version} == 406
144 %define build_rhel4 1
145 %define _dist "Red Hat Enterprise Linux Server release 4"
146 BuildRequires: redhat-release
150 %if 0%{?centos_version} == 501
151 %define build_centos5 1
152 %define _dist "CentOS 5"
153 BuildRequires: redhat-release
157 %if 0%{?suse_version} == 1020
158 %define build_su102 1
159 %define _dist "OpenSUSE 10.2"
160 BuildRequires: suse-release
164 %if 0%{?suse_version} == 1030
165 %define build_su103 1
166 %define _dist "OpenSUSE 10.3"
167 BuildRequires: suse-release
170 %if 0%{?suse_version} == 1100
171 %define build_su110 1
172 %define _dist "SUSE 11"
173 BuildRequires: suse-release
177 %if 0%{?suse_version} == 1110
178 %define build_su111 1
179 %define _dist "SUSE 11"
182 %if 0%{?suse_version} == 1120
183 %define build_su112 1
184 %define _dist "SUSE 11"
188 %if 0%{?sles_version} == 9
190 %define _dist "SLES 9"
194 %if 0%{?sles_version} == 10
196 %define _dist "SLE 10"
200 %if 0%{?sles_version} == 11
201 %define build_su111 1
202 %define _dist "SLES 11"
209 # any patches for this release
210 # be sure to check the setup section for patch macros
212 #--------------------------------------------------------------------------
213 # it should not be necessary to change anything below here for a release
214 # except for patch macros in the setup section
215 #--------------------------------------------------------------------------
217 %{?contrib_packager:%define _packager %{contrib_packager}}
219 Summary: Bacula - The Network Backup Solution
223 Group: System Environment/Daemons
225 BuildRoot: %{_tmppath}/%{name}-root
226 URL: http://www.bacula.org/
227 Vendor: The Bacula Team
228 Packager: %{_packager}
231 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
232 # opensuse build service changes the release itself
233 # what happens if the release is not 1? DSB
235 Source1: Release_Notes-%{version}-1.tar.gz
237 Source1: Release_Notes-%{version}-%{release}.tar.gz
239 Source2: bacula-2.2.7-postgresql.patch
240 Source3: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
242 # define the basic package description
243 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
244 %define blurb2 Bacula is a set of computer programs that permit you (or the system
245 %define blurb3 administrator) to manage backup, recovery, and verification of computer
246 %define blurb4 data across a network of computers of different kinds. In technical terms,
247 %define blurb5 it is a network client/server based backup program. Bacula is relatively
248 %define blurb6 easy to use and efficient, while offering many advanced storage management
249 %define blurb7 features that make it easy to find and recover lost or damaged files.
250 %define blurb8 Bacula source code has been released under the GPL version 2 license.
252 %define user_file /etc/passwd
253 %define group_file /etc/group
256 %define useradd /usr/sbin/useradd
257 %define groupadd /usr/sbin/groupadd
258 %define usermod /usr/sbin/usermod
260 # platform defines - set one below or define the build_xxx on the command line
263 %{?build_rh7:%define rh7 1}
265 %{?build_rh8:%define rh8 1}
267 %{?build_rh9:%define rh9 1}
270 %{?build_fc1:%define fc1 1}
272 %{?build_fc3:%define fc3 1}
274 %{?build_fc4:%define fc4 1}
276 %{?build_fc5:%define fc5 1}
278 %{?build_fc6:%define fc6 1}
280 %{?build_fc7:%define fc7 1}
282 %{?build_fc8:%define fc8 1}
284 %{?build_fc9:%define fc9 1}
286 %{?build_fc10:%define fc10 1}
287 # Whitebox Enterprise build
289 %{?build_wb3:%define wb3 1}
290 # RedHat Enterprise builds
292 %{?build_rhel3:%define rhel3 1}
293 %{?build_rhel3:%define wb3 1}
295 %{?build_rhel4:%define rhel4 1}
296 %{?build_rhel4:%define fc3 1}
298 %{?build_rhel5:%define rhel5 1}
299 %{?build_rhel5:%define fc6 1}
302 %{?build_centos3:%define centos3 1}
303 %{?build_centos3:%define wb3 1}
305 %{?build_centos4:%define centos4 1}
306 %{?build_centos4:%define fc3 1}
308 %{?build_centos5:%define centos5 1}
309 %{?build_centos5:%define fc6 1}
312 %{?build_sl3:%define sl3 1}
313 %{?build_sl3:%define wb3 1}
315 %{?build_sl4:%define sl4 1}
316 %{?build_sl4:%define fc3 1}
318 %{?build_sl5:%define sl5 1}
319 %{?build_sl5:%define fc6 1}
322 %{?build_su9:%define su9 1}
324 %{?build_su10:%define su10 1}
326 %{?build_su102:%define su102 1}
328 %{?build_su103:%define su103 1}
330 %{?build_su110:%define su110 1}
332 %{?build_su111:%define su111 1}
334 %{?build_su112:%define su112 1}
337 %{?build_mdk:%define mdk 1}
339 %{?build_mdv:%define mdv 1}
340 %{?build_mdv:%define mdk 1}
343 %define client_only 0
344 %{?build_client_only:%define client_only 1}
346 # Setup some short cuts
348 %if %{rh7} || %{rh8} || %{rh9}
352 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
356 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
360 %if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
364 %if %{sl3} || %{sl4} || %{sl5}
369 # test for a platform definition
370 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
371 %{error: You must specify a platform. Please examine the spec file.}
375 # distribution-specific directory for logwatch
376 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
377 %define logwatch_dir /etc/log.d
379 %define logwatch_dir /etc/logwatch
383 # set for database support desired or define the build_xxx on the command line
385 %{?build_mysql:%define mysql 1}
386 # if using mysql 4.x define this and mysql above
387 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
389 %{?build_mysql4:%define mysql4 1}
390 %{?build_mysql4:%define mysql 1}
391 # if using mysql 5.x define this and mysql above
392 # currently: SuSE 10.1 and Fedora Core 5
394 %{?build_mysql5:%define mysql5 1}
395 %{?build_mysql5:%define mysql 1}
397 %{?build_sqlite:%define sqlite 1}
399 %{?build_postgresql:%define postgresql 1}
401 # test for a database definition
402 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
403 %{error: You must specify database support. Please examine the spec file.}
408 %define db_backend mysql
411 %define db_backend sqlite3
414 %define db_backend postgresql
419 %{?build_x86_64:%define x86_64 1}
421 # check what distribution we are
422 %if %{rhat} || %{rhel}
423 %define _dist %(grep Red /etc/redhat-release)
425 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10}
426 %define _dist %(grep Fedora /etc/redhat-release)
428 %if %{centos5} || %{centos4} || %{centos3}
429 %define _dist %(grep CentOS /etc/redhat-release)
431 %if %{sl5} ||%{sl4} || %{sl3}
432 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
434 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
435 %define _dist %(grep White /etc/whitebox-release)
438 %define _dist %(grep -i SuSE /etc/SuSE-release)
441 %define _dist %(grep Mand /etc/mandrake-release)
443 %{?DISTNAME:%define _dist %{DISTNAME}}
445 # only set Disribution if not in opensuse build service, as it sets it itself
446 %if ! 0%{?opensuse_bs}
447 Distribution: %{_dist}
450 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
451 # needed in opensuse_bs, as rpm is installed during build process
452 BuildRequires: libmysqlclient-devel
453 BuildRequires: mysql-client
456 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
457 BuildRequires: postgresql
458 BuildRequires: postgresql-server
460 BuildRequires: openssl
462 %if 0%{?opensuse_bs} && %{suse}
463 BuildRequires: pwdutils
464 BuildRequires: sysconfig
467 # should we turn on python support
469 %{?build_python:%define python 1}
471 # specifically disallow build of mtx package if desired
473 %{?nobuild_mtx:%define mtx 0}
475 # do we need to patch for old postgresql version?
477 %{?build_old_pgsql:%define old_pgsql 1}
479 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
481 %define manpage_ext bz2
483 %define manpage_ext gz
486 # for client only build
495 BuildRequires: gcc, gcc-c++, make, autoconf
496 BuildRequires: glibc, glibc-devel
497 BuildRequires: ncurses-devel, perl
498 BuildRequires: libstdc++-devel, zlib-devel
499 BuildRequires: openssl-devel
500 BuildRequires: libacl-devel
501 BuildRequires: pkgconfig
503 BuildRequires: libxml2-devel
506 BuildRequires: python, python-devel
507 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
511 BuildRequires: libxml-devel
514 BuildRequires: libstdc++-static-devel
515 BuildRequires: glibc-static-devel
519 BuildRequires: termcap
521 BuildRequires: libtermcap-devel
525 BuildRequires: sqlite-devel
529 BuildRequires: mysql-devel
532 %if %{postgresql} && %{wb3}
533 BuildRequires: rh-postgresql-devel >= 7
536 %if %{postgresql} && ! %{wb3}
537 BuildRequires: postgresql-devel >= 7
561 Summary: Bacula - The Network Backup Solution
562 Group: System Environment/Daemons
563 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
564 Conflicts: bacula-client
566 Requires: ncurses, libstdc++, zlib, openssl
579 %if %{suse} || %{mdk}
580 Requires: mysql-client
582 Requires: mysql-server
586 %if %{postgresql} && %{wb3}
587 Requires: rh-postgresql >= 7
588 Requires: rh-postgresql-server >= 7
590 %if %{postgresql} && ! %{wb3}
591 Requires: postgresql >= 7
592 Requires: postgresql-server >= 7
602 %description postgresql
606 Requires: python >= %{pyver}
620 This build requires MySQL to be installed separately as the catalog database.
623 This build requires PostgreSQL to be installed separately as the catalog database.
626 This build incorporates sqlite3 as the catalog database, statically compiled.
629 This build includes python scripting support.
633 Summary: Bacula - The Network Backup Solution
634 Group: System Environment/Daemons
636 Conflicts: bacula-mysql
637 Conflicts: bacula-sqlite
638 Conflicts: bacula-postgresql
644 Requires: libstdc++, zlib, openssl
654 Requires: python >= %{pyver}
668 This is the File daemon (Client) only package. It includes the command line
671 This build includes python scripting support.
677 Summary: Bacula - The Network Backup Solution
678 Group: System Environment/Daemons
680 %description updatedb
691 This package installs scripts for updating older versions of the bacula
695 # Must explicitly enable debug pkg on SuSE
696 # but not in opensuse_bs
697 %if %{suse} && ! 0%{?opensuse_bs}
709 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
719 %if %{wb3} || %{old_pgsql}
720 patch -p3 src/cats/postgresql.c < %SOURCE2
724 # patches for the bundled sqlite scripts
726 # patch the make_sqlite_tables script for installation bindir
727 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
729 # patch the create_sqlite_database script for installation bindir
730 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
732 # patch the make_catalog_backup script for installation bindir
733 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
735 # patch the update_sqlite_tables script for installation bindir
736 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
738 # patch the bacula-dir init script to remove sqlite service
739 %if %{sqlite} && %{suse}
740 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
744 # 64 bit lib location hacks
745 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
746 # reported to be fixed to properly detect lib locations.
748 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
750 %if %{mysql} && %{x86_64}
751 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
753 %if %{python} && %{x86_64}
754 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
757 # Main Bacula configuration
759 --prefix=%{_prefix} \
760 --sbindir=%{_sbindir} \
761 --sysconfdir=%{sysconf_dir} \
762 --mandir=%{_mandir} \
763 --with-scriptdir=%{script_dir} \
764 --with-working-dir=%{working_dir} \
765 --with-plugindir=%{script_dir} \
766 --with-pid-dir=%{pid_dir} \
767 --with-subsys-dir=%{_subsysdir} \
768 --enable-smartalloc \
770 --disable-bwx-console \
771 --disable-tray-monitor \
776 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
787 --enable-client-only \
789 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
790 --disable-batch-insert \
792 --with-dir-user=%{director_daemon_user} \
793 --with-dir-group=%{daemon_group} \
794 --with-sd-user=%{storage_daemon_user} \
795 --with-sd-group=%{storage_daemon_group} \
796 --with-fd-user=%{file_daemon_user} \
797 --with-fd-group=%{daemon_group} \
798 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
799 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
800 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
801 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
802 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
803 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
811 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
812 mkdir -p $RPM_BUILD_ROOT/etc/init.d
813 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
814 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
815 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
816 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
817 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
818 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
820 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
821 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
824 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
827 make DESTDIR=$RPM_BUILD_ROOT install
830 # Program docs not installed on client
831 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
832 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
833 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
834 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
835 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
836 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
837 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
838 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
839 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
841 # Docs for programs that are depreciated
842 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
843 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
844 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
845 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
847 # fixme - make installs the mysql scripts for sqlite build
849 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
850 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
851 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
854 # fixme - make installs the mysql scripts for postgresql build
856 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
857 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
860 # install the init scripts
862 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
863 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
864 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
867 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
868 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
869 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
871 %if ! %{suse} && ! %{mdk}
872 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
873 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
874 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
876 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
878 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
879 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
884 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
885 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
886 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
890 # install the logrotate file
891 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
893 # install the updatedb scripts
894 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
896 # install the logwatch scripts
898 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
899 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
900 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
901 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
902 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
903 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
904 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
905 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
908 # now clean up permissions that are left broken by the install
909 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
911 # fix me - building enable-client-only installs files not included in bacula-client package
913 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
914 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
915 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
916 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
917 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
918 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
919 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
920 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
921 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
922 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
923 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
924 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
925 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
926 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
930 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
932 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
934 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
939 # MySQL specific files
941 %defattr(-, root, root)
942 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
943 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
944 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
945 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
946 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
947 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
948 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
949 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
954 %defattr(-,root,root)
955 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
956 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
957 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
958 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
959 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
960 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
961 %{sqlite_bindir}/libsqlite3.a
962 %{sqlite_bindir}/sqlite3.h
963 %{sqlite_bindir}/sqlite3
970 %defattr(-,root,root)
971 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
972 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
973 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
974 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
975 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
976 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
977 # The rest is DB backend independent
979 # opensuse_bs: directories not owned by any package
980 %dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
983 %attr(-, root, %{daemon_group}) %dir %{script_dir}
984 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
985 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
986 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
987 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
988 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
989 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
990 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
991 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
992 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
993 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
994 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
995 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
996 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
997 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
998 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
999 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1000 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1001 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1002 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
1003 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1004 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1005 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
1006 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1007 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1008 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1009 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer.conf
1011 /etc/logrotate.d/bacula
1012 %{logwatch_dir}/scripts/services/bacula
1013 %{logwatch_dir}/scripts/shared/applybaculadate
1014 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1015 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1016 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1017 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1018 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1019 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1020 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1022 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1024 %{_sbindir}/bacula-dir
1025 %{_sbindir}/bacula-fd
1026 %{_sbindir}/bacula-sd
1029 %{_sbindir}/bextract
1033 %{_sbindir}/btraceback
1034 %{_sbindir}/bconsole
1038 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1039 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1040 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1041 %{_mandir}/man8/bacula.8.%{manpage_ext}
1042 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1043 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1044 %{_mandir}/man8/bextract.8.%{manpage_ext}
1045 %{_mandir}/man8/bls.8.%{manpage_ext}
1046 %{_mandir}/man8/bscan.8.%{manpage_ext}
1047 %{_mandir}/man8/btape.8.%{manpage_ext}
1048 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1049 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1050 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1051 %{_mandir}/man1/bat.1.%{manpage_ext}
1053 %_prefix/share/doc/*
1055 # opensuse build service changes the release itself
1056 %if 0%{?opensuse_bs}
1057 %doc ../Release_Notes-%{version}-1.txt
1059 %doc ../Release_Notes-%{version}-%{release}.txt
1065 # test for bacula database older than version 12
1066 # note: this ASSUMES no password has been set for bacula database
1067 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1072 # are we upgrading from sqlite to sqlite3?
1073 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1074 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1075 echo "Your catalog database file is not compatible with sqlite3, thus"
1076 echo "you will need to dump the data, delete the old file, and re-run"
1077 echo "this rpm upgrade."
1079 echo "Backing up your current database..."
1080 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1081 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1082 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1083 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1085 echo "Please re-run this rpm package upgrade."
1086 echo "After the upgrade is complete, restore your catalog"
1087 echo "with the following commands:"
1088 echo "%{script_dir}/drop_sqlite3_tables"
1089 echo "cd %{working_dir}"
1090 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1091 echo "chown bacula.bacula bacula.db"
1094 # test for bacula database older than version 11 and sqlite3
1095 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1096 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1101 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1104 %if ! %{client_only}
1105 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "11" ]; then
1106 echo "This bacula upgrade will update a bacula database from version 11 to 12."
1107 echo "You appear to be running database version $DB_VER. You must first update"
1108 echo "your database to version 11 and then install this upgrade. The alternative"
1109 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1110 echo "catalog information, then do the upgrade. Information on updating a"
1111 echo "database older than version 11 can be found in the release notes."
1120 %if ! %{client_only}
1121 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1122 if [ -s %{sysconf_dir}/console.conf ];then
1123 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1126 # create the daemon users and groups
1127 # first create the groups if they don't exist
1128 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1129 if [ -z "$HAVE_BACULA" ]; then
1130 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1131 echo "The group %{daemon_group} has been added to %{group_file}."
1132 echo "See the manual chapter \"Running Bacula\" for details."
1134 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1135 if [ -z "$HAVE_BACULA" ]; then
1136 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1137 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1138 echo "See the manual chapter \"Running Bacula\" for details."
1140 # now create the users if they do not exist
1141 # we do not use the -g option allowing the primary group to be set to system default
1142 # this will be a unique group on redhat type systems or the group users on some systems
1143 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1144 if [ -z "$HAVE_BACULA" ]; then
1145 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1146 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1147 echo "See the manual chapter \"Running Bacula\" for details."
1149 HAVE_BACULA=`grep %{director_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 %{director_daemon_user} > /dev/null 2>&1
1152 echo "The user %{director_daemon_user} has been added to %{user_file}."
1153 echo "See the manual chapter \"Running Bacula\" for details."
1155 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1156 if [ -z "$HAVE_BACULA" ]; then
1157 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1158 echo "The user %{file_daemon_user} has been added to %{user_file}."
1159 echo "See the manual chapter \"Running Bacula\" for details."
1161 # now we add the supplementary groups, this is ok to call even if the users already exist
1162 # we only do this if the user is NOT root
1163 IS_ROOT=%{director_daemon_user}
1164 if [ "$IS_ROOT" != "root" ]; then
1165 %{usermod} -G %{daemon_group} %{director_daemon_user}
1167 IS_ROOT=%{storage_daemon_user}
1168 if [ "$IS_ROOT" != "root" ]; then
1169 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1171 IS_ROOT=%{file_daemon_user}
1172 if [ "$IS_ROOT" != "root" ]; then
1173 %{usermod} -G %{daemon_group} %{file_daemon_user}
1186 %if ! %{client_only}
1188 if [ "$1" -ge 1 ] ; then
1189 %if %{suse} && %{mysql}
1190 /sbin/chkconfig --add mysql
1192 %if %{suse} && %{postgresql}
1193 /sbin/chkconfig --add postgresql
1195 /sbin/chkconfig --add bacula-dir
1196 /sbin/chkconfig --add bacula-fd
1197 /sbin/chkconfig --add bacula-sd
1203 #check, if mysql can be called successfully at all
1204 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1206 # test for an existing database
1207 # note: this ASSUMES no password has been set for bacula database
1208 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1210 # grant privileges and create tables if they do not exist
1211 if [ -z "$DB_VER" ]; then
1212 echo "Hmm, it doesn't look like you have an existing database."
1213 echo "Granting privileges for MySQL user bacula..."
1214 %{script_dir}/grant_mysql_privileges
1215 echo "Creating MySQL bacula database..."
1216 %{script_dir}/create_mysql_database
1217 echo "Creating bacula tables..."
1218 %{script_dir}/make_mysql_tables
1220 # check to see if we need to upgrade a 3.x database
1221 elif [ "$DB_VER" -lt "12" ]; then
1222 echo "This release requires an upgrade to your bacula database."
1223 echo "Backing up your current database..."
1224 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1225 echo "Upgrading bacula database ..."
1226 %{script_dir}/update_mysql_tables
1227 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1234 # test for an existing database
1235 if [ -s %{working_dir}/bacula.db ]; then
1236 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1237 # check to see if we need to upgrade a 3.x database
1238 if [ "$DB_VER" -lt "12" ] && [ "$DB_VER" -ge "11" ]; then
1239 echo "This release requires an upgrade to your bacula database."
1240 echo "Backing up your current database..."
1241 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1242 echo "Upgrading bacula database ..."
1243 %{script_dir}/update_sqlite3_tables
1244 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1247 # create the database and tables
1248 echo "Hmm, doesn't look like you have an existing database."
1249 echo "Creating SQLite database..."
1250 %{script_dir}/create_sqlite3_database
1251 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1252 echo "Creating the SQLite tables..."
1253 %{script_dir}/make_sqlite3_tables
1258 # check if psql can be called successfully at all
1259 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1261 # test for an existing database
1262 # note: this ASSUMES no password has been set for bacula database
1263 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1265 # grant privileges and create tables if they do not exist
1266 if [ -z "$DB_VER" ]; then
1267 echo "Hmm, doesn't look like you have an existing database."
1268 echo "Creating PostgreSQL bacula database..."
1269 %{script_dir}/create_postgresql_database
1270 echo "Creating bacula tables..."
1271 %{script_dir}/make_postgresql_tables
1272 echo "Granting privileges for PostgreSQL user bacula..."
1273 %{script_dir}/grant_postgresql_privileges
1275 # check to see if we need to upgrade a 3.x database
1276 elif [ "$DB_VER" -lt "12" ]; then
1277 echo "This release requires an upgrade to your bacula database."
1278 echo "Backing up your current database..."
1279 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1280 echo "Upgrading bacula database ..."
1281 %{script_dir}/update_postgresql_tables
1282 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1288 %if ! %{client_only}
1289 if [ -d %{sysconf_dir} ]; then
1291 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
1292 pass=`openssl rand -base64 33`
1293 for file in *.conf; do
1294 sed "s@${string}@${pass}@g" $file > $file.new
1295 cp -f $file.new $file; rm -f $file.new
1298 # put actual hostname in conf file
1300 string="XXX_HOSTNAME_XXX"
1301 for file in *.conf; do
1302 sed "s@${string}@${host}@g" $file >$file.new
1303 cp -f $file.new $file; rm -f $file.new
1308 exit 0 # always exit successfull, as otherwise opensuse build service complains
1320 %if ! %{client_only}
1323 /sbin/chkconfig --del bacula-dir
1324 /sbin/chkconfig --del bacula-fd
1325 /sbin/chkconfig --del bacula-sd
1330 # added: run ldconfig in postun
1343 %defattr(-,root,root)
1344 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1345 %{script_dir}/bacula-ctl-fd
1346 /etc/init.d/bacula-fd
1348 /etc/logrotate.d/bacula
1350 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1351 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1352 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1354 %{_sbindir}/bacula-fd
1355 %{_sbindir}/btraceback
1356 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1357 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1358 %{_sbindir}/bconsole
1359 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1360 %{_mandir}/man8/bacula.8.%{manpage_ext}
1361 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1362 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1363 %{_mandir}/man1/bat.1.%{manpage_ext}
1365 %{_libdir}/libbaccfg.*
1366 %{_libdir}/libbacfind.*
1367 %{_libdir}/libbacpy.*
1368 %_prefix/share/doc/*
1370 #opensuse_bs: directories not owned by any package
1371 %dir %attr(-, root, %{daemon_group}) %{sysconf_dir}
1374 # create the daemon group and user
1375 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1376 if [ -z "$HAVE_BACULA" ]; then
1377 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1378 echo "The group %{daemon_group} has been added to %{group_file}."
1379 echo "See the manual chapter \"Running Bacula\" for details."
1381 # we do not use the -g option allowing the primary group to be set to system default
1382 # this will be a unique group on redhat type systems or the group users on some systems
1383 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1384 if [ -z "$HAVE_BACULA" ]; then
1385 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1386 echo "The user %{file_daemon_user} has been added to %{user_file}."
1387 echo "See the manual chapter \"Running Bacula\" for details."
1389 # now we add the supplementary group, this is ok to call even if the user already exists
1390 # we only do this if the user is NOT root
1391 IS_ROOT=%{file_daemon_user}
1392 if [ "$IS_ROOT" != "root" ]; then
1393 %{usermod} -G %{daemon_group} %{file_daemon_user}
1398 if [ "$1" -ge 1 ] ; then
1399 /sbin/chkconfig --add bacula-fd
1402 if [ -d %{sysconf_dir} ]; then
1404 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
1405 pass=`openssl rand -base64 33`
1406 for file in *.conf; do
1407 sed "s@${string}@${pass}@g" $file > $file.new
1408 cp -f $file.new $file; rm -f $file.new
1411 # put actual hostname in conf file
1413 string="XXX_HOSTNAME_XXX"
1414 for file in *.conf; do
1415 sed "s@${string}@${host}@g" $file >$file.new
1416 cp -f $file.new $file; rm -f $file.new
1425 /sbin/chkconfig --del bacula-fd
1431 %if ! %{client_only}
1433 %defattr(-,root,%{daemon_group})
1434 %{script_dir}/updatedb/*
1435 #oensuse_bs: directories not owned by any package
1436 #%{script_dir}/updatedb
1439 # create the daemon group
1440 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1441 if [ -z "$HAVE_BACULA" ]; then
1442 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1443 echo "The group %{daemon_group} has been added to %{group_file}."
1444 echo "See the manual chapter \"Running Bacula\" for details."
1448 echo "The database update scripts were installed to %{script_dir}/updatedb"
1452 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1453 - fix client only build
1454 - clean up requirements for termcap
1455 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1456 - fix mysql database upgrade
1457 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1458 - fix permissions of dbcheck
1460 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1462 - add su112 and fc10 builds, remove doc package declaration.
1463 - fix source path for logwatch files.
1464 - restore static bundled build of sqlite (who took that out?) and remove use
1465 - of system sqlite. we don't support use of sqlite2.
1466 - upgrade database from version 11 to 12.
1467 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1468 - changes to work with opensuse build service
1469 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1470 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1471 - removed build of rescue, gnome console and wxconsole
1472 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1473 - Fix bat install which is now handled by make and uses shared libs
1474 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1475 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1476 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1477 - Fix post ldconfig problem in client only build
1478 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1479 - remove more files installed by client-only build not needed by client package
1480 - remove libbacsql files from client package
1481 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1483 - update for new docs configuration
1484 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1485 - add switch to pass Distribution tag
1486 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1488 - database update version 10 to 11
1489 - make now installs docs so we rm from buildroot
1490 - add shared libs in %_libdir and other misc new files
1491 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1493 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1494 - set paths for QT using pkgconfig
1495 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1496 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1497 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1498 - adjust /opt/bacula install
1499 - add build switch to supress rescue package
1500 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - add support for install to /opt/bacula
1502 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1503 - remove libtermcap dependancy for FC9
1504 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1505 - fix bat dependencies
1506 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1510 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1511 - FHS compatibility changes
1512 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 - remove fix for false buffer overflow detection with glibc >= 2.7
1514 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1515 - fix for false buffer overflow detection with glibc >= 2.7