3 # Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
5 # Platform Build Configuration
7 # basic defines for every build
10 %define _packager Kern Sibbald <kern@sibbald.com>
11 %define depkgs_version 15May10
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}
335 %{?build_rhel6:%define rhel6 1}
338 %{?build_centos3:%define centos3 1}
339 %{?build_centos3:%define wb3 1}
341 %{?build_centos4:%define centos4 1}
342 %{?build_centos4:%define fc3 1}
344 %{?build_centos5:%define centos5 1}
345 %{?build_centos5:%define fc6 1}
347 %{?build_centos6:%define centos6 1}
350 %{?build_sl3:%define sl3 1}
351 %{?build_sl3:%define wb3 1}
353 %{?build_sl4:%define sl4 1}
354 %{?build_sl4:%define fc3 1}
356 %{?build_sl5:%define sl5 1}
357 %{?build_sl5:%define fc6 1}
360 %{?build_su9:%define su9 1}
362 %{?build_su10:%define su10 1}
364 %{?build_su102:%define su102 1}
366 %{?build_su103:%define su103 1}
368 %{?build_su110:%define su110 1}
370 %{?build_su111:%define su111 1}
372 %{?build_su112:%define su112 1}
375 %{?build_mdk:%define mdk 1}
377 %{?build_mdv:%define mdv 1}
378 %{?build_mdv:%define mdk 1}
381 %define client_only 0
382 %{?build_client_only:%define client_only 1}
384 # Setup some short cuts
386 %if %{rh7} || %{rh8} || %{rh9}
390 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
394 %if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
398 %if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{centos3} || %{centos4} || %{centos5} || %{centos6}
402 %if %{sl3} || %{sl4} || %{sl5}
407 # test for a platform definition
408 %if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
409 %{error: You must specify a platform. Please examine the spec file.}
413 # distribution-specific directory for logwatch
414 %if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
415 %define logwatch_dir /etc/log.d
417 %define logwatch_dir /etc/logwatch
421 # set for database support desired or define the build_xxx on the command line
423 %{?build_mysql:%define mysql 1}
425 %{?build_sqlite:%define sqlite 1}
427 %{?build_postgresql:%define postgresql 1}
429 # test for a database definition
430 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
431 %{error: You must specify database support, by passing one of the following to rpmbuild:}
432 %{error: --define build_postgresql=1}
433 %{error: --define build_sqlite=1}
434 %{error: --define build_mysql=1}
439 %define db_backend mysql
442 %define db_backend sqlite3
445 %define db_backend postgresql
450 %{?build_x86_64:%define x86_64 1}
452 # check what distribution we are
453 %if %{rhat} || %{rhel}
454 %define _dist %(grep Red /etc/redhat-release)
456 %if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
457 %define _dist %(grep Fedora /etc/redhat-release)
459 %if %{centos5} || %{centos4} || %{centos3}
460 %define _dist %(grep CentOS /etc/redhat-release)
462 %if %{sl5} ||%{sl4} || %{sl3}
463 %define _dist %(grep 'Scientific Linux' /etc/redhat-release)
465 %if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
466 %define _dist %(grep White /etc/whitebox-release)
469 %define _dist %(grep -i SuSE /etc/SuSE-release)
472 %define _dist %(grep Mand /etc/mandrake-release)
474 %{?DISTNAME:%define _dist %{DISTNAME}}
476 # only set Disribution if not in opensuse build service, as it sets it itself
477 %if ! 0%{?opensuse_bs}
478 Distribution: %{_dist}
481 %if 0%{?opensuse_bs} && %{mysql} && %{suse}
482 # needed in opensuse_bs, as rpm is installed during build process
483 BuildRequires: libmysqlclient-devel
484 BuildRequires: mysql-client
487 %if 0%{?opensuse_bs} && %{suse} && %{postgresql}
488 BuildRequires: %{postgres_package}
489 BuildRequires: %{postgres_server_package}
491 BuildRequires: openssl
493 %if 0%{?opensuse_bs} && %{suse}
494 BuildRequires: pwdutils
495 BuildRequires: sysconfig
498 # should we turn on python support
500 %{?build_python:%define python 1}
502 # should we enable tcp wrappers support
503 %define tcpwrappers 0
504 %{?build_tcpwrappers:%define tcpwrappers 1}
506 # Mandriva somehow forces the manpage file extension to bz2 rather than gz
508 %define manpage_ext bz2
510 %define manpage_ext gz
513 # for client only build
520 BuildRequires: gcc, gcc-c++, make, autoconf
521 BuildRequires: glibc, glibc-devel
522 BuildRequires: ncurses-devel, perl, readline-devel
523 BuildRequires: libstdc++-devel, zlib-devel
524 BuildRequires: openssl-devel
525 BuildRequires: libacl-devel
526 BuildRequires: pkgconfig
528 BuildRequires: libxml2-devel
531 BuildRequires: python, python-devel
532 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
536 BuildRequires: libxml-devel
539 BuildRequires: libstdc++-static-devel
540 BuildRequires: glibc-static-devel
544 BuildRequires: termcap
546 BuildRequires: libtermcap-devel
550 BuildRequires: sqlite-devel
554 BuildRequires: mysql-devel
557 %if %{postgresql} && %{wb3}
558 BuildRequires: rh-postgresql-devel >= %{postgres_version}
561 %if %{postgresql} && ! %{wb3}
562 BuildRequires: %{postgres_devel_package} >= %{postgres_version}
586 Summary: Bacula - The Network Backup Solution
587 Group: System Environment/Daemons
588 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
589 Conflicts: bacula-client
591 Requires: ncurses, libstdc++, zlib, openssl
592 Requires: glibc, readline, %{name}-libs
599 Requires: compat-libtermcap
609 %if %{postgresql} && %{wb3}
610 Requires: rh-postgresql >= 7
612 %if %{postgresql} && ! %{wb3}
613 Requires: postgresql >= 7
623 %description postgresql
627 Requires: python >= %{pyver}
641 This build requires MySQL to be installed separately as the catalog database.
644 This build requires PostgreSQL to be installed separately as the catalog database.
647 This build incorporates sqlite3 as the catalog database, statically compiled.
650 This build includes python scripting support.
653 This build includes tcp-wrappers support.
657 Summary: Bacula - The Network Backup Solution
658 Group: System Environment/Daemons
660 Conflicts: bacula-mysql
661 Conflicts: bacula-sqlite
662 Conflicts: bacula-postgresql
668 Requires: libstdc++, zlib, openssl
669 Requires: glibc, readline, %{name}-libs
678 Requires: python >= %{pyver}
692 This is the File daemon (Client) only package. It includes the command line
695 This build includes python scripting support.
698 This build includes tcp-wrappers support.
704 Summary: Bacula - The Network Backup Solution
705 Group: System Environment/Daemons
707 %description updatedb
718 This package installs scripts for updating older versions of the bacula
724 Summary: Bacula - The Network Backup Solution
725 Group: System Environment/Daemons
738 This package installs the shared libraries used by many bacula programs.
740 # Must explicitly enable debug pkg on SuSE
741 # but not in opensuse_bs
742 %if %{suse} && ! 0%{?opensuse_bs}
754 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
766 # patches for the bundled sqlite scripts
768 # patch the make_sqlite_tables script for installation bindir
769 patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
771 # patch the create_sqlite_database script for installation bindir
772 patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
774 # patch the make_catalog_backup script for installation bindir
775 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
777 # patch the update_sqlite_tables script for installation bindir
778 patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
780 # patch the bacula-dir init script to remove sqlite service
781 %if %{sqlite} && %{suse}
782 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
786 # 64 bit lib location hacks
787 # as of 1.39.18 it should not be necessary to enable x86_64 as configure is
788 # reported to be fixed to properly detect lib locations.
790 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
792 %if %{mysql} && %{x86_64}
793 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
795 %if %{python} && %{x86_64}
796 export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
799 # Main Bacula configuration
801 --prefix=%{_prefix} \
802 --sbindir=%{_sbindir} \
803 --sysconfdir=%{sysconf_dir} \
804 --mandir=%{_mandir} \
805 --with-scriptdir=%{script_dir} \
806 --with-working-dir=%{working_dir} \
807 --with-plugindir=%{script_dir} \
808 --with-pid-dir=%{pid_dir} \
809 --with-subsys-dir=%{_subsysdir} \
810 --enable-smartalloc \
812 --disable-bwx-console \
813 --disable-tray-monitor \
820 --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
830 --with-tcp-wrappers \
833 --enable-client-only \
835 %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
836 --disable-batch-insert \
838 --with-dir-user=%{director_daemon_user} \
839 --with-dir-group=%{daemon_group} \
840 --with-sd-user=%{storage_daemon_user} \
841 --with-sd-group=%{storage_daemon_group} \
842 --with-fd-user=%{file_daemon_user} \
843 --with-fd-group=%{daemon_group} \
844 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
845 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
846 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
847 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
848 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
849 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
857 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
858 mkdir -p $RPM_BUILD_ROOT/etc/init.d
859 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
860 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
861 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
862 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
863 mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
864 mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
866 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
867 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
870 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
873 make DESTDIR=$RPM_BUILD_ROOT install
876 # Program docs not installed on client
877 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
878 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
879 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
880 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
881 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
882 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
883 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
884 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
885 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
887 # Docs for programs that are depreciated
888 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
889 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
890 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
891 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
893 # fixme - make installs the mysql scripts for sqlite build
895 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
896 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
897 rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
900 # fixme - make installs the mysql scripts for postgresql build
902 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
903 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
906 # install the init scripts
908 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
909 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
910 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
913 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
914 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
915 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
917 %if ! %{suse} && ! %{mdk}
918 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
919 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
920 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
922 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
924 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
925 rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
930 cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
931 cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
932 cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
936 # install the logrotate file
937 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
939 # install the updatedb scripts
940 cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
942 # install the sample-query.sql file
944 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
947 # install the logwatch scripts
949 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
950 cp -p scripts/logwatch/applybaculadate $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
951 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
952 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
953 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
954 chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
955 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
956 chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
959 # now clean up permissions that are left broken by the install
960 chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
962 # fix me - building enable-client-only installs files not included in bacula-client package
964 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
965 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
966 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
967 rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
968 rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
969 rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
970 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
971 rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
972 rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
973 rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
974 rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
975 rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
976 rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
977 rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
981 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
983 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
985 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
990 # MySQL specific files
992 %defattr(-, root, root)
993 %attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
994 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
995 %attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
996 %attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
997 %attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
998 %attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
999 %attr(-, root, %{daemon_group}) %{script_dir}/startmysql
1000 %attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
1001 %{_libdir}/libbacsql*
1006 %defattr(-,root,root)
1007 %attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
1008 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
1009 %attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
1010 %attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
1011 %attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
1012 %attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
1013 %{sqlite_bindir}/libsqlite3.a
1014 %{sqlite_bindir}/sqlite3.h
1015 %{sqlite_bindir}/sqlite3
1022 %defattr(-,root,root)
1023 %attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
1024 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
1025 %attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
1026 %attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
1027 %attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
1028 %attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
1029 %{_libdir}/libbacsql*
1032 # The rest is DB backend independent
1034 %if ! %{client_only}
1035 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1036 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1037 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
1038 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
1039 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
1040 %attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
1041 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
1042 %attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
1043 %attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
1044 %attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
1045 %attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
1046 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
1047 %attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
1048 %attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
1049 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1050 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1051 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
1052 %attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
1053 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
1054 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
1055 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
1056 %attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
1057 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1058 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1059 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
1060 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
1061 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1062 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
1063 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
1065 /etc/logrotate.d/bacula
1066 %{logwatch_dir}/scripts/services/bacula
1067 %{logwatch_dir}/scripts/shared/applybaculadate
1068 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
1069 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1070 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-sd.conf
1071 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1072 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
1073 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
1074 %attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
1075 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
1077 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
1079 %{_sbindir}/bacula-dir
1080 %{_sbindir}/bacula-fd
1081 %{_sbindir}/bacula-sd
1084 %{_sbindir}/bextract
1088 %{_sbindir}/btraceback
1089 %{_sbindir}/bconsole
1093 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1094 %{_mandir}/man8/bacula-dir.8.%{manpage_ext}
1095 %{_mandir}/man8/bacula-sd.8.%{manpage_ext}
1096 %{_mandir}/man8/bacula.8.%{manpage_ext}
1097 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1098 %{_mandir}/man8/bcopy.8.%{manpage_ext}
1099 %{_mandir}/man8/bextract.8.%{manpage_ext}
1100 %{_mandir}/man8/bls.8.%{manpage_ext}
1101 %{_mandir}/man8/bscan.8.%{manpage_ext}
1102 %{_mandir}/man8/btape.8.%{manpage_ext}
1103 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1104 %{_mandir}/man8/dbcheck.8.%{manpage_ext}
1105 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
1106 %{_mandir}/man1/bat.1.%{manpage_ext}
1107 %_prefix/share/doc/*
1109 # opensuse build service changes the release itself
1110 %if 0%{?opensuse_bs}
1111 %doc ../Release_Notes-%{version}-1.txt
1113 %doc ../Release_Notes-%{version}-%{release}.txt
1119 # test for bacula database older than version 14
1120 # note: this ASSUMES no password has been set for bacula database
1121 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1126 # are we upgrading from sqlite to sqlite3?
1127 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1128 echo "This version of bacula-sqlite involves an upgrade to sqlite3."
1129 echo "Your catalog database file is not compatible with sqlite3, thus"
1130 echo "you will need to dump the data, delete the old file, and re-run"
1131 echo "this rpm upgrade."
1133 echo "Backing up your current database..."
1134 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql
1135 mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
1136 echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your"
1137 echo "catalog file has been renamed %{working_dir}/bacula.db.old."
1139 echo "Please re-run this rpm package upgrade."
1140 echo "After the upgrade is complete, restore your catalog"
1141 echo "with the following commands:"
1142 echo "%{script_dir}/drop_sqlite3_tables"
1143 echo "cd %{working_dir}"
1144 echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
1145 echo "chown bacula.bacula bacula.db"
1148 # test for bacula database older than version 12 and sqlite3
1149 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
1150 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1155 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1158 %if ! %{client_only}
1159 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
1160 echo "This bacula upgrade will update a bacula database from version 12 to 14."
1161 echo "You appear to be running database version $DB_VER. You must first update"
1162 echo "your database to version 12 and then install this upgrade. The alternative"
1163 echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
1164 echo "catalog information, then do the upgrade. Information on updating a"
1165 echo "database older than version 12 can be found in the release notes."
1174 %if ! %{client_only}
1175 # check for and copy %{sysconf_dir}/console.conf to bconsole.conf
1176 if [ -s %{sysconf_dir}/console.conf ];then
1177 cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
1180 # create the daemon users and groups
1181 # first create the groups if they don't exist
1182 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1183 if [ -z "$HAVE_BACULA" ]; then
1184 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1185 echo "The group %{daemon_group} has been added to %{group_file}."
1186 echo "See the manual chapter \"Running Bacula\" for details."
1188 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1189 if [ -z "$HAVE_BACULA" ]; then
1190 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1191 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1192 echo "See the manual chapter \"Running Bacula\" for details."
1194 # now create the users if they do not exist
1195 # we do not use the -g option allowing the primary group to be set to system default
1196 # this will be a unique group on redhat type systems or the group users on some systems
1197 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1198 if [ -z "$HAVE_BACULA" ]; then
1199 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1200 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1201 echo "See the manual chapter \"Running Bacula\" for details."
1203 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1204 if [ -z "$HAVE_BACULA" ]; then
1205 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1206 echo "The user %{director_daemon_user} has been added to %{user_file}."
1207 echo "See the manual chapter \"Running Bacula\" for details."
1209 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1210 if [ -z "$HAVE_BACULA" ]; then
1211 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1212 echo "The user %{file_daemon_user} has been added to %{user_file}."
1213 echo "See the manual chapter \"Running Bacula\" for details."
1215 # now we add the supplementary groups, this is ok to call even if the users already exist
1216 # we only do this if the user is NOT root
1217 IS_ROOT=%{director_daemon_user}
1218 if [ "$IS_ROOT" != "root" ]; then
1219 %{usermod} -G %{daemon_group} %{director_daemon_user}
1221 IS_ROOT=%{storage_daemon_user}
1222 if [ "$IS_ROOT" != "root" ]; then
1223 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1225 IS_ROOT=%{file_daemon_user}
1226 if [ "$IS_ROOT" != "root" ]; then
1227 %{usermod} -G %{daemon_group} %{file_daemon_user}
1240 %if ! %{client_only}
1242 if [ "$1" -ge 1 ] ; then
1243 %if %{suse} && %{mysql}
1244 /sbin/chkconfig --add mysql
1246 %if %{suse} && %{postgresql}
1247 /sbin/chkconfig --add postgresql
1249 /sbin/chkconfig --add bacula-dir
1250 /sbin/chkconfig --add bacula-fd
1251 /sbin/chkconfig --add bacula-sd
1257 #check, if mysql can be called successfully at all
1258 if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
1260 # test for an existing database
1261 # note: this ASSUMES no password has been set for bacula database
1262 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1264 # grant privileges and create tables if they do not exist
1265 if [ -z "$DB_VER" ]; then
1266 echo "Hmm, it doesn't look like you have an existing database."
1267 echo "Granting privileges for MySQL user bacula..."
1268 %{script_dir}/grant_mysql_privileges
1269 echo "Creating MySQL bacula database..."
1270 %{script_dir}/create_mysql_database
1271 echo "Creating bacula tables..."
1272 %{script_dir}/make_mysql_tables
1274 # check to see if we need to upgrade a 3.x database
1275 elif [ "$DB_VER" -lt "14" ]; then
1276 echo "This release requires an upgrade to your bacula database."
1277 echo "Backing up your current database..."
1278 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1279 echo "Upgrading bacula database ..."
1280 %{script_dir}/update_mysql_tables
1281 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1288 # test for an existing database
1289 if [ -s %{working_dir}/bacula.db ]; then
1290 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1291 # check to see if we need to upgrade a 3.x database
1292 if [ "$DB_VER" -lt "14" ] && [ "$DB_VER" -ge "12" ]; then
1293 echo "This release requires an upgrade to your bacula database."
1294 echo "Backing up your current database..."
1295 echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1296 echo "Upgrading bacula database ..."
1297 %{script_dir}/update_sqlite3_tables
1298 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1301 # create the database and tables
1302 echo "Hmm, doesn't look like you have an existing database."
1303 echo "Creating SQLite database..."
1304 %{script_dir}/create_sqlite3_database
1305 chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
1306 echo "Creating the SQLite tables..."
1307 %{script_dir}/make_sqlite3_tables
1312 # check if psql can be called successfully at all
1313 if echo 'select * from Version;' | psql bacula 2>/dev/null; then
1315 # test for an existing database
1316 # note: this ASSUMES no password has been set for bacula database
1317 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1319 # grant privileges and create tables if they do not exist
1320 if [ -z "$DB_VER" ]; then
1321 echo "Hmm, doesn't look like you have an existing database."
1322 echo "Creating PostgreSQL bacula database..."
1323 %{script_dir}/create_postgresql_database
1324 echo "Creating bacula tables..."
1325 %{script_dir}/make_postgresql_tables
1326 echo "Granting privileges for PostgreSQL user bacula..."
1327 %{script_dir}/grant_postgresql_privileges
1329 # check to see if we need to upgrade a 5.0.x database
1330 elif [ "$DB_VER" -lt "14" ]; then
1331 echo "This release requires an upgrade to your bacula database."
1332 echo "Backing up your current database..."
1333 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1334 echo "Upgrading bacula database ..."
1335 %{script_dir}/update_postgresql_tables
1336 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1342 %if ! %{client_only}
1343 if [ -d %{sysconf_dir} ]; then
1345 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
1346 pass=`openssl rand -base64 33`
1347 for file in *.conf; do
1348 sed "s@${string}@${pass}@g" $file > $file.new
1349 cp -f $file.new $file; rm -f $file.new
1352 # put actual hostname in conf file
1354 string="XXX_HOSTNAME_XXX"
1355 for file in *.conf; do
1356 sed "s@${string}@${host}@g" $file >$file.new
1357 cp -f $file.new $file; rm -f $file.new
1373 %if ! %{client_only}
1376 /sbin/chkconfig --del bacula-dir
1377 /sbin/chkconfig --del bacula-fd
1378 /sbin/chkconfig --del bacula-sd
1383 %defattr(-,root,root)
1384 %attr(-, root, %{daemon_group}) %dir %{script_dir}
1385 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
1386 %{script_dir}/bacula-ctl-fd
1387 /etc/init.d/bacula-fd
1389 /etc/logrotate.d/bacula
1391 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
1392 %attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
1393 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1395 %{_sbindir}/bacula-fd
1396 %{_sbindir}/btraceback
1397 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
1398 %attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
1399 %{_sbindir}/bconsole
1400 %{_mandir}/man8/bacula-fd.8.%{manpage_ext}
1401 %{_mandir}/man8/bacula.8.%{manpage_ext}
1402 %{_mandir}/man8/bconsole.8.%{manpage_ext}
1403 %{_mandir}/man8/btraceback.8.%{manpage_ext}
1404 %{_mandir}/man1/bat.1.%{manpage_ext}
1405 %_prefix/share/doc/*
1408 # create the daemon group and user
1409 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1410 if [ -z "$HAVE_BACULA" ]; then
1411 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1412 echo "The group %{daemon_group} has been added to %{group_file}."
1413 echo "See the manual chapter \"Running Bacula\" for details."
1415 # we do not use the -g option allowing the primary group to be set to system default
1416 # this will be a unique group on redhat type systems or the group users on some systems
1417 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1418 if [ -z "$HAVE_BACULA" ]; then
1419 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1420 echo "The user %{file_daemon_user} has been added to %{user_file}."
1421 echo "See the manual chapter \"Running Bacula\" for details."
1423 # now we add the supplementary group, this is ok to call even if the user already exists
1424 # we only do this if the user is NOT root
1425 IS_ROOT=%{file_daemon_user}
1426 if [ "$IS_ROOT" != "root" ]; then
1427 %{usermod} -G %{daemon_group} %{file_daemon_user}
1432 if [ "$1" -ge 1 ] ; then
1433 /sbin/chkconfig --add bacula-fd
1436 if [ -d %{sysconf_dir} ]; then
1438 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
1439 pass=`openssl rand -base64 33`
1440 for file in *.conf; do
1441 sed "s@${string}@${pass}@g" $file > $file.new
1442 cp -f $file.new $file; rm -f $file.new
1445 # put actual hostname in conf file
1447 string="XXX_HOSTNAME_XXX"
1448 for file in *.conf; do
1449 sed "s@${string}@${host}@g" $file >$file.new
1450 cp -f $file.new $file; rm -f $file.new
1457 /sbin/chkconfig --del bacula-fd
1461 %defattr(-,root,root)
1464 %{_libdir}/libbaccfg*
1465 %{_libdir}/libbacfind*
1466 %{_libdir}/libbacpy*
1476 %if ! %{client_only}
1478 %defattr(-,root,%{daemon_group})
1479 %{script_dir}/updatedb/*
1480 #oensuse_bs: directories not owned by any package
1481 #%{script_dir}/updatedb
1484 # create the daemon group
1485 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1486 if [ -z "$HAVE_BACULA" ]; then
1487 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1488 echo "The group %{daemon_group} has been added to %{group_file}."
1489 echo "See the manual chapter \"Running Bacula\" for details."
1493 echo "The database update scripts were installed to %{script_dir}/updatedb"
1497 * Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1498 * Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
1500 - change license to AGPL v3
1501 - add defines for postgresql version and packages, require version 8 or greater
1502 - adjusted package description
1503 - fix bug with libbacsql files
1504 * Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1505 - remove --without-qwt from configure statement
1506 * Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1507 - move shared libraries into bacula-libs package
1508 * Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1509 - remove deprecated mysql4 and mysql5 build defines
1510 - add build support for tcpwrappers
1511 - remove bacula_config file for client only build
1512 - remove requirements for database server packages
1513 - enable readline support
1515 * Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1517 - fix client only build
1518 - clean up requirements for termcap
1519 - query.sql now empty by default so we install sample-query.sql along side it
1520 - remove old nobuild_mtx switch
1521 * Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1522 - fix mysql database upgrade
1523 * Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1524 - fix permissions of dbcheck
1526 * Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
1528 - add su112 and fc10 builds, remove doc package declaration.
1529 - fix source path for logwatch files.
1530 - restore static bundled build of sqlite (who took that out?) and remove use
1531 - of system sqlite. we don't support use of sqlite2.
1532 - upgrade database from version 11 to 12.
1533 * Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
1534 - changes to work with opensuse build service
1535 * Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
1536 - Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
1537 - removed build of rescue, gnome console and wxconsole
1538 * Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1539 - Fix bat install which is now handled by make and uses shared libs
1540 * Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1541 - fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
1542 * Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - Fix post ldconfig problem in client only build
1544 * Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1545 - remove more files installed by client-only build not needed by client package
1546 - remove libbacsql files from client package
1547 * Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1549 - update for new docs configuration
1550 * Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 - add switch to pass Distribution tag
1552 * Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
1554 - database update version 10 to 11
1555 - make now installs docs so we rm from buildroot
1556 - add shared libs in %_libdir and other misc new files
1557 * Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1559 * Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1560 - set paths for QT using pkgconfig
1561 * Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1562 - release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
1563 * Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1564 - adjust /opt/bacula install
1565 - add build switch to supress rescue package
1566 * Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1567 - add support for install to /opt/bacula
1568 * Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1569 - remove libtermcap dependancy for FC9
1570 * Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1571 - fix bat dependencies
1572 * Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1574 * Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1576 * Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1577 - FHS compatibility changes
1578 * Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1579 - remove fix for false buffer overflow detection with glibc >= 2.7
1580 * Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
1581 - fix for false buffer overflow detection with glibc >= 2.7