3 # Copyright (C) 2000-2010 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 # postgresql defines - defaults for most platforms
14 # pass changes if required
15 # versions less than 8 are no longer supported
16 %define postgres_version 8
17 %{?postgresql_version:%define postgres_version %{postgresql_version}}
18 %define postgres_package postgresql84
19 %{?postgresql_package:%define postgres_package %{postgresql_package}}
20 %define postgres_server_package postgresql84-server
21 %{?postgresql_server_package:%define postgres_server_package %{postgresql_server_package}}
22 %define postgres_devel_package postgresql84-devel
23 %{?postgresql_devel_package:%define postgres_devel_package %{postgresql_devel_package}}
26 %{?single_dir_install:%define single_dir 1}
28 # Installation Directory locations
30 %define _prefix /opt/bacula
31 %define _sbindir /opt/bacula/bin
32 %define _bindir /opt/bacula/bin
33 %define _subsysdir /opt/bacula/working
34 %define sqlite_bindir /opt/bacula/sqlite
35 %define _mandir /usr/share/man
36 %define sysconf_dir /opt/bacula/etc
37 %define script_dir /opt/bacula/scripts
38 %define working_dir /opt/bacula/working
39 %define pid_dir /opt/bacula/working
40 %define plugin_dir /opt/bacula/plugins
41 %define lib_dir /opt/bacula/lib
44 %define _sbindir %_prefix/sbin
45 %define _bindir %_prefix/bin
46 %define _subsysdir /var/lock/subsys
47 %define sqlite_bindir %_libdir/bacula/sqlite
48 %define _mandir %_prefix/share/man
49 %define sysconf_dir /etc/bacula
50 %define script_dir %_libdir/bacula
51 %define working_dir /var/lib/bacula
52 %define pid_dir /var/run
53 %define plugin_dir %_libdir/bacula/plugins
54 %define lib_dir %_libdir/bacula/lib
57 # Daemon user:group Don't change them unless you know what you are doing
58 %define director_daemon_user bacula
59 %define storage_daemon_user bacula
60 %define file_daemon_user root
61 %define daemon_group bacula
62 # group that has write access to tape devices, usually disk on Linux
63 %define storage_daemon_group disk
65 %define depkgs ../depkgs
67 # probems with mandriva build:
68 # nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
70 # set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
71 #openSUSE 11.1 %if 0%{?suse_version} == 1110
72 #openSUSE 11.0 %if 0%{?suse_version} == 1100
73 #openSUSE 10.3 %if 0%{?suse_version} == 1030
74 #openSUSE 10.2 %if 0%{?suse_version} == 1020
75 #SUSE Linux 10.1 %if 0%{?suse_version} == 1010
76 #SUSE Linux 10.0 %if 0%{?suse_version} == 1000
77 #SUSE Linux 9.3 %if 0%{?suse_version} == 930
78 #SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910
79 #SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010
80 #SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110
81 #CentOS 5 %if 0%{?centos_version} == 501
82 #RHEL 4 %if 0%{?rhel_version} == 406
83 #RHEL 5 %if 0%{?rhel_version} == 501
84 #Fedora 6 with Extras %if 0%{?fedora_version} == 6
85 #Fedora 7 with Extras %if 0%{?fedora_version} == 7
86 #Fedora 8 with Extras %if 0%{?fedora_version} == 8
87 #Fedora 9 with Extras %if 0%{?fedora_version} == 9
88 #Fedora 10 with Extras %if 0%{?fedora_version} == 10
89 #Mandriva 2006 %if 0%{?mandriva_version} == 2006
90 #Mandriva 2007 %if 0%{?mandriva_version} == 2007
91 #Mandriva 2008 %if 0%{?mandriva_version} == 2008
95 # am I running in opensuse build service?
96 # TODO: seems to make problems
98 # Build Service: Determine Distribution
101 %define build_x86_64 1
105 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
106 BuildRequires: GConf2-devel
107 BuildRequires: freetype-devel
108 BuildRequires: libtermcap-devel
109 BuildRequires: shadow-utils
113 %if 0%{?mandriva_version} == 2007
115 %define _dist "Mandriva 2007"
118 %if 0%{?fedora_version} == 8
120 %define _dist "Fedora Core 8"
121 BuildRequires: redhat-release
124 %if 0%{?fedora_version} == 9
126 %define _dist "Fedora Core 9"
127 BuildRequires: redhat-release
131 %if 0%{?fedora_version} == 10
133 %define _dist "Fedora Core 10"
134 BuildRequires: PolicyKit-gnome
135 BuildRequires: fedora-release
138 %if 0%{?fedora_version} == 11
140 %define _dist "Fedora Core 11"
141 BuildRequires: PolicyKit-gnome
142 BuildRequires: fedora-release
145 %if 0%{?rhel_version} == 501
146 %define build_rhel5 1
147 %define _dist "Red Hat Enterprise Linux Server release 5"
148 BuildRequires: redhat-release
151 %if 0%{?rhel_version} == 406
152 %define build_rhel4 1
153 %define _dist "Red Hat Enterprise Linux Server release 4"
154 BuildRequires: redhat-release
158 %if 0%{?centos_version} == 501
159 %define build_centos5 1
160 %define _dist "CentOS 5"
161 BuildRequires: redhat-release
165 %if 0%{?suse_version} == 1020
166 %define build_su102 1
167 %define _dist "OpenSUSE 10.2"
168 BuildRequires: suse-release
172 %if 0%{?suse_version} == 1030
173 %define build_su103 1
174 %define _dist "OpenSUSE 10.3"
175 BuildRequires: suse-release
178 %if 0%{?suse_version} == 1100
179 %define build_su110 1
180 %define _dist "SUSE 11"
181 BuildRequires: suse-release
185 %if 0%{?suse_version} == 1110
186 %define build_su111 1
187 %define _dist "SUSE 11"
190 %if 0%{?suse_version} == 1120
191 %define build_su112 1
192 %define _dist "SUSE 11"
196 %if 0%{?sles_version} == 9
198 %define _dist "SLES 9"
202 %if 0%{?sles_version} == 10
204 %define _dist "SLE 10"
208 %if 0%{?sles_version} == 11
209 %define build_su111 1
210 %define _dist "SLES 11"
217 # any patches for this release
218 # be sure to check the setup section for patch macros
220 #--------------------------------------------------------------------------
221 # it should not be necessary to change anything below here for a release
222 # except for patch macros in the setup section
223 #--------------------------------------------------------------------------
225 %{?contrib_packager:%define _packager %{contrib_packager}}
227 Summary: Bacula - The Network Backup Solution
231 Group: System Environment/Daemons
233 BuildRoot: %{_tmppath}/%{name}-root
234 URL: http://www.bacula.org/
235 Vendor: The Bacula Team
236 Packager: %{_packager}
239 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
240 # opensuse build service changes the release itself
241 # what happens if the release is not 1? DSB
243 Source1: Release_Notes-%{version}-1.tar.gz
245 Source1: Release_Notes-%{version}-%{release}.tar.gz
247 Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
249 # define the basic package description
250 %define blurb Bacula - The Leading Open Source Backup Solution.
251 %define blurb2 Bacula is a set of computer programs that permit you (or the system
252 %define blurb3 administrator) to manage backup, recovery, and verification of computer
253 %define blurb4 data across a network of computers of different kinds. In technical terms,
254 %define blurb5 it is a network client/server based backup program. Bacula is relatively
255 %define blurb6 easy to use and efficient, while offering many advanced storage management
256 %define blurb7 features that make it easy to find and recover lost or damaged files.
257 %define blurb8 Bacula source code has been released under the AGPL version 3 license.
259 %define user_file /etc/passwd
260 %define group_file /etc/group
263 %define useradd /usr/sbin/useradd
264 %define groupadd /usr/sbin/groupadd
265 %define usermod /usr/sbin/usermod
267 # platform defines - set one below or define the build_xxx on the command line
270 %{?build_rh7:%define rh7 1}
272 %{?build_rh8:%define rh8 1}
274 %{?build_rh9:%define rh9 1}
277 %{?build_fc1:%define fc1 1}
279 %{?build_fc3:%define fc3 1}
281 %{?build_fc4:%define fc4 1}
283 %{?build_fc5:%define fc5 1}
285 %{?build_fc6:%define fc6 1}
287 %{?build_fc7:%define fc7 1}
289 %{?build_fc8:%define fc8 1}
291 %{?build_fc9:%define fc9 1}
293 %{?build_fc10:%define fc10 1}
295 %{?build_fc11:%define fc11 1}
297 %{?build_fc12:%define fc12 1}
298 # Whitebox Enterprise build
300 %{?build_wb3:%define wb3 1}
301 # RedHat Enterprise builds
303 %{?build_rhel3:%define rhel3 1}
304 %{?build_rhel3:%define wb3 1}
306 %{?build_rhel4:%define rhel4 1}
307 %{?build_rhel4:%define fc3 1}
309 %{?build_rhel5:%define rhel5 1}
310 %{?build_rhel5:%define fc6 1}
313 %{?build_centos3:%define centos3 1}
314 %{?build_centos3:%define wb3 1}
316 %{?build_centos4:%define centos4 1}
317 %{?build_centos4:%define fc3 1}
319 %{?build_centos5:%define centos5 1}
320 %{?build_centos5:%define fc6 1}
323 %{?build_sl3:%define sl3 1}
324 %{?build_sl3:%define wb3 1}
326 %{?build_sl4:%define sl4 1}
327 %{?build_sl4:%define fc3 1}
329 %{?build_sl5:%define sl5 1}
330 %{?build_sl5:%define fc6 1}
333 %{?build_su9:%define su9 1}
335 %{?build_su10:%define su10 1}
337 %{?build_su102:%define su102 1}
339 %{?build_su103:%define su103 1}
341 %{?build_su110:%define su110 1}
343 %{?build_su111:%define su111 1}
345 %{?build_su112:%define su112 1}
348 %{?build_mdk:%define mdk 1}
350 %{?build_mdv:%define mdv 1}
351 %{?build_mdv:%define mdk 1}
354 %define client_only 0
355 %{?build_client_only:%define client_only 1}
357 # Setup some short cuts
359 %if %{rh7} || %{rh8} || %{rh9}
363 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
367 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
371 %if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
375 %if %{sl3} || %{sl4} || %{sl5}
380 # test for a platform definition
381 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
382 %{error: You must specify a platform. Please examine the spec file.}
386 # distribution-specific directory for logwatch
387 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
388 %define logwatch_dir /etc/log.d
390 %define logwatch_dir /etc/logwatch
394 # set for database support desired or define the build_xxx on the command line
396 %{?build_mysql:%define mysql 1}
398 %{?build_sqlite:%define sqlite 1}
400 %{?build_postgresql:%define postgresql 1}
402 # test for a database definition
403 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
404 %{error: You must specify database support, by passing one of the following to rpmbuild:}
405 %{error: --define build_postgresql=1}
406 %{error: --define build_sqlite=1}
407 %{error: --define build_mysql=1}
412 %define db_backend mysql
415 %define db_backend sqlite3
418 %define db_backend postgresql
423 %{?build_x86_64:%define x86_64 1}
425 # check what distribution we are
426 %if %{rhat} || %{rhel}
427 %define _dist %(grep Red /etc/redhat-release)
429 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
430 %define _dist %(grep Fedora /etc/redhat-release)
432 %if %{centos5} || %{centos4} || %{centos3}
433 %define _dist %(grep CentOS /etc/redhat-release)
435 %if %{sl5} ||%{sl4} || %{sl3}
436 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
438 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
439 %define _dist %(grep White /etc/whitebox-release)
442 %define _dist %(grep -i SuSE /etc/SuSE-release)
445 %define _dist %(grep Mand /etc/mandrake-release)
447 %{?DISTNAME:%define _dist %{DISTNAME}}
449 # only set Disribution if not in opensuse build service, as it sets it itself
450 %if ! 0%{?opensuse_bs}
451 Distribution: %{_dist}
454 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
455 # needed in opensuse_bs, as rpm is installed during build process
456 BuildRequires: libmysqlclient-devel
457 BuildRequires: mysql-client
460 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
461 BuildRequires: %{postgres_package}
462 BuildRequires: %{postgres_server_package}
464 BuildRequires: openssl
466 %if 0%{?opensuse_bs} && %{suse}
467 BuildRequires: pwdutils
468 BuildRequires: sysconfig
471 # should we turn on python support
473 %{?build_python:%define python 1}
475 # should we enable tcp wrappers support
476 %define tcpwrappers 0
477 %{?build_tcpwrappers:%define tcpwrappers 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
493 BuildRequires: gcc, gcc-c++, make, autoconf
494 BuildRequires: glibc, glibc-devel
495 BuildRequires: ncurses-devel, perl, readline-devel
496 BuildRequires: libstdc++-devel, zlib-devel
497 BuildRequires: openssl-devel
498 BuildRequires: libacl-devel
499 BuildRequires: pkgconfig
501 BuildRequires: libxml2-devel
504 BuildRequires: python, python-devel
505 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
509 BuildRequires: libxml-devel
512 BuildRequires: libstdc++-static-devel
513 BuildRequires: glibc-static-devel
517 BuildRequires: termcap
519 BuildRequires: libtermcap-devel
523 BuildRequires: sqlite-devel
527 BuildRequires: mysql-devel
530 %if %{postgresql} && %{wb3}
531 BuildRequires: rh-postgresql-devel >= %{postgres_version}
534 %if %{postgresql} && ! %{wb3}
535 BuildRequires: %{postgres_devel_package} >= %{postgres_version}
559 Summary: Bacula - The Network Backup Solution
560 Group: System Environment/Daemons
561 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
562 Conflicts: bacula-client
564 Requires: ncurses, libstdc++, zlib, openssl
565 Requires: glibc, readline, %{name}-libs
578 %if %{postgresql} && %{wb3}
579 Requires: rh-postgresql >= 7
581 %if %{postgresql} && ! %{wb3}
582 Requires: postgresql >= 7
592 %description postgresql
596 Requires: python >= %{pyver}
610 This build requires MySQL to be installed separately as the catalog database.
613 This build requires PostgreSQL to be installed separately as the catalog database.
616 This build incorporates sqlite3 as the catalog database, statically compiled.
619 This build includes python scripting support.
622 This build includes tcp-wrappers support.
626 Summary: Bacula - The Network Backup Solution
627 Group: System Environment/Daemons
629 Conflicts: bacula-mysql
630 Conflicts: bacula-sqlite
631 Conflicts: bacula-postgresql
637 Requires: libstdc++, zlib, openssl
638 Requires: glibc, readline, %{name}-libs
647 Requires: python >= %{pyver}
661 This is the File daemon (Client) only package. It includes the command line
664 This build includes python scripting support.
667 This build includes tcp-wrappers support.
673 Summary: Bacula - The Network Backup Solution
674 Group: System Environment/Daemons
676 %description updatedb
687 This package installs scripts for updating older versions of the bacula
693 Summary: Bacula - The Network Backup Solution
694 Group: System Environment/Daemons
707 This package installs the shared libraries used by many bacula programs.
709 # Must explicitly enable debug pkg on SuSE
710 # but not in opensuse_bs
711 %if %{suse} && ! 0%{?opensuse_bs}
723 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
735 # patches for the bundled sqlite scripts
737 # patch the make_sqlite_tables script for installation bindir
738 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
740 # patch the create_sqlite_database script for installation bindir
741 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
743 # patch the make_catalog_backup script for installation bindir
744 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
746 # patch the update_sqlite_tables script for installation bindir
747 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
749 # patch the bacula-dir init script to remove sqlite service
750 %if %{sqlite} && %{suse}
751 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
755 # 64 bit lib location hacks
756 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
757 # reported to be fixed to properly detect lib locations.
759 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
761 %if %{mysql} && %{x86_64}
762 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
764 %if %{python} && %{x86_64}
765 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
768 # Main Bacula configuration
770 --prefix=%{_prefix} \
771 --sbindir=%{_sbindir} \
772 --sysconfdir=%{sysconf_dir} \
773 --mandir=%{_mandir} \
774 --with-scriptdir=%{script_dir} \
775 --with-working-dir=%{working_dir} \
776 --with-plugindir=%{script_dir} \
777 --with-pid-dir=%{pid_dir} \
778 --with-subsys-dir=%{_subsysdir} \
779 --enable-smartalloc \
781 --disable-bwx-console \
782 --disable-tray-monitor \
789 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
799 --with-tcp-wrappers \
802 --enable-client-only \
804 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
805 --disable-batch-insert \
807 --with-dir-user=%{director_daemon_user} \
808 --with-dir-group=%{daemon_group} \
809 --with-sd-user=%{storage_daemon_user} \
810 --with-sd-group=%{storage_daemon_group} \
811 --with-fd-user=%{file_daemon_user} \
812 --with-fd-group=%{daemon_group} \
813 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
814 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
815 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
816 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
817 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
818 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
826 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
827 mkdir -p $RPM_BUILD_ROOT/etc/init.d
828 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
829 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
830 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
831 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
832 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
833 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
835 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
836 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
839 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
842 make DESTDIR=$RPM_BUILD_ROOT install
845 # Program docs not installed on client
846 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
847 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
848 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
849 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
850 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
851 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
852 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
853 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
854 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
856 # Docs for programs that are depreciated
857 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
858 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
859 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
860 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
862 # fixme - make installs the mysql scripts for sqlite build
864 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
865 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
866 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
869 # fixme - make installs the mysql scripts for postgresql build
871 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
872 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
875 # install the init scripts
877 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
878 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
879 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
882 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
883 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
884 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
886 %if ! %{suse} && ! %{mdk}
887 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
888 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
889 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
891 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
893 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
894 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
899 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
900 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
901 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
905 # install the logrotate file
906 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
908 # install the updatedb scripts
909 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
911 # install the sample-query.sql file
913 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
916 # install the logwatch scripts
918 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
919 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
920 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
921 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
922 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
923 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
924 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
925 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
928 # now clean up permissions that are left broken by the install
929 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
931 # fix me - building enable-client-only installs files not included in bacula-client package
933 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
934 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
935 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
936 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
937 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
938 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
939 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
940 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
941 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
942 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
943 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
944 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
945 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
946 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
950 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
952 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
954 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
959 # MySQL specific files
961 %defattr(-, root, root)
962 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
963 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
964 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
965 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
966 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
967 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
968 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
969 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
970 %{_libdir}/libbacsql*
975 %defattr(-,root,root)
976 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
977 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
978 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
979 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
980 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
981 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
982 %{sqlite_bindir}/libsqlite3.a
983 %{sqlite_bindir}/sqlite3.h
984 %{sqlite_bindir}/sqlite3
991 %defattr(-,root,root)
992 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
993 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
994 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
995 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
996 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
997 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
998 %{_libdir}/libbacsql*
1001 # The rest is DB backend independent
1003 %if ! %{client_only}
1004 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1005 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1006 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1007 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
1008 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1009 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1010 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1011 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1012 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1013 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1014 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1015 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1016 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
1017 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1018 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1019 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1020 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
1021 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1022 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1023 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1024 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1025 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
1026 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1027 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1028 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
1029 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1030 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1031 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1032 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
1034 /etc/logrotate.d/bacula
1035 %{logwatch_dir}/scripts/services/bacula
1036 %{logwatch_dir}/scripts/shared/applybaculadate
1037 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1038 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1039 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1040 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1041 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1042 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1043 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1044 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
1046 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1048 %{_sbindir}/bacula-dir
1049 %{_sbindir}/bacula-fd
1050 %{_sbindir}/bacula-sd
1053 %{_sbindir}/bextract
1057 %{_sbindir}/btraceback
1058 %{_sbindir}/bconsole
1062 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1063 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1064 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1065 %{_mandir}/man8/bacula.8.%{manpage_ext}
1066 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1067 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1068 %{_mandir}/man8/bextract.8.%{manpage_ext}
1069 %{_mandir}/man8/bls.8.%{manpage_ext}
1070 %{_mandir}/man8/bscan.8.%{manpage_ext}
1071 %{_mandir}/man8/btape.8.%{manpage_ext}
1072 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1073 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1074 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1075 %{_mandir}/man1/bat.1.%{manpage_ext}
1076 %_prefix/share/doc/*
1078 # opensuse build service changes the release itself
1079 %if 0%{?opensuse_bs}
1080 %doc ../Release_Notes-%{version}-1.txt
1082 %doc ../Release_Notes-%{version}-%{release}.txt
1088 # test for bacula database older than version 13
1089 # note: this ASSUMES no password has been set for bacula database
1090 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1095 # are we upgrading from sqlite to sqlite3?
1096 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1097 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1098 echo "Your catalog database file is not compatible with sqlite3, thus"
1099 echo "you will need to dump the data, delete the old file, and re-run"
1100 echo "this rpm upgrade."
1102 echo "Backing up your current database..."
1103 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1104 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1105 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1106 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1108 echo "Please re-run this rpm package upgrade."
1109 echo "After the upgrade is complete, restore your catalog"
1110 echo "with the following commands:"
1111 echo "%{script_dir}/drop_sqlite3_tables"
1112 echo "cd %{working_dir}"
1113 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1114 echo "chown bacula.bacula bacula.db"
1117 # test for bacula database older than version 12 and sqlite3
1118 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1119 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1124 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1127 %if ! %{client_only}
1128 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
1129 echo "This bacula upgrade will update a bacula database from version 12 to 13."
1130 echo "You appear to be running database version $DB_VER. You must first update"
1131 echo "your database to version 12 and then install this upgrade. The alternative"
1132 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1133 echo "catalog information, then do the upgrade. Information on updating a"
1134 echo "database older than version 12 can be found in the release notes."
1143 %if ! %{client_only}
1144 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1145 if [ -s %{sysconf_dir}/console.conf ];then
1146 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1149 # create the daemon users and groups
1150 # first create the groups if they don't exist
1151 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1152 if [ -z "$HAVE_BACULA" ]; then
1153 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1154 echo "The group %{daemon_group} has been added to %{group_file}."
1155 echo "See the manual chapter \"Running Bacula\" for details."
1157 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1158 if [ -z "$HAVE_BACULA" ]; then
1159 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1160 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1161 echo "See the manual chapter \"Running Bacula\" for details."
1163 # now create the users if they do not exist
1164 # we do not use the -g option allowing the primary group to be set to system default
1165 # this will be a unique group on redhat type systems or the group users on some systems
1166 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1167 if [ -z "$HAVE_BACULA" ]; then
1168 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1169 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1170 echo "See the manual chapter \"Running Bacula\" for details."
1172 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1173 if [ -z "$HAVE_BACULA" ]; then
1174 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1175 echo "The user %{director_daemon_user} has been added to %{user_file}."
1176 echo "See the manual chapter \"Running Bacula\" for details."
1178 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1179 if [ -z "$HAVE_BACULA" ]; then
1180 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1181 echo "The user %{file_daemon_user} has been added to %{user_file}."
1182 echo "See the manual chapter \"Running Bacula\" for details."
1184 # now we add the supplementary groups, this is ok to call even if the users already exist
1185 # we only do this if the user is NOT root
1186 IS_ROOT=%{director_daemon_user}
1187 if [ "$IS_ROOT" != "root" ]; then
1188 %{usermod} -G %{daemon_group} %{director_daemon_user}
1190 IS_ROOT=%{storage_daemon_user}
1191 if [ "$IS_ROOT" != "root" ]; then
1192 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1194 IS_ROOT=%{file_daemon_user}
1195 if [ "$IS_ROOT" != "root" ]; then
1196 %{usermod} -G %{daemon_group} %{file_daemon_user}
1209 %if ! %{client_only}
1211 if [ "$1" -ge 1 ] ; then
1212 %if %{suse} && %{mysql}
1213 /sbin/chkconfig --add mysql
1215 %if %{suse} && %{postgresql}
1216 /sbin/chkconfig --add postgresql
1218 /sbin/chkconfig --add bacula-dir
1219 /sbin/chkconfig --add bacula-fd
1220 /sbin/chkconfig --add bacula-sd
1226 #check, if mysql can be called successfully at all
1227 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1229 # test for an existing database
1230 # note: this ASSUMES no password has been set for bacula database
1231 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1233 # grant privileges and create tables if they do not exist
1234 if [ -z "$DB_VER" ]; then
1235 echo "Hmm, it doesn't look like you have an existing database."
1236 echo "Granting privileges for MySQL user bacula..."
1237 %{script_dir}/grant_mysql_privileges
1238 echo "Creating MySQL bacula database..."
1239 %{script_dir}/create_mysql_database
1240 echo "Creating bacula tables..."
1241 %{script_dir}/make_mysql_tables
1243 # check to see if we need to upgrade a 3.x database
1244 elif [ "$DB_VER" -lt "13" ]; then
1245 echo "This release requires an upgrade to your bacula database."
1246 echo "Backing up your current database..."
1247 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1248 echo "Upgrading bacula database ..."
1249 %{script_dir}/update_mysql_tables
1250 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1257 # test for an existing database
1258 if [ -s %{working_dir}/bacula.db ]; then
1259 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1260 # check to see if we need to upgrade a 3.x database
1261 if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
1262 echo "This release requires an upgrade to your bacula database."
1263 echo "Backing up your current database..."
1264 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1265 echo "Upgrading bacula database ..."
1266 %{script_dir}/update_sqlite3_tables
1267 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1270 # create the database and tables
1271 echo "Hmm, doesn't look like you have an existing database."
1272 echo "Creating SQLite database..."
1273 %{script_dir}/create_sqlite3_database
1274 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1275 echo "Creating the SQLite tables..."
1276 %{script_dir}/make_sqlite3_tables
1281 # check if psql can be called successfully at all
1282 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1284 # test for an existing database
1285 # note: this ASSUMES no password has been set for bacula database
1286 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1288 # grant privileges and create tables if they do not exist
1289 if [ -z "$DB_VER" ]; then
1290 echo "Hmm, doesn't look like you have an existing database."
1291 echo "Creating PostgreSQL bacula database..."
1292 %{script_dir}/create_postgresql_database
1293 echo "Creating bacula tables..."
1294 %{script_dir}/make_postgresql_tables
1295 echo "Granting privileges for PostgreSQL user bacula..."
1296 %{script_dir}/grant_postgresql_privileges
1298 # check to see if we need to upgrade a 5.0.x database
1299 elif [ "$DB_VER" -lt "13" ]; then
1300 echo "This release requires an upgrade to your bacula database."
1301 echo "Backing up your current database..."
1302 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1303 echo "Upgrading bacula database ..."
1304 %{script_dir}/update_postgresql_tables
1305 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1311 %if ! %{client_only}
1312 if [ -d %{sysconf_dir} ]; then
1314 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
1315 pass=`openssl rand -base64 33`
1316 for file in *.conf; do
1317 sed "s@${string}@${pass}@g" $file > $file.new
1318 cp -f $file.new $file; rm -f $file.new
1321 # put actual hostname in conf file
1323 string="XXX_HOSTNAME_XXX"
1324 for file in *.conf; do
1325 sed "s@${string}@${host}@g" $file >$file.new
1326 cp -f $file.new $file; rm -f $file.new
1342 %if ! %{client_only}
1345 /sbin/chkconfig --del bacula-dir
1346 /sbin/chkconfig --del bacula-fd
1347 /sbin/chkconfig --del bacula-sd
1352 %defattr(-,root,root)
1353 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1354 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1355 %{script_dir}/bacula-ctl-fd
1356 /etc/init.d/bacula-fd
1358 /etc/logrotate.d/bacula
1360 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1361 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1362 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1364 %{_sbindir}/bacula-fd
1365 %{_sbindir}/btraceback
1366 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1367 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1368 %{_sbindir}/bconsole
1369 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1370 %{_mandir}/man8/bacula.8.%{manpage_ext}
1371 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1372 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1373 %{_mandir}/man1/bat.1.%{manpage_ext}
1374 %_prefix/share/doc/*
1377 # create the daemon group and user
1378 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1379 if [ -z "$HAVE_BACULA" ]; then
1380 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1381 echo "The group %{daemon_group} has been added to %{group_file}."
1382 echo "See the manual chapter \"Running Bacula\" for details."
1384 # we do not use the -g option allowing the primary group to be set to system default
1385 # this will be a unique group on redhat type systems or the group users on some systems
1386 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1387 if [ -z "$HAVE_BACULA" ]; then
1388 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1389 echo "The user %{file_daemon_user} has been added to %{user_file}."
1390 echo "See the manual chapter \"Running Bacula\" for details."
1392 # now we add the supplementary group, this is ok to call even if the user already exists
1393 # we only do this if the user is NOT root
1394 IS_ROOT=%{file_daemon_user}
1395 if [ "$IS_ROOT" != "root" ]; then
1396 %{usermod} -G %{daemon_group} %{file_daemon_user}
1401 if [ "$1" -ge 1 ] ; then
1402 /sbin/chkconfig --add bacula-fd
1405 if [ -d %{sysconf_dir} ]; then
1407 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
1408 pass=`openssl rand -base64 33`
1409 for file in *.conf; do
1410 sed "s@${string}@${pass}@g" $file > $file.new
1411 cp -f $file.new $file; rm -f $file.new
1414 # put actual hostname in conf file
1416 string="XXX_HOSTNAME_XXX"
1417 for file in *.conf; do
1418 sed "s@${string}@${host}@g" $file >$file.new
1419 cp -f $file.new $file; rm -f $file.new
1426 /sbin/chkconfig --del bacula-fd
1430 %defattr(-,root,root)
1433 %{_libdir}/libbaccfg*
1434 %{_libdir}/libbacfind*
1435 %{_libdir}/libbacpy*
1445 %if ! %{client_only}
1447 %defattr(-,root,%{daemon_group})
1448 %{script_dir}/updatedb/*
1449 #oensuse_bs: directories not owned by any package
1450 #%{script_dir}/updatedb
1453 # create the daemon group
1454 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1455 if [ -z "$HAVE_BACULA" ]; then
1456 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1457 echo "The group %{daemon_group} has been added to %{group_file}."
1458 echo "See the manual chapter \"Running Bacula\" for details."
1462 echo "The database update scripts were installed to %{script_dir}/updatedb"
1466 * Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1467 * Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
1469 - change license to AGPL v3
1470 - add defines for postgresql version and packages, require version 8 or greater
1471 - adjusted package description
1472 - fix bug with libbacsql files
1473 * Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1474 - remove --without-qwt from configure statement
1475 * Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1476 - move shared libraries into bacula-libs package
1477 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1478 - remove deprecated mysql4 and mysql5 build defines
1479 - add build support for tcpwrappers
1480 - remove bacula_config file for client only build
1481 - remove requirements for database server packages
1482 - enable readline support
1484 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1486 - fix client only build
1487 - clean up requirements for termcap
1488 - query.sql now empty by default so we install sample-query.sql along side it
1489 - remove old nobuild_mtx switch
1490 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1491 - fix mysql database upgrade
1492 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1493 - fix permissions of dbcheck
1495 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1497 - add su112 and fc10 builds, remove doc package declaration.
1498 - fix source path for logwatch files.
1499 - restore static bundled build of sqlite (who took that out?) and remove use
1500 - of system sqlite. we don't support use of sqlite2.
1501 - upgrade database from version 11 to 12.
1502 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1503 - changes to work with opensuse build service
1504 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1505 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1506 - removed build of rescue, gnome console and wxconsole
1507 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - Fix bat install which is now handled by make and uses shared libs
1509 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1510 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1511 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1512 - Fix post ldconfig problem in client only build
1513 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1514 - remove more files installed by client-only build not needed by client package
1515 - remove libbacsql files from client package
1516 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1518 - update for new docs configuration
1519 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1520 - add switch to pass Distribution tag
1521 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1523 - database update version 10 to 11
1524 - make now installs docs so we rm from buildroot
1525 - add shared libs in %_libdir and other misc new files
1526 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1528 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1529 - set paths for QT using pkgconfig
1530 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1531 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1532 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - adjust /opt/bacula install
1534 - add build switch to supress rescue package
1535 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1536 - add support for install to /opt/bacula
1537 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1538 - remove libtermcap dependancy for FC9
1539 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1540 - fix bat dependencies
1541 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1545 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - FHS compatibility changes
1547 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - remove fix for false buffer overflow detection with glibc >= 2.7
1549 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1550 - fix for false buffer overflow detection with glibc >= 2.7