3 # Copyright (C) 2000-2011 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
92 #SCIENTIFIC LINUX 3 %if 0%{?sl_version} == 3
93 #SCIENTIFIC LINUX 4 %if 0%{?sl_version} == 4
94 #SCIENTIFIC LINUX 5 %if 0%{?sl_version} == 5
99 # am I running in opensuse build service?
100 # TODO: seems to make problems
102 # Build Service: Determine Distribution
105 %define build_x86_64 1
109 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
110 BuildRequires: GConf2-devel
111 BuildRequires: freetype-devel
112 BuildRequires: libtermcap-devel
113 BuildRequires: shadow-utils
117 %if 0%{?mandriva_version} == 2007
119 %define _dist "Mandriva 2007"
122 %if 0%{?fedora_version} == 8
124 %define _dist "Fedora Core 8"
125 BuildRequires: redhat-release
128 %if 0%{?fedora_version} == 9
130 %define _dist "Fedora Core 9"
131 BuildRequires: redhat-release
135 %if 0%{?fedora_version} == 10
137 %define _dist "Fedora Core 10"
138 BuildRequires: PolicyKit-gnome
139 BuildRequires: fedora-release
142 %if 0%{?fedora_version} == 11
144 %define _dist "Fedora Core 11"
145 BuildRequires: PolicyKit-gnome
146 BuildRequires: fedora-release
149 %if 0%{?rhel_version} == 501
150 %define build_rhel5 1
151 %define _dist "Red Hat Enterprise Linux Server release 5"
152 BuildRequires: redhat-release
155 %if 0%{?rhel_version} == 406
156 %define build_rhel4 1
157 %define _dist "Red Hat Enterprise Linux Server release 4"
158 BuildRequires: redhat-release
162 %if 0%{?centos_version} == 501
163 %define build_centos5 1
164 %define _dist "CentOS 5"
165 BuildRequires: redhat-release
169 %if 0%{?suse_version} == 1020
170 %define build_su102 1
171 %define _dist "OpenSUSE 10.2"
172 BuildRequires: suse-release
176 %if 0%{?suse_version} == 1030
177 %define build_su103 1
178 %define _dist "OpenSUSE 10.3"
179 BuildRequires: suse-release
182 %if 0%{?suse_version} == 1100
183 %define build_su110 1
184 %define _dist "SUSE 11"
185 BuildRequires: suse-release
189 %if 0%{?suse_version} == 1110
190 %define build_su111 1
191 %define _dist "SUSE 11"
194 %if 0%{?suse_version} == 1120
195 %define build_su112 1
196 %define _dist "SUSE 11"
200 %if 0%{?sles_version} == 9
202 %define _dist "SLES 9"
206 %if 0%{?sles_version} == 10
208 %define _dist "SLE 10"
212 %if 0%{?sles_version} == 11
213 %define build_su111 1
214 %define _dist "SLES 11"
217 +%if 0%{?sl_version} == 3
219 +%define _dist "Scientific Linux release 3"
220 +BuildRequires: fedora-release
223 +%if 0%{?sl_version} == 4
225 +%define _dist "Scientific Linux release 4"
226 +BuildRequires: fedora-release
229 +%if 0%{?sl_version} == 5
231 +%define _dist "Scientific Linux release 5"
232 +BuildRequires: fedora-release
240 # any patches for this release
241 # be sure to check the setup section for patch macros
243 #--------------------------------------------------------------------------
244 # it should not be necessary to change anything below here for a release
245 # except for patch macros in the setup section
246 #--------------------------------------------------------------------------
248 %{?contrib_packager:%define _packager %{contrib_packager}}
250 Summary: Bacula - The Network Backup Solution
254 Group: System Environment/Daemons
256 BuildRoot: %{_tmppath}/%{name}-root
257 URL: http://www.bacula.org/
258 Vendor: The Bacula Team
259 Packager: %{_packager}
262 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
263 # opensuse build service changes the release itself
264 # what happens if the release is not 1? DSB
266 Source1: Release_Notes-%{version}-1.tar.gz
268 Source1: Release_Notes-%{version}-%{release}.tar.gz
270 Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
272 # define the basic package description
273 %define blurb Bacula - The Leading Open Source Backup Solution.
274 %define blurb2 Bacula is a set of computer programs that permit you (or the system
275 %define blurb3 administrator) to manage backup, recovery, and verification of computer
276 %define blurb4 data across a network of computers of different kinds. In technical terms,
277 %define blurb5 it is a network client/server based backup program. Bacula is relatively
278 %define blurb6 easy to use and efficient, while offering many advanced storage management
279 %define blurb7 features that make it easy to find and recover lost or damaged files.
280 %define blurb8 Bacula source code has been released under the AGPL version 3 license.
282 %define user_file /etc/passwd
283 %define group_file /etc/group
286 %define useradd /usr/sbin/useradd
287 %define groupadd /usr/sbin/groupadd
288 %define usermod /usr/sbin/usermod
290 # platform defines - set one below or define the build_xxx on the command line
293 %{?build_rh7:%define rh7 1}
295 %{?build_rh8:%define rh8 1}
297 %{?build_rh9:%define rh9 1}
300 %{?build_fc1:%define fc1 1}
302 %{?build_fc3:%define fc3 1}
304 %{?build_fc4:%define fc4 1}
306 %{?build_fc5:%define fc5 1}
308 %{?build_fc6:%define fc6 1}
310 %{?build_fc7:%define fc7 1}
312 %{?build_fc8:%define fc8 1}
314 %{?build_fc9:%define fc9 1}
316 %{?build_fc10:%define fc10 1}
318 %{?build_fc11:%define fc11 1}
320 %{?build_fc12:%define fc12 1}
321 # Whitebox Enterprise build
323 %{?build_wb3:%define wb3 1}
324 # RedHat Enterprise builds
326 %{?build_rhel3:%define rhel3 1}
327 %{?build_rhel3:%define wb3 1}
329 %{?build_rhel4:%define rhel4 1}
330 %{?build_rhel4:%define fc3 1}
332 %{?build_rhel5:%define rhel5 1}
333 %{?build_rhel5:%define fc6 1}
336 %{?build_centos3:%define centos3 1}
337 %{?build_centos3:%define wb3 1}
339 %{?build_centos4:%define centos4 1}
340 %{?build_centos4:%define fc3 1}
342 %{?build_centos5:%define centos5 1}
343 %{?build_centos5:%define fc6 1}
346 %{?build_sl3:%define sl3 1}
347 %{?build_sl3:%define wb3 1}
349 %{?build_sl4:%define sl4 1}
350 %{?build_sl4:%define fc3 1}
352 %{?build_sl5:%define sl5 1}
353 %{?build_sl5:%define fc6 1}
356 %{?build_su9:%define su9 1}
358 %{?build_su10:%define su10 1}
360 %{?build_su102:%define su102 1}
362 %{?build_su103:%define su103 1}
364 %{?build_su110:%define su110 1}
366 %{?build_su111:%define su111 1}
368 %{?build_su112:%define su112 1}
371 %{?build_mdk:%define mdk 1}
373 %{?build_mdv:%define mdv 1}
374 %{?build_mdv:%define mdk 1}
377 %define client_only 0
378 %{?build_client_only:%define client_only 1}
380 # Setup some short cuts
382 %if %{rh7} || %{rh8} || %{rh9}
386 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
390 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
394 %if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
398 %if %{sl3} || %{sl4} || %{sl5}
403 # test for a platform definition
404 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
405 %{error: You must specify a platform. Please examine the spec file.}
409 # distribution-specific directory for logwatch
410 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
411 %define logwatch_dir /etc/log.d
413 %define logwatch_dir /etc/logwatch
417 # set for database support desired or define the build_xxx on the command line
419 %{?build_mysql:%define mysql 1}
421 %{?build_sqlite:%define sqlite 1}
423 %{?build_postgresql:%define postgresql 1}
425 # test for a database definition
426 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
427 %{error: You must specify database support, by passing one of the following to rpmbuild:}
428 %{error: --define build_postgresql=1}
429 %{error: --define build_sqlite=1}
430 %{error: --define build_mysql=1}
435 %define db_backend mysql
438 %define db_backend sqlite3
441 %define db_backend postgresql
446 %{?build_x86_64:%define x86_64 1}
448 # check what distribution we are
449 %if %{rhat} || %{rhel}
450 %define _dist %(grep Red /etc/redhat-release)
452 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
453 %define _dist %(grep Fedora /etc/redhat-release)
455 %if %{centos5} || %{centos4} || %{centos3}
456 %define _dist %(grep CentOS /etc/redhat-release)
458 %if %{sl5} ||%{sl4} || %{sl3}
459 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
461 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
462 %define _dist %(grep White /etc/whitebox-release)
465 %define _dist %(grep -i SuSE /etc/SuSE-release)
468 %define _dist %(grep Mand /etc/mandrake-release)
470 %{?DISTNAME:%define _dist %{DISTNAME}}
472 # only set Disribution if not in opensuse build service, as it sets it itself
473 %if ! 0%{?opensuse_bs}
474 Distribution: %{_dist}
477 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
478 # needed in opensuse_bs, as rpm is installed during build process
479 BuildRequires: libmysqlclient-devel
480 BuildRequires: mysql-client
483 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
484 BuildRequires: %{postgres_package}
485 BuildRequires: %{postgres_server_package}
487 BuildRequires: openssl
489 %if 0%{?opensuse_bs} && %{suse}
490 BuildRequires: pwdutils
491 BuildRequires: sysconfig
494 # should we turn on python support
496 %{?build_python:%define python 1}
498 # should we enable tcp wrappers support
499 %define tcpwrappers 0
500 %{?build_tcpwrappers:%define tcpwrappers 1}
502 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
504 %define manpage_ext bz2
506 %define manpage_ext gz
509 # for client only build
516 BuildRequires: gcc, gcc-c++, make, autoconf
517 BuildRequires: glibc, glibc-devel
518 BuildRequires: ncurses-devel, perl, readline-devel
519 BuildRequires: libstdc++-devel, zlib-devel
520 BuildRequires: openssl-devel
521 BuildRequires: libacl-devel
522 BuildRequires: pkgconfig
524 BuildRequires: libxml2-devel
527 BuildRequires: python, python-devel
528 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
532 BuildRequires: libxml-devel
535 BuildRequires: libstdc++-static-devel
536 BuildRequires: glibc-static-devel
540 BuildRequires: termcap
542 BuildRequires: libtermcap-devel
546 BuildRequires: sqlite-devel
550 BuildRequires: mysql-devel
553 %if %{postgresql} && %{wb3}
554 BuildRequires: rh-postgresql-devel >= %{postgres_version}
557 %if %{postgresql} && ! %{wb3}
558 BuildRequires: %{postgres_devel_package} >= %{postgres_version}
582 Summary: Bacula - The Network Backup Solution
583 Group: System Environment/Daemons
584 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
585 Conflicts: bacula-client
587 Requires: ncurses, libstdc++, zlib, openssl
588 Requires: glibc, readline, %{name}-libs
601 %if %{postgresql} && %{wb3}
602 Requires: rh-postgresql >= 7
604 %if %{postgresql} && ! %{wb3}
605 Requires: postgresql >= 7
615 %description postgresql
619 Requires: python >= %{pyver}
633 This build requires MySQL to be installed separately as the catalog database.
636 This build requires PostgreSQL to be installed separately as the catalog database.
639 This build incorporates sqlite3 as the catalog database, statically compiled.
642 This build includes python scripting support.
645 This build includes tcp-wrappers support.
649 Summary: Bacula - The Network Backup Solution
650 Group: System Environment/Daemons
652 Conflicts: bacula-mysql
653 Conflicts: bacula-sqlite
654 Conflicts: bacula-postgresql
660 Requires: libstdc++, zlib, openssl
661 Requires: glibc, readline, %{name}-libs
670 Requires: python >= %{pyver}
684 This is the File daemon (Client) only package. It includes the command line
687 This build includes python scripting support.
690 This build includes tcp-wrappers support.
696 Summary: Bacula - The Network Backup Solution
697 Group: System Environment/Daemons
699 %description updatedb
710 This package installs scripts for updating older versions of the bacula
716 Summary: Bacula - The Network Backup Solution
717 Group: System Environment/Daemons
730 This package installs the shared libraries used by many bacula programs.
732 # Must explicitly enable debug pkg on SuSE
733 # but not in opensuse_bs
734 %if %{suse} && ! 0%{?opensuse_bs}
746 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
758 # patches for the bundled sqlite scripts
760 # patch the make_sqlite_tables script for installation bindir
761 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
763 # patch the create_sqlite_database script for installation bindir
764 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
766 # patch the make_catalog_backup script for installation bindir
767 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
769 # patch the update_sqlite_tables script for installation bindir
770 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
772 # patch the bacula-dir init script to remove sqlite service
773 %if %{sqlite} && %{suse}
774 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
778 # 64 bit lib location hacks
779 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
780 # reported to be fixed to properly detect lib locations.
782 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
784 %if %{mysql} && %{x86_64}
785 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
787 %if %{python} && %{x86_64}
788 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
791 # Main Bacula configuration
793 --prefix=%{_prefix} \
794 --sbindir=%{_sbindir} \
795 --sysconfdir=%{sysconf_dir} \
796 --mandir=%{_mandir} \
797 --with-scriptdir=%{script_dir} \
798 --with-working-dir=%{working_dir} \
799 --with-plugindir=%{script_dir} \
800 --with-pid-dir=%{pid_dir} \
801 --with-subsys-dir=%{_subsysdir} \
802 --enable-smartalloc \
804 --disable-bwx-console \
805 --disable-tray-monitor \
812 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
822 --with-tcp-wrappers \
825 --enable-client-only \
827 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
828 --disable-batch-insert \
830 --with-dir-user=%{director_daemon_user} \
831 --with-dir-group=%{daemon_group} \
832 --with-sd-user=%{storage_daemon_user} \
833 --with-sd-group=%{storage_daemon_group} \
834 --with-fd-user=%{file_daemon_user} \
835 --with-fd-group=%{daemon_group} \
836 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
837 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
838 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
839 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
840 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
841 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
849 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
850 mkdir -p $RPM_BUILD_ROOT/etc/init.d
851 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
852 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
853 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
854 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
855 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
856 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
858 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
859 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
862 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
865 make DESTDIR=$RPM_BUILD_ROOT install
868 # Program docs not installed on client
869 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
870 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
871 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
872 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
873 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
874 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
875 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
876 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
877 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
879 # Docs for programs that are depreciated
880 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
881 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
882 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
883 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
885 # fixme - make installs the mysql scripts for sqlite build
887 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
888 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
889 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
892 # fixme - make installs the mysql scripts for postgresql build
894 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
895 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
898 # install the init scripts
900 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
901 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
902 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
905 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
906 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
907 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
909 %if ! %{suse} && ! %{mdk}
910 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
911 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
912 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
914 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
916 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
917 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
922 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
923 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
924 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
928 # install the logrotate file
929 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
931 # install the updatedb scripts
932 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
934 # install the sample-query.sql file
936 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
939 # install the logwatch scripts
941 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
942 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
943 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
944 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
945 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
946 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
947 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
948 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
951 # now clean up permissions that are left broken by the install
952 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
954 # fix me - building enable-client-only installs files not included in bacula-client package
956 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
957 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
958 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
959 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
960 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
961 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
962 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
963 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
964 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
965 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
966 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
967 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
968 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
969 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
973 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
975 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
977 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
982 # MySQL specific files
984 %defattr(-, root, root)
985 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
986 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
987 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
988 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
989 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
990 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
991 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
992 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
993 %{_libdir}/libbacsql*
998 %defattr(-,root,root)
999 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
1000 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
1001 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
1002 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
1003 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
1004 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
1005 %{sqlite_bindir}/libsqlite3.a
1006 %{sqlite_bindir}/sqlite3.h
1007 %{sqlite_bindir}/sqlite3
1014 %defattr(-,root,root)
1015 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
1016 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
1017 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
1018 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
1019 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
1020 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
1021 %{_libdir}/libbacsql*
1024 # The rest is DB backend independent
1026 %if ! %{client_only}
1027 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1028 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1029 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1030 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
1031 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1032 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1033 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1034 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1035 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1036 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1037 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1038 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1039 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
1040 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1041 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1042 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1043 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
1044 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1045 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1046 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1047 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1048 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
1049 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1050 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1051 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
1052 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1053 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1054 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1055 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
1057 /etc/logrotate.d/bacula
1058 %{logwatch_dir}/scripts/services/bacula
1059 %{logwatch_dir}/scripts/shared/applybaculadate
1060 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1061 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1062 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1063 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1064 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1065 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1066 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1067 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
1069 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1071 %{_sbindir}/bacula-dir
1072 %{_sbindir}/bacula-fd
1073 %{_sbindir}/bacula-sd
1076 %{_sbindir}/bextract
1080 %{_sbindir}/btraceback
1081 %{_sbindir}/bconsole
1085 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1086 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1087 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1088 %{_mandir}/man8/bacula.8.%{manpage_ext}
1089 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1090 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1091 %{_mandir}/man8/bextract.8.%{manpage_ext}
1092 %{_mandir}/man8/bls.8.%{manpage_ext}
1093 %{_mandir}/man8/bscan.8.%{manpage_ext}
1094 %{_mandir}/man8/btape.8.%{manpage_ext}
1095 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1096 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1097 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1098 %{_mandir}/man1/bat.1.%{manpage_ext}
1099 %_prefix/share/doc/*
1101 # opensuse build service changes the release itself
1102 %if 0%{?opensuse_bs}
1103 %doc ../Release_Notes-%{version}-1.txt
1105 %doc ../Release_Notes-%{version}-%{release}.txt
1111 # test for bacula database older than version 13
1112 # note: this ASSUMES no password has been set for bacula database
1113 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1118 # are we upgrading from sqlite to sqlite3?
1119 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1120 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1121 echo "Your catalog database file is not compatible with sqlite3, thus"
1122 echo "you will need to dump the data, delete the old file, and re-run"
1123 echo "this rpm upgrade."
1125 echo "Backing up your current database..."
1126 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1127 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1128 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1129 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1131 echo "Please re-run this rpm package upgrade."
1132 echo "After the upgrade is complete, restore your catalog"
1133 echo "with the following commands:"
1134 echo "%{script_dir}/drop_sqlite3_tables"
1135 echo "cd %{working_dir}"
1136 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1137 echo "chown bacula.bacula bacula.db"
1140 # test for bacula database older than version 12 and sqlite3
1141 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1142 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1147 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1150 %if ! %{client_only}
1151 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
1152 echo "This bacula upgrade will update a bacula database from version 12 to 13."
1153 echo "You appear to be running database version $DB_VER. You must first update"
1154 echo "your database to version 12 and then install this upgrade. The alternative"
1155 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1156 echo "catalog information, then do the upgrade. Information on updating a"
1157 echo "database older than version 12 can be found in the release notes."
1166 %if ! %{client_only}
1167 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1168 if [ -s %{sysconf_dir}/console.conf ];then
1169 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1172 # create the daemon users and groups
1173 # first create the groups if they don't exist
1174 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1175 if [ -z "$HAVE_BACULA" ]; then
1176 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1177 echo "The group %{daemon_group} has been added to %{group_file}."
1178 echo "See the manual chapter \"Running Bacula\" for details."
1180 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1181 if [ -z "$HAVE_BACULA" ]; then
1182 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1183 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1184 echo "See the manual chapter \"Running Bacula\" for details."
1186 # now create the users if they do not exist
1187 # we do not use the -g option allowing the primary group to be set to system default
1188 # this will be a unique group on redhat type systems or the group users on some systems
1189 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1190 if [ -z "$HAVE_BACULA" ]; then
1191 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1192 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1193 echo "See the manual chapter \"Running Bacula\" for details."
1195 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1196 if [ -z "$HAVE_BACULA" ]; then
1197 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1198 echo "The user %{director_daemon_user} has been added to %{user_file}."
1199 echo "See the manual chapter \"Running Bacula\" for details."
1201 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1202 if [ -z "$HAVE_BACULA" ]; then
1203 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1204 echo "The user %{file_daemon_user} has been added to %{user_file}."
1205 echo "See the manual chapter \"Running Bacula\" for details."
1207 # now we add the supplementary groups, this is ok to call even if the users already exist
1208 # we only do this if the user is NOT root
1209 IS_ROOT=%{director_daemon_user}
1210 if [ "$IS_ROOT" != "root" ]; then
1211 %{usermod} -G %{daemon_group} %{director_daemon_user}
1213 IS_ROOT=%{storage_daemon_user}
1214 if [ "$IS_ROOT" != "root" ]; then
1215 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1217 IS_ROOT=%{file_daemon_user}
1218 if [ "$IS_ROOT" != "root" ]; then
1219 %{usermod} -G %{daemon_group} %{file_daemon_user}
1232 %if ! %{client_only}
1234 if [ "$1" -ge 1 ] ; then
1235 %if %{suse} && %{mysql}
1236 /sbin/chkconfig --add mysql
1238 %if %{suse} && %{postgresql}
1239 /sbin/chkconfig --add postgresql
1241 /sbin/chkconfig --add bacula-dir
1242 /sbin/chkconfig --add bacula-fd
1243 /sbin/chkconfig --add bacula-sd
1249 #check, if mysql can be called successfully at all
1250 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1252 # test for an existing database
1253 # note: this ASSUMES no password has been set for bacula database
1254 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1256 # grant privileges and create tables if they do not exist
1257 if [ -z "$DB_VER" ]; then
1258 echo "Hmm, it doesn't look like you have an existing database."
1259 echo "Granting privileges for MySQL user bacula..."
1260 %{script_dir}/grant_mysql_privileges
1261 echo "Creating MySQL bacula database..."
1262 %{script_dir}/create_mysql_database
1263 echo "Creating bacula tables..."
1264 %{script_dir}/make_mysql_tables
1266 # check to see if we need to upgrade a 3.x database
1267 elif [ "$DB_VER" -lt "13" ]; then
1268 echo "This release requires an upgrade to your bacula database."
1269 echo "Backing up your current database..."
1270 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1271 echo "Upgrading bacula database ..."
1272 %{script_dir}/update_mysql_tables
1273 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1280 # test for an existing database
1281 if [ -s %{working_dir}/bacula.db ]; then
1282 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1283 # check to see if we need to upgrade a 3.x database
1284 if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
1285 echo "This release requires an upgrade to your bacula database."
1286 echo "Backing up your current database..."
1287 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1288 echo "Upgrading bacula database ..."
1289 %{script_dir}/update_sqlite3_tables
1290 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1293 # create the database and tables
1294 echo "Hmm, doesn't look like you have an existing database."
1295 echo "Creating SQLite database..."
1296 %{script_dir}/create_sqlite3_database
1297 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1298 echo "Creating the SQLite tables..."
1299 %{script_dir}/make_sqlite3_tables
1304 # check if psql can be called successfully at all
1305 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1307 # test for an existing database
1308 # note: this ASSUMES no password has been set for bacula database
1309 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1311 # grant privileges and create tables if they do not exist
1312 if [ -z "$DB_VER" ]; then
1313 echo "Hmm, doesn't look like you have an existing database."
1314 echo "Creating PostgreSQL bacula database..."
1315 %{script_dir}/create_postgresql_database
1316 echo "Creating bacula tables..."
1317 %{script_dir}/make_postgresql_tables
1318 echo "Granting privileges for PostgreSQL user bacula..."
1319 %{script_dir}/grant_postgresql_privileges
1321 # check to see if we need to upgrade a 5.0.x database
1322 elif [ "$DB_VER" -lt "13" ]; then
1323 echo "This release requires an upgrade to your bacula database."
1324 echo "Backing up your current database..."
1325 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1326 echo "Upgrading bacula database ..."
1327 %{script_dir}/update_postgresql_tables
1328 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1334 %if ! %{client_only}
1335 if [ -d %{sysconf_dir} ]; then
1337 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
1338 pass=`openssl rand -base64 33`
1339 for file in *.conf; do
1340 sed "s@${string}@${pass}@g" $file > $file.new
1341 cp -f $file.new $file; rm -f $file.new
1344 # put actual hostname in conf file
1346 string="XXX_HOSTNAME_XXX"
1347 for file in *.conf; do
1348 sed "s@${string}@${host}@g" $file >$file.new
1349 cp -f $file.new $file; rm -f $file.new
1365 %if ! %{client_only}
1368 /sbin/chkconfig --del bacula-dir
1369 /sbin/chkconfig --del bacula-fd
1370 /sbin/chkconfig --del bacula-sd
1375 %defattr(-,root,root)
1376 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1377 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1378 %{script_dir}/bacula-ctl-fd
1379 /etc/init.d/bacula-fd
1381 /etc/logrotate.d/bacula
1383 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1384 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1385 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1387 %{_sbindir}/bacula-fd
1388 %{_sbindir}/btraceback
1389 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1390 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1391 %{_sbindir}/bconsole
1392 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1393 %{_mandir}/man8/bacula.8.%{manpage_ext}
1394 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1395 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1396 %{_mandir}/man1/bat.1.%{manpage_ext}
1397 %_prefix/share/doc/*
1400 # create the daemon group and user
1401 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1402 if [ -z "$HAVE_BACULA" ]; then
1403 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1404 echo "The group %{daemon_group} has been added to %{group_file}."
1405 echo "See the manual chapter \"Running Bacula\" for details."
1407 # we do not use the -g option allowing the primary group to be set to system default
1408 # this will be a unique group on redhat type systems or the group users on some systems
1409 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1410 if [ -z "$HAVE_BACULA" ]; then
1411 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1412 echo "The user %{file_daemon_user} has been added to %{user_file}."
1413 echo "See the manual chapter \"Running Bacula\" for details."
1415 # now we add the supplementary group, this is ok to call even if the user already exists
1416 # we only do this if the user is NOT root
1417 IS_ROOT=%{file_daemon_user}
1418 if [ "$IS_ROOT" != "root" ]; then
1419 %{usermod} -G %{daemon_group} %{file_daemon_user}
1424 if [ "$1" -ge 1 ] ; then
1425 /sbin/chkconfig --add bacula-fd
1428 if [ -d %{sysconf_dir} ]; then
1430 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
1431 pass=`openssl rand -base64 33`
1432 for file in *.conf; do
1433 sed "s@${string}@${pass}@g" $file > $file.new
1434 cp -f $file.new $file; rm -f $file.new
1437 # put actual hostname in conf file
1439 string="XXX_HOSTNAME_XXX"
1440 for file in *.conf; do
1441 sed "s@${string}@${host}@g" $file >$file.new
1442 cp -f $file.new $file; rm -f $file.new
1449 /sbin/chkconfig --del bacula-fd
1453 %defattr(-,root,root)
1456 %{_libdir}/libbaccfg*
1457 %{_libdir}/libbacfind*
1458 %{_libdir}/libbacpy*
1468 %if ! %{client_only}
1470 %defattr(-,root,%{daemon_group})
1471 %{script_dir}/updatedb/*
1472 #oensuse_bs: directories not owned by any package
1473 #%{script_dir}/updatedb
1476 # create the daemon group
1477 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1478 if [ -z "$HAVE_BACULA" ]; then
1479 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1480 echo "The group %{daemon_group} has been added to %{group_file}."
1481 echo "See the manual chapter \"Running Bacula\" for details."
1485 echo "The database update scripts were installed to %{script_dir}/updatedb"
1489 * Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1490 * Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
1492 - change license to AGPL v3
1493 - add defines for postgresql version and packages, require version 8 or greater
1494 - adjusted package description
1495 - fix bug with libbacsql files
1496 * Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1497 - remove --without-qwt from configure statement
1498 * Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - move shared libraries into bacula-libs package
1500 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - remove deprecated mysql4 and mysql5 build defines
1502 - add build support for tcpwrappers
1503 - remove bacula_config file for client only build
1504 - remove requirements for database server packages
1505 - enable readline support
1507 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1509 - fix client only build
1510 - clean up requirements for termcap
1511 - query.sql now empty by default so we install sample-query.sql along side it
1512 - remove old nobuild_mtx switch
1513 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1514 - fix mysql database upgrade
1515 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1516 - fix permissions of dbcheck
1518 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1520 - add su112 and fc10 builds, remove doc package declaration.
1521 - fix source path for logwatch files.
1522 - restore static bundled build of sqlite (who took that out?) and remove use
1523 - of system sqlite. we don't support use of sqlite2.
1524 - upgrade database from version 11 to 12.
1525 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1526 - changes to work with opensuse build service
1527 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1528 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1529 - removed build of rescue, gnome console and wxconsole
1530 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1531 - Fix bat install which is now handled by make and uses shared libs
1532 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1533 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1534 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1535 - Fix post ldconfig problem in client only build
1536 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1537 - remove more files installed by client-only build not needed by client package
1538 - remove libbacsql files from client package
1539 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1541 - update for new docs configuration
1542 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - add switch to pass Distribution tag
1544 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - database update version 10 to 11
1547 - make now installs docs so we rm from buildroot
1548 - add shared libs in %_libdir and other misc new files
1549 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1552 - set paths for QT using pkgconfig
1553 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1554 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1555 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1556 - adjust /opt/bacula install
1557 - add build switch to supress rescue package
1558 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1559 - add support for install to /opt/bacula
1560 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1561 - remove libtermcap dependancy for FC9
1562 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1563 - fix bat dependencies
1564 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1566 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1568 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1569 - FHS compatibility changes
1570 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1571 - remove fix for false buffer overflow detection with glibc >= 2.7
1572 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1573 - fix for false buffer overflow detection with glibc >= 2.7