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
13 %define postgres_version 8
14 %define postgres_package postgresql84
15 %define postgres_server_package postgresql84-server
16 %define postgres_devel_package postgresql84-devel
20 %{?single_dir_install:%define single_dir 1}
22 # Installation Directory locations
24 %define _prefix /opt/bacula
25 %define _sbindir /opt/bacula/bin
26 %define _bindir /opt/bacula/bin
27 %define _subsysdir /opt/bacula/working
28 %define sqlite_bindir /opt/bacula/sqlite
29 %define _mandir /usr/share/man
30 %define sysconf_dir /opt/bacula/etc
31 %define script_dir /opt/bacula/scripts
32 %define working_dir /opt/bacula/working
33 %define pid_dir /opt/bacula/working
34 %define plugin_dir /opt/bacula/plugins
35 %define lib_dir /opt/bacula/lib
38 %define _sbindir %_prefix/sbin
39 %define _bindir %_prefix/bin
40 %define _subsysdir /var/lock/subsys
41 %define sqlite_bindir %_libdir/bacula/sqlite
42 %define _mandir %_prefix/share/man
43 %define sysconf_dir /etc/bacula
44 %define script_dir %_libdir/bacula
45 %define working_dir /var/lib/bacula
46 %define pid_dir /var/run
47 %define plugin_dir %_libdir/bacula/plugins
48 %define lib_dir %_libdir/bacula/lib
51 # Daemon user:group Don't change them unless you know what you are doing
52 %define director_daemon_user bacula
53 %define storage_daemon_user bacula
54 %define file_daemon_user root
55 %define daemon_group bacula
56 # group that has write access to tape devices, usually disk on Linux
57 %define storage_daemon_group disk
59 %define depkgs ../depkgs
61 # probems with mandriva build:
62 # nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
64 # set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
65 #openSUSE 11.1 %if 0%{?suse_version} == 1110
66 #openSUSE 11.0 %if 0%{?suse_version} == 1100
67 #openSUSE 10.3 %if 0%{?suse_version} == 1030
68 #openSUSE 10.2 %if 0%{?suse_version} == 1020
69 #SUSE Linux 10.1 %if 0%{?suse_version} == 1010
70 #SUSE Linux 10.0 %if 0%{?suse_version} == 1000
71 #SUSE Linux 9.3 %if 0%{?suse_version} == 930
72 #SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910
73 #SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010
74 #SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110
75 #CentOS 5 %if 0%{?centos_version} == 501
76 #RHEL 4 %if 0%{?rhel_version} == 406
77 #RHEL 5 %if 0%{?rhel_version} == 501
78 #Fedora 6 with Extras %if 0%{?fedora_version} == 6
79 #Fedora 7 with Extras %if 0%{?fedora_version} == 7
80 #Fedora 8 with Extras %if 0%{?fedora_version} == 8
81 #Fedora 9 with Extras %if 0%{?fedora_version} == 9
82 #Fedora 10 with Extras %if 0%{?fedora_version} == 10
83 #Mandriva 2006 %if 0%{?mandriva_version} == 2006
84 #Mandriva 2007 %if 0%{?mandriva_version} == 2007
85 #Mandriva 2008 %if 0%{?mandriva_version} == 2008
89 # am I running in opensuse build service?
90 # TODO: seems to make problems
92 # Build Service: Determine Distribution
95 %define build_x86_64 1
99 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
100 BuildRequires: GConf2-devel
101 BuildRequires: freetype-devel
102 BuildRequires: libtermcap-devel
103 BuildRequires: shadow-utils
107 %if 0%{?mandriva_version} == 2007
109 %define _dist "Mandriva 2007"
112 %if 0%{?fedora_version} == 8
114 %define _dist "Fedora Core 8"
115 BuildRequires: redhat-release
118 %if 0%{?fedora_version} == 9
120 %define _dist "Fedora Core 9"
121 BuildRequires: redhat-release
125 %if 0%{?fedora_version} == 10
127 %define _dist "Fedora Core 10"
128 BuildRequires: PolicyKit-gnome
129 BuildRequires: fedora-release
132 %if 0%{?fedora_version} == 11
134 %define _dist "Fedora Core 11"
135 BuildRequires: PolicyKit-gnome
136 BuildRequires: fedora-release
139 %if 0%{?rhel_version} == 501
140 %define build_rhel5 1
141 %define _dist "Red Hat Enterprise Linux Server release 5"
142 BuildRequires: redhat-release
145 %if 0%{?rhel_version} == 406
146 %define build_rhel4 1
147 %define _dist "Red Hat Enterprise Linux Server release 4"
148 BuildRequires: redhat-release
152 %if 0%{?centos_version} == 501
153 %define build_centos5 1
154 %define _dist "CentOS 5"
155 BuildRequires: redhat-release
159 %if 0%{?suse_version} == 1020
160 %define build_su102 1
161 %define _dist "OpenSUSE 10.2"
162 BuildRequires: suse-release
166 %if 0%{?suse_version} == 1030
167 %define build_su103 1
168 %define _dist "OpenSUSE 10.3"
169 BuildRequires: suse-release
172 %if 0%{?suse_version} == 1100
173 %define build_su110 1
174 %define _dist "SUSE 11"
175 BuildRequires: suse-release
179 %if 0%{?suse_version} == 1110
180 %define build_su111 1
181 %define _dist "SUSE 11"
184 %if 0%{?suse_version} == 1120
185 %define build_su112 1
186 %define _dist "SUSE 11"
190 %if 0%{?sles_version} == 9
192 %define _dist "SLES 9"
196 %if 0%{?sles_version} == 10
198 %define _dist "SLE 10"
202 %if 0%{?sles_version} == 11
203 %define build_su111 1
204 %define _dist "SLES 11"
211 # any patches for this release
212 # be sure to check the setup section for patch macros
214 #--------------------------------------------------------------------------
215 # it should not be necessary to change anything below here for a release
216 # except for patch macros in the setup section
217 #--------------------------------------------------------------------------
219 %{?contrib_packager:%define _packager %{contrib_packager}}
221 Summary: Bacula - The Network Backup Solution
225 Group: System Environment/Daemons
227 BuildRoot: %{_tmppath}/%{name}-root
228 URL: http://www.bacula.org/
229 Vendor: The Bacula Team
230 Packager: %{_packager}
233 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
234 # opensuse build service changes the release itself
235 # what happens if the release is not 1? DSB
237 Source1: Release_Notes-%{version}-1.tar.gz
239 Source1: Release_Notes-%{version}-%{release}.tar.gz
241 Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
243 # define the basic package description
244 %define blurb Bacula - The Leading Open Source Backup Solution.
245 %define blurb2 Bacula is a set of computer programs that permit you (or the system
246 %define blurb3 administrator) to manage backup, recovery, and verification of computer
247 %define blurb4 data across a network of computers of different kinds. In technical terms,
248 %define blurb5 it is a network client/server based backup program. Bacula is relatively
249 %define blurb6 easy to use and efficient, while offering many advanced storage management
250 %define blurb7 features that make it easy to find and recover lost or damaged files.
251 %define blurb8 Bacula source code has been released under the AGPL version 3 license.
253 %define user_file /etc/passwd
254 %define group_file /etc/group
257 %define useradd /usr/sbin/useradd
258 %define groupadd /usr/sbin/groupadd
259 %define usermod /usr/sbin/usermod
261 # platform defines - set one below or define the build_xxx on the command line
264 %{?build_rh7:%define rh7 1}
266 %{?build_rh8:%define rh8 1}
268 %{?build_rh9:%define rh9 1}
271 %{?build_fc1:%define fc1 1}
273 %{?build_fc3:%define fc3 1}
275 %{?build_fc4:%define fc4 1}
277 %{?build_fc5:%define fc5 1}
279 %{?build_fc6:%define fc6 1}
281 %{?build_fc7:%define fc7 1}
283 %{?build_fc8:%define fc8 1}
285 %{?build_fc9:%define fc9 1}
287 %{?build_fc10:%define fc10 1}
289 %{?build_fc11:%define fc11 1}
291 %{?build_fc12:%define fc12 1}
292 # Whitebox Enterprise build
294 %{?build_wb3:%define wb3 1}
295 # RedHat Enterprise builds
297 %{?build_rhel3:%define rhel3 1}
298 %{?build_rhel3:%define wb3 1}
300 %{?build_rhel4:%define rhel4 1}
301 %{?build_rhel4:%define fc3 1}
303 %{?build_rhel5:%define rhel5 1}
304 %{?build_rhel5:%define fc6 1}
307 %{?build_centos3:%define centos3 1}
308 %{?build_centos3:%define wb3 1}
310 %{?build_centos4:%define centos4 1}
311 %{?build_centos4:%define fc3 1}
313 %{?build_centos5:%define centos5 1}
314 %{?build_centos5:%define fc6 1}
317 %{?build_sl3:%define sl3 1}
318 %{?build_sl3:%define wb3 1}
320 %{?build_sl4:%define sl4 1}
321 %{?build_sl4:%define fc3 1}
323 %{?build_sl5:%define sl5 1}
324 %{?build_sl5:%define fc6 1}
327 %{?build_su9:%define su9 1}
329 %{?build_su10:%define su10 1}
331 %{?build_su102:%define su102 1}
333 %{?build_su103:%define su103 1}
335 %{?build_su110:%define su110 1}
337 %{?build_su111:%define su111 1}
339 %{?build_su112:%define su112 1}
342 %{?build_mdk:%define mdk 1}
344 %{?build_mdv:%define mdv 1}
345 %{?build_mdv:%define mdk 1}
348 %define client_only 0
349 %{?build_client_only:%define client_only 1}
351 # Setup some short cuts
353 %if %{rh7} || %{rh8} || %{rh9}
357 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
361 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
365 %if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
369 %if %{sl3} || %{sl4} || %{sl5}
374 # test for a platform definition
375 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
376 %{error: You must specify a platform. Please examine the spec file.}
380 # distribution-specific directory for logwatch
381 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
382 %define logwatch_dir /etc/log.d
384 %define logwatch_dir /etc/logwatch
388 # set for database support desired or define the build_xxx on the command line
390 %{?build_mysql:%define mysql 1}
392 %{?build_sqlite:%define sqlite 1}
394 %{?build_postgresql:%define postgresql 1}
396 # test for a database definition
397 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
398 %{error: You must specify database support, by passing one of the following to rpmbuild:}
399 %{error: --define build_postgresql=1}
400 %{error: --define build_sqlite=1}
401 %{error: --define build_mysql=1}
406 %define db_backend mysql
409 %define db_backend sqlite3
412 %define db_backend postgresql
417 %{?build_x86_64:%define x86_64 1}
419 # check what distribution we are
420 %if %{rhat} || %{rhel}
421 %define _dist %(grep Red /etc/redhat-release)
423 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
424 %define _dist %(grep Fedora /etc/redhat-release)
426 %if %{centos5} || %{centos4} || %{centos3}
427 %define _dist %(grep CentOS /etc/redhat-release)
429 %if %{sl5} ||%{sl4} || %{sl3}
430 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
432 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
433 %define _dist %(grep White /etc/whitebox-release)
436 %define _dist %(grep -i SuSE /etc/SuSE-release)
439 %define _dist %(grep Mand /etc/mandrake-release)
441 %{?DISTNAME:%define _dist %{DISTNAME}}
443 # only set Disribution if not in opensuse build service, as it sets it itself
444 %if ! 0%{?opensuse_bs}
445 Distribution: %{_dist}
448 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
449 # needed in opensuse_bs, as rpm is installed during build process
450 BuildRequires: libmysqlclient-devel
451 BuildRequires: mysql-client
454 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
455 BuildRequires: %{postgres_package}
456 BuildRequires: %{postgres_server_package}
458 BuildRequires: openssl
460 %if 0%{?opensuse_bs} && %{suse}
461 BuildRequires: pwdutils
462 BuildRequires: sysconfig
465 # should we turn on python support
467 %{?build_python:%define python 1}
469 # should we enable tcp wrappers support
470 %define tcpwrappers 0
471 %{?build_tcpwrappers:%define tcpwrappers 1}
473 # do we need to patch for old postgresql version?
475 %{?build_old_pgsql:%define old_pgsql 1}
477 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
479 %define manpage_ext bz2
481 %define manpage_ext gz
484 # for client only build
491 BuildRequires: gcc, gcc-c++, make, autoconf
492 BuildRequires: glibc, glibc-devel
493 BuildRequires: ncurses-devel, perl, readline-devel
494 BuildRequires: libstdc++-devel, zlib-devel
495 BuildRequires: openssl-devel
496 BuildRequires: libacl-devel
497 BuildRequires: pkgconfig
499 BuildRequires: libxml2-devel
502 BuildRequires: python, python-devel
503 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
507 BuildRequires: libxml-devel
510 BuildRequires: libstdc++-static-devel
511 BuildRequires: glibc-static-devel
515 BuildRequires: termcap
517 BuildRequires: libtermcap-devel
521 BuildRequires: sqlite-devel
525 BuildRequires: mysql-devel
528 %if %{postgresql} && %{wb3}
529 BuildRequires: rh-postgresql-devel >= %{postgres_version}
532 %if %{postgresql} && ! %{wb3}
533 BuildRequires: %{postgres_devel_package} >= %{postgres_version}
557 Summary: Bacula - The Network Backup Solution
558 Group: System Environment/Daemons
559 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
560 Conflicts: bacula-client
562 Requires: ncurses, libstdc++, zlib, openssl
563 Requires: glibc, readline, bacula-libs
576 %if %{postgresql} && %{wb3}
577 Requires: rh-postgresql >= 7
579 %if %{postgresql} && ! %{wb3}
580 Requires: postgresql >= 7
590 %description postgresql
594 Requires: python >= %{pyver}
608 This build requires MySQL to be installed separately as the catalog database.
611 This build requires PostgreSQL to be installed separately as the catalog database.
614 This build incorporates sqlite3 as the catalog database, statically compiled.
617 This build includes python scripting support.
620 This build includes tcp-wrappers support.
624 Summary: Bacula - The Network Backup Solution
625 Group: System Environment/Daemons
627 Conflicts: bacula-mysql
628 Conflicts: bacula-sqlite
629 Conflicts: bacula-postgresql
635 Requires: libstdc++, zlib, openssl
636 Requires: glibc, readline, bacula-libs
645 Requires: python >= %{pyver}
659 This is the File daemon (Client) only package. It includes the command line
662 This build includes python scripting support.
665 This build includes tcp-wrappers support.
671 Summary: Bacula - The Network Backup Solution
672 Group: System Environment/Daemons
674 %description updatedb
685 This package installs scripts for updating older versions of the bacula
691 Summary: Bacula - The Network Backup Solution
692 Group: System Environment/Daemons
705 This package installs the shared libraries used by many bacula programs.
707 # Must explicitly enable debug pkg on SuSE
708 # but not in opensuse_bs
709 %if %{suse} && ! 0%{?opensuse_bs}
720 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
732 # patches for the bundled sqlite scripts
734 # patch the make_sqlite_tables script for installation bindir
735 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
737 # patch the create_sqlite_database script for installation bindir
738 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
740 # patch the make_catalog_backup script for installation bindir
741 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
743 # patch the update_sqlite_tables script for installation bindir
744 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
746 # patch the bacula-dir init script to remove sqlite service
747 %if %{sqlite} && %{suse}
748 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
752 # 64 bit lib location hacks
753 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
754 # reported to be fixed to properly detect lib locations.
756 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
758 %if %{mysql} && %{x86_64}
759 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
761 %if %{python} && %{x86_64}
762 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
765 # Main Bacula configuration
767 --prefix=%{_prefix} \
768 --sbindir=%{_sbindir} \
769 --sysconfdir=%{sysconf_dir} \
770 --mandir=%{_mandir} \
771 --with-scriptdir=%{script_dir} \
772 --with-working-dir=%{working_dir} \
773 --with-plugindir=%{script_dir} \
774 --with-pid-dir=%{pid_dir} \
775 --with-subsys-dir=%{_subsysdir} \
776 --enable-smartalloc \
778 --disable-bwx-console \
779 --disable-tray-monitor \
786 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
796 --with-tcp-wrappers \
799 --enable-client-only \
801 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
802 --disable-batch-insert \
804 --with-dir-user=%{director_daemon_user} \
805 --with-dir-group=%{daemon_group} \
806 --with-sd-user=%{storage_daemon_user} \
807 --with-sd-group=%{storage_daemon_group} \
808 --with-fd-user=%{file_daemon_user} \
809 --with-fd-group=%{daemon_group} \
810 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
811 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
812 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
813 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
814 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
815 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
823 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
824 mkdir -p $RPM_BUILD_ROOT/etc/init.d
825 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
826 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
827 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
828 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
829 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
830 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
832 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
833 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
836 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
839 make DESTDIR=$RPM_BUILD_ROOT install
842 # Program docs not installed on client
843 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
844 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
845 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
846 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
847 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
848 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
849 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
850 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
851 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
853 # Docs for programs that are depreciated
854 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
855 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
856 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
857 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
859 # fixme - make installs the mysql scripts for sqlite build
861 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
862 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
863 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
866 # fixme - make installs the mysql scripts for postgresql build
868 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
869 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
872 # install the init scripts
874 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
875 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
876 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
879 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
880 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
881 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
883 %if ! %{suse} && ! %{mdk}
884 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
885 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
886 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
888 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
890 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
891 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
896 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
897 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
898 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
902 # install the logrotate file
903 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
905 # install the updatedb scripts
906 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
908 # install the sample-query.sql file
910 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
913 # install the logwatch scripts
915 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
916 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
917 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
918 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
919 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
920 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
921 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
922 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
925 # now clean up permissions that are left broken by the install
926 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
928 # fix me - building enable-client-only installs files not included in bacula-client package
930 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
931 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
932 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
933 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
934 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
935 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
936 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
937 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
938 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
939 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
940 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
941 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
942 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
943 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
947 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
949 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
951 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
956 # MySQL specific files
958 %defattr(-, root, root)
959 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
960 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
961 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
962 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
963 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
964 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
965 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
966 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
967 %{_libdir}/libbacsql*
972 %defattr(-,root,root)
973 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
974 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
975 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
976 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
977 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
978 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
979 %{sqlite_bindir}/libsqlite3.a
980 %{sqlite_bindir}/sqlite3.h
981 %{sqlite_bindir}/sqlite3
988 %defattr(-,root,root)
989 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
990 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
991 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
992 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
993 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
994 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
995 %{_libdir}/libbacsql*
998 # The rest is DB backend independent
1000 %if ! %{client_only}
1001 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1002 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1003 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1004 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
1005 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1006 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1007 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1008 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1009 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1010 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1011 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1012 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1013 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
1014 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1015 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1016 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1017 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
1018 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1019 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1020 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1021 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1022 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
1023 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1024 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1025 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
1026 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1027 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1028 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1029 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
1031 /etc/logrotate.d/bacula
1032 %{logwatch_dir}/scripts/services/bacula
1033 %{logwatch_dir}/scripts/shared/applybaculadate
1034 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1035 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1036 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1037 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1038 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1039 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1040 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1041 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
1043 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1045 %{_sbindir}/bacula-dir
1046 %{_sbindir}/bacula-fd
1047 %{_sbindir}/bacula-sd
1050 %{_sbindir}/bextract
1054 %{_sbindir}/btraceback
1055 %{_sbindir}/bconsole
1059 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1060 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1061 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1062 %{_mandir}/man8/bacula.8.%{manpage_ext}
1063 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1064 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1065 %{_mandir}/man8/bextract.8.%{manpage_ext}
1066 %{_mandir}/man8/bls.8.%{manpage_ext}
1067 %{_mandir}/man8/bscan.8.%{manpage_ext}
1068 %{_mandir}/man8/btape.8.%{manpage_ext}
1069 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1070 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1071 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1072 %{_mandir}/man1/bat.1.%{manpage_ext}
1073 %_prefix/share/doc/*
1075 # opensuse build service changes the release itself
1076 %if 0%{?opensuse_bs}
1077 %doc ../Release_Notes-%{version}-1.txt
1079 %doc ../Release_Notes-%{version}-%{release}.txt
1085 # test for bacula database older than version 13
1086 # note: this ASSUMES no password has been set for bacula database
1087 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1092 # are we upgrading from sqlite to sqlite3?
1093 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1094 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1095 echo "Your catalog database file is not compatible with sqlite3, thus"
1096 echo "you will need to dump the data, delete the old file, and re-run"
1097 echo "this rpm upgrade."
1099 echo "Backing up your current database..."
1100 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1101 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1102 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1103 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1105 echo "Please re-run this rpm package upgrade."
1106 echo "After the upgrade is complete, restore your catalog"
1107 echo "with the following commands:"
1108 echo "%{script_dir}/drop_sqlite3_tables"
1109 echo "cd %{working_dir}"
1110 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1111 echo "chown bacula.bacula bacula.db"
1114 # test for bacula database older than version 12 and sqlite3
1115 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1116 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1121 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1124 %if ! %{client_only}
1125 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
1126 echo "This bacula upgrade will update a bacula database from version 12 to 13."
1127 echo "You appear to be running database version $DB_VER. You must first update"
1128 echo "your database to version 12 and then install this upgrade. The alternative"
1129 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1130 echo "catalog information, then do the upgrade. Information on updating a"
1131 echo "database older than version 12 can be found in the release notes."
1140 %if ! %{client_only}
1141 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1142 if [ -s %{sysconf_dir}/console.conf ];then
1143 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1146 # create the daemon users and groups
1147 # first create the groups if they don't exist
1148 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1149 if [ -z "$HAVE_BACULA" ]; then
1150 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1151 echo "The group %{daemon_group} has been added to %{group_file}."
1152 echo "See the manual chapter \"Running Bacula\" for details."
1154 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1155 if [ -z "$HAVE_BACULA" ]; then
1156 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1157 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1158 echo "See the manual chapter \"Running Bacula\" for details."
1160 # now create the users if they do not exist
1161 # we do not use the -g option allowing the primary group to be set to system default
1162 # this will be a unique group on redhat type systems or the group users on some systems
1163 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1164 if [ -z "$HAVE_BACULA" ]; then
1165 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1166 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1167 echo "See the manual chapter \"Running Bacula\" for details."
1169 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1170 if [ -z "$HAVE_BACULA" ]; then
1171 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1172 echo "The user %{director_daemon_user} has been added to %{user_file}."
1173 echo "See the manual chapter \"Running Bacula\" for details."
1175 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1176 if [ -z "$HAVE_BACULA" ]; then
1177 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1178 echo "The user %{file_daemon_user} has been added to %{user_file}."
1179 echo "See the manual chapter \"Running Bacula\" for details."
1181 # now we add the supplementary groups, this is ok to call even if the users already exist
1182 # we only do this if the user is NOT root
1183 IS_ROOT=%{director_daemon_user}
1184 if [ "$IS_ROOT" != "root" ]; then
1185 %{usermod} -G %{daemon_group} %{director_daemon_user}
1187 IS_ROOT=%{storage_daemon_user}
1188 if [ "$IS_ROOT" != "root" ]; then
1189 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1191 IS_ROOT=%{file_daemon_user}
1192 if [ "$IS_ROOT" != "root" ]; then
1193 %{usermod} -G %{daemon_group} %{file_daemon_user}
1206 %if ! %{client_only}
1208 if [ "$1" -ge 1 ] ; then
1209 %if %{suse} && %{mysql}
1210 /sbin/chkconfig --add mysql
1212 %if %{suse} && %{postgresql}
1213 /sbin/chkconfig --add postgresql
1215 /sbin/chkconfig --add bacula-dir
1216 /sbin/chkconfig --add bacula-fd
1217 /sbin/chkconfig --add bacula-sd
1223 #check, if mysql can be called successfully at all
1224 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1226 # test for an existing database
1227 # note: this ASSUMES no password has been set for bacula database
1228 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1230 # grant privileges and create tables if they do not exist
1231 if [ -z "$DB_VER" ]; then
1232 echo "Hmm, it doesn't look like you have an existing database."
1233 echo "Granting privileges for MySQL user bacula..."
1234 %{script_dir}/grant_mysql_privileges
1235 echo "Creating MySQL bacula database..."
1236 %{script_dir}/create_mysql_database
1237 echo "Creating bacula tables..."
1238 %{script_dir}/make_mysql_tables
1240 # check to see if we need to upgrade a 3.x database
1241 elif [ "$DB_VER" -lt "13" ]; then
1242 echo "This release requires an upgrade to your bacula database."
1243 echo "Backing up your current database..."
1244 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1245 echo "Upgrading bacula database ..."
1246 %{script_dir}/update_mysql_tables
1247 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1254 # test for an existing database
1255 if [ -s %{working_dir}/bacula.db ]; then
1256 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1257 # check to see if we need to upgrade a 3.x database
1258 if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
1259 echo "This release requires an upgrade to your bacula database."
1260 echo "Backing up your current database..."
1261 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1262 echo "Upgrading bacula database ..."
1263 %{script_dir}/update_sqlite3_tables
1264 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1267 # create the database and tables
1268 echo "Hmm, doesn't look like you have an existing database."
1269 echo "Creating SQLite database..."
1270 %{script_dir}/create_sqlite3_database
1271 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1272 echo "Creating the SQLite tables..."
1273 %{script_dir}/make_sqlite3_tables
1278 # check if psql can be called successfully at all
1279 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1281 # test for an existing database
1282 # note: this ASSUMES no password has been set for bacula database
1283 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1285 # grant privileges and create tables if they do not exist
1286 if [ -z "$DB_VER" ]; then
1287 echo "Hmm, doesn't look like you have an existing database."
1288 echo "Creating PostgreSQL bacula database..."
1289 %{script_dir}/create_postgresql_database
1290 echo "Creating bacula tables..."
1291 %{script_dir}/make_postgresql_tables
1292 echo "Granting privileges for PostgreSQL user bacula..."
1293 %{script_dir}/grant_postgresql_privileges
1295 # check to see if we need to upgrade a 5.0.x database
1296 elif [ "$DB_VER" -lt "13" ]; then
1297 echo "This release requires an upgrade to your bacula database."
1298 echo "Backing up your current database..."
1299 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1300 echo "Upgrading bacula database ..."
1301 %{script_dir}/update_postgresql_tables
1302 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1308 %if ! %{client_only}
1309 if [ -d %{sysconf_dir} ]; then
1311 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
1312 pass=`openssl rand -base64 33`
1313 for file in *.conf; do
1314 sed "s@${string}@${pass}@g" $file > $file.new
1315 cp -f $file.new $file; rm -f $file.new
1318 # put actual hostname in conf file
1320 string="XXX_HOSTNAME_XXX"
1321 for file in *.conf; do
1322 sed "s@${string}@${host}@g" $file >$file.new
1323 cp -f $file.new $file; rm -f $file.new
1339 %if ! %{client_only}
1342 /sbin/chkconfig --del bacula-dir
1343 /sbin/chkconfig --del bacula-fd
1344 /sbin/chkconfig --del bacula-sd
1349 %defattr(-,root,root)
1350 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1351 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1352 %{script_dir}/bacula-ctl-fd
1353 /etc/init.d/bacula-fd
1355 /etc/logrotate.d/bacula
1357 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1358 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1359 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1361 %{_sbindir}/bacula-fd
1362 %{_sbindir}/btraceback
1363 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1364 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1365 %{_sbindir}/bconsole
1366 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1367 %{_mandir}/man8/bacula.8.%{manpage_ext}
1368 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1369 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1370 %{_mandir}/man1/bat.1.%{manpage_ext}
1371 %_prefix/share/doc/*
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
1423 /sbin/chkconfig --del bacula-fd
1427 %defattr(-,root,root)
1430 %{_libdir}/libbaccfg*
1431 %{_libdir}/libbacfind*
1432 %{_libdir}/libbacpy*
1442 %if ! %{client_only}
1444 %defattr(-,root,%{daemon_group})
1445 %{script_dir}/updatedb/*
1446 #oensuse_bs: directories not owned by any package
1447 #%{script_dir}/updatedb
1450 # create the daemon group
1451 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1452 if [ -z "$HAVE_BACULA" ]; then
1453 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1454 echo "The group %{daemon_group} has been added to %{group_file}."
1455 echo "See the manual chapter \"Running Bacula\" for details."
1459 echo "The database update scripts were installed to %{script_dir}/updatedb"
1463 * Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1464 - remove --without-qwt from configure statement
1465 * Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1466 - move shared libraries into bacula-libs package
1467 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1468 - remove deprecated mysql4 and mysql5 build defines
1469 - add build support for tcpwrappers
1470 - remove bacula_config file for client only build
1471 - remove requirements for database server packages
1472 - enable readline support
1474 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1476 - fix client only build
1477 - clean up requirements for termcap
1478 - query.sql now empty by default so we install sample-query.sql along side it
1479 - remove old nobuild_mtx switch
1480 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1481 - fix mysql database upgrade
1482 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1483 - fix permissions of dbcheck
1485 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1487 - add su112 and fc10 builds, remove doc package declaration.
1488 - fix source path for logwatch files.
1489 - restore static bundled build of sqlite (who took that out?) and remove use
1490 - of system sqlite. we don't support use of sqlite2.
1491 - upgrade database from version 11 to 12.
1492 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1493 - changes to work with opensuse build service
1494 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1495 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1496 - removed build of rescue, gnome console and wxconsole
1497 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1498 - Fix bat install which is now handled by make and uses shared libs
1499 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1500 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1501 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1502 - Fix post ldconfig problem in client only build
1503 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - remove more files installed by client-only build not needed by client package
1505 - remove libbacsql files from client package
1506 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - update for new docs configuration
1509 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1510 - add switch to pass Distribution tag
1511 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1513 - database update version 10 to 11
1514 - make now installs docs so we rm from buildroot
1515 - add shared libs in %_libdir and other misc new files
1516 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1519 - set paths for QT using pkgconfig
1520 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1521 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1522 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1523 - adjust /opt/bacula install
1524 - add build switch to supress rescue package
1525 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1526 - add support for install to /opt/bacula
1527 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1528 - remove libtermcap dependancy for FC9
1529 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1530 - fix bat dependencies
1531 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1535 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1536 - FHS compatibility changes
1537 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1538 - remove fix for false buffer overflow detection with glibc >= 2.7
1539 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1540 - fix for false buffer overflow detection with glibc >= 2.7