+#
# Bacula RPM spec file
#
-# Copyright (C) 2000-2012 Bacula Systems SA
# Platform Build Configuration
# basic defines for every build
-%define _release 1
+%define _release @RELEASE@
%define _version @VERSION@
%define product bacula
-%define _packager Kern Sibbald <kern@baculasystems.com>
-%define depkgs_version 24Dec11
+%define _packager Kern Sibbald <kern@sibbald.com>
+%define depkgs_version @DEPKGS_VERSION@
+
+# Don't strip binaries
+%define __os_install_post %{nil}
+%define __debug_install_post %{nil}
+%define debug_package %{nil}
%define postgres_version 8
%define pgre84 0
%{?build_rhel5:%define pgre84 1}
+%{?build_el5:%define pgre84 1}
%if %{pgre84}
%define postgres_package postgresql84
%define postgres_server_package postgresql84-server
%{?single_dir_install:%define single_dir 1}
# Installation Directory locations
-%if %{single_dir}
%define _prefix /opt/bacula
%define _sbindir /opt/bacula/bin
%define _bindir /opt/bacula/bin
%define _subsysdir /opt/bacula/working
%define sqlite_bindir /opt/bacula/sqlite
%define _mandir /usr/share/man
+%define docs_dir /opt/bacula/docs
+%define archive_dir /opt/bacula/archive
%define sysconf_dir /opt/bacula/etc
%define script_dir /opt/bacula/scripts
%define working_dir /opt/bacula/working
%define pid_dir /opt/bacula/working
%define plugin_dir /opt/bacula/plugins
%define lib_dir /opt/bacula/lib
-%else
-%define _prefix /usr
-%define _sbindir %_prefix/sbin
-%define _bindir %_prefix/bin
-%define _subsysdir /var/lock/subsys
-%define sqlite_bindir %_libdir/bacula/sqlite
-%define _mandir %_prefix/share/man
-%define sysconf_dir /etc/bacula
-%define script_dir %_libdir/bacula
-%define working_dir /var/lib/bacula
-%define pid_dir /var/run
-%define plugin_dir %_libdir/bacula/plugins
-%define lib_dir %_libdir/bacula/lib
-%endif
+%define log_dir /opt/bacula/log
+%define systemd_dir /lib/systemd/system
# Daemon user:group Don't change them unless you know what you are doing
%define director_daemon_user bacula
%define depkgs ../depkgs
-# probems with mandriva build:
+# problems with mandriva build:
# nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
-# set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
-#openSUSE 11.1 %if 0%{?suse_version} == 1110
-#openSUSE 11.0 %if 0%{?suse_version} == 1100
-#openSUSE 10.3 %if 0%{?suse_version} == 1030
-#openSUSE 10.2 %if 0%{?suse_version} == 1020
-#SUSE Linux 10.1 %if 0%{?suse_version} == 1010
-#SUSE Linux 10.0 %if 0%{?suse_version} == 1000
-#SUSE Linux 9.3 %if 0%{?suse_version} == 930
-#SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910
-#SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010
-#SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110
-#CentOS 5 %if 0%{?centos_version} == 501
-#RHEL 4 %if 0%{?rhel_version} == 406
-#RHEL 5 %if 0%{?rhel_version} == 501
-#Fedora 6 with Extras %if 0%{?fedora_version} == 6
-#Fedora 7 with Extras %if 0%{?fedora_version} == 7
-#Fedora 8 with Extras %if 0%{?fedora_version} == 8
-#Fedora 9 with Extras %if 0%{?fedora_version} == 9
-#Fedora 10 with Extras %if 0%{?fedora_version} == 10
-#Mandriva 2006 %if 0%{?mandriva_version} == 2006
-#Mandriva 2007 %if 0%{?mandriva_version} == 2007
-#Mandriva 2008 %if 0%{?mandriva_version} == 2008
-
-
-%if 0%{?opensuse_bs}
-# am I running in opensuse build service?
-# TODO: seems to make problems
-
-# Build Service: Determine Distribution
-
-%ifarch x86_64
- %define build_x86_64 1
-%endif
-
-
-%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
-BuildRequires: GConf2-devel
-BuildRequires: freetype-devel
-BuildRequires: libtermcap-devel
-BuildRequires: shadow-utils
-%endif
-
-
-%if 0%{?mandriva_version} == 2007
-%define build_mdv 1
-%define _dist "Mandriva 2007"
-%endif
-
-%if 0%{?fedora_version} == 8
-%define build_fc8 1
-%define _dist "Fedora Core 8"
-BuildRequires: redhat-release
-%endif
-
-%if 0%{?fedora_version} == 9
-%define build_fc9 1
-%define _dist "Fedora Core 9"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?fedora_version} == 10
-%define build_fc9 1
-%define _dist "Fedora Core 10"
-BuildRequires: PolicyKit-gnome
-BuildRequires: fedora-release
-%endif
-
-%if 0%{?fedora_version} == 11
-%define build_fc9 1
-%define _dist "Fedora Core 11"
-BuildRequires: PolicyKit-gnome
-BuildRequires: fedora-release
-%endif
-
-%if 0%{?rhel_version} == 501
-%define build_rhel5 1
-%define _dist "Red Hat Enterprise Linux Server release 5"
-BuildRequires: redhat-release
-%endif
-
-%if 0%{?rhel_version} == 406
-%define build_rhel4 1
-%define _dist "Red Hat Enterprise Linux Server release 4"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?centos_version} == 501
-%define build_centos5 1
-%define _dist "CentOS 5"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?suse_version} == 1020
-%define build_su102 1
-%define _dist "OpenSUSE 10.2"
-BuildRequires: suse-release
-%endif
-
-
-%if 0%{?suse_version} == 1030
-%define build_su103 1
-%define _dist "OpenSUSE 10.3"
-BuildRequires: suse-release
-%endif
-
-%if 0%{?suse_version} == 1100
-%define build_su110 1
-%define _dist "SUSE 11"
-BuildRequires: suse-release
-%endif
-
-
-%if 0%{?suse_version} == 1110
-%define build_su111 1
-%define _dist "SUSE 11"
-%endif
-
-%if 0%{?suse_version} == 1120
-%define build_su112 1
-%define _dist "SUSE 11"
-%endif
-
-
-%if 0%{?sles_version} == 9
-%define build_su9 1
-%define _dist "SLES 9"
-%endif
-
-
-%if 0%{?sles_version} == 10
-%define build_su10 1
-%define _dist "SLE 10"
-%endif
-
-
-%if 0%{?sles_version} == 11
-%define build_su111 1
-%define _dist "SLES 11"
-%endif
-
-%endif
-# opensuse-bs?
-
-
-# any patches for this release
-# be sure to check the setup section for patch macros
-
#--------------------------------------------------------------------------
# it should not be necessary to change anything below here for a release
# except for patch macros in the setup section
#--------------------------------------------------------------------------
+%define base_package_name %{product}
+
%{?contrib_packager:%define _packager %{contrib_packager}}
Summary: Bacula - The Network Backup Solution
-Name: %{product}
+Name: %{base_package_name}
Version: %{_version}
Release: %{_release}
Group: System Environment/Daemons
Packager: %{_packager}
Prefix: %{_prefix}
-Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
# opensuse build service changes the release itself
# what happens if the release is not 1? DSB
-%if 0%{?opensuse_bs}
-Source1: Release_Notes-%{version}-1.tar.gz
-%else
-Source1: Release_Notes-%{version}-%{release}.tar.gz
-%endif
-Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
+Source0: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
+Source1: http://www.prdownloads.sourceforge.net/bacula/%{product}-%{version}.tar.gz
+Source2: Release_Notes-%{version}-%{release}.tar.gz
# define the basic package description
%define blurb Bacula - The Leading Open Source Backup Solution.
%define rh9 0
%{?build_rh9:%define rh9 1}
# Fedora Core build
-%define fc1 0
-%{?build_fc1:%define fc1 1}
-%define fc3 0
-%{?build_fc3:%define fc3 1}
-%define fc4 0
-%{?build_fc4:%define fc4 1}
-%define fc5 0
-%{?build_fc5:%define fc5 1}
-%define fc6 0
-%{?build_fc6:%define fc6 1}
-%define fc7 0
-%{?build_fc7:%define fc7 1}
-%define fc8 0
-%{?build_fc8:%define fc8 1}
-%define fc9 0
-%{?build_fc9:%define fc9 1}
-%define fc10 0
-%{?build_fc10:%define fc10 1}
-%define fc11 0
-%{?build_fc11:%define fc11 1}
-%define fc12 0
-%{?build_fc12:%define fc12 1}
-# Whitebox Enterprise build
-%define wb3 0
-%{?build_wb3:%define wb3 1}
+%define fc16 0
+%{?build_fc16:%define fc16 1}
+%define fc17 0
+%{?build_fc17:%define fc17 1}
+%define fc18 0
+%{?build_fc18:%define fc18 1}
+%define fc22 0
+%{?build_fc22:%define fc22 1}
# RedHat Enterprise builds
%define rhel3 0
%{?build_rhel3:%define rhel3 1}
-%{?build_rhel3:%define wb3 1}
%define rhel4 0
%{?build_rhel4:%define rhel4 1}
%{?build_rhel4:%define fc3 1}
+%{?build_el4:%define rhel4 1}
+%{?build_el4:%define fc3 1}
%define rhel5 0
%{?build_rhel5:%define rhel5 1}
%{?build_rhel5:%define fc6 1}
+%{?build_el5:%define rhel5 1}
+%{?build_el5:%define fc6 1}
%define rhel6 0
%{?build_rhel6:%define rhel6 1}
+%{?build_el6:%define rhel6 1}
+%define rhel7 0
+%{?build_rhel7:%define rhel7 1}
+%{?build_el7:%define rhel7 1}
# CentOS build
%define centos3 0
%{?build_centos3:%define centos3 1}
-%{?build_centos3:%define wb3 1}
%define centos4 0
%{?build_centos4:%define centos4 1}
%{?build_centos4:%define fc3 1}
%{?build_centos5:%define fc6 1}
%define centos6 0
%{?build_centos6:%define centos6 1}
+%define centos7 0
+%{?build_centos7:%define centos7 1}
# SL build
%define sl3 0
%{?build_sl3:%define sl3 1}
-%{?build_sl3:%define wb3 1}
%define sl4 0
%{?build_sl4:%define sl4 1}
%{?build_sl4:%define fc3 1}
%{?build_su111:%define su111 1}
%define su112 0
%{?build_su112:%define su112 1}
+%define su113 0
+%{?build_su113:%define su113 1}
+%define su120 0
+%{?build_su120:%define su120 1}
+%define su131 0
+%{?build_su131:%define su131 1}
# Mandrake builds
%define mdk 0
%{?build_mdk:%define mdk 1}
%define client_only 0
%{?build_client_only:%define client_only 1}
+# if the platform is using systemd
+%define usesystemd 0
+
+%if %{rhel7} || %{fc22} || %{centos7}
+%define usesystemd 1
+%endif
+
+# depending if we use systemd or not, we use chkconfig or systemctl
+%if %{usesystemd}
+%define service_enable systemctl enable
+%define service_disable systemctl disable
+%else
+%define service_enable /sbin/chkconfig --add
+%define service_disable /sbin/chkconfig --del
+%endif
+
# Setup some short cuts
%define rhat 0
%if %{rh7} || %{rh8} || %{rh9}
%define rhat 1
%endif
%define fed 0
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
+%if %{fc16} || %{fc17} || %{fc18} || %{fc22}
%define fed 1
%endif
%define suse 0
-%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
+%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112} || %{su120} || %{su131}
%define suse 1
%endif
%define rhel 0
-%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{centos3} || %{centos4} || %{centos5} || %{centos6}
+%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{rhel7} || %{centos3} || %{centos4} || %{centos5} || %{centos6} || %{centos7}
%define rhel 1
%endif
%define scil 0
# test for a platform definition
-%if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
+%if !%{rhat} && !%{rhel} && !%{fed} && !%{suse} && !%{mdk} && !%{scil}
%{error: You must specify a platform. Please examine the spec file.}
exit 1
%endif
# distribution-specific directory for logwatch
-%if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
+%if %{rh7} || %{rh8} || %{rh9}
%define logwatch_dir /etc/log.d
%else
%define logwatch_dir /etc/logwatch
%{?build_x86_64:%define x86_64 1}
# check what distribution we are
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || %{fc11} || %{fc12}
+%if %{fc16} || %{fc17} || %{fc18} || %{fc22}
%define _dist %(grep Fedora /etc/redhat-release)
%endif
+%if %{centos7} || %{centos6}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
%if %{centos5} || %{centos4} || %{centos3}
%define _dist %(grep CentOS /etc/redhat-release)
%endif
%if %{sl5} ||%{sl4} || %{sl3}
%define _dist %(grep 'Scientific Linux' /etc/redhat-release)
%endif
-%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
-%define _dist %(grep White /etc/whitebox-release)
-%endif
%if %{suse}
%define _dist %(grep -i SuSE /etc/SuSE-release)
%endif
-%if %{mdk}
-%define _dist %(grep Mand /etc/mandrake-release)
-%endif
-%if %{rhat} || %{rhel}
-%define _dist %(grep Red /etc/redhat-release)
-%endif
-%{?DISTNAME:%define _dist %{DISTNAME}}
-
-# only set Disribution if not in opensuse build service, as it sets it itself
-%if ! 0%{?opensuse_bs}
-Distribution: %{_dist}
-%endif
-
-%if 0%{?opensuse_bs} && %{mysql} && %{suse}
-# needed in opensuse_bs, as rpm is installed during build process
-BuildRequires: libmysqlclient-devel
-BuildRequires: mysql-client
-BuildRequires: mysql
-%endif
-%if 0%{?opensuse_bs} && %{suse} && %{postgresql}
-BuildRequires: %{postgres_package}
-BuildRequires: %{postgres_server_package}
-%endif
-BuildRequires: openssl
-%if 0%{?opensuse_bs} && %{suse}
-BuildRequires: pwdutils
-BuildRequires: sysconfig
-%endif
-
-# should we turn on python support
-%define python 0
-%{?build_python:%define python 1}
+Distribution: %_dist
# should we enable tcp wrappers support
%define tcpwrappers 1
BuildRequires: gcc, gcc-c++, make, autoconf
BuildRequires: glibc, glibc-devel
-BuildRequires: ncurses-devel, perl, readline-devel
+BuildRequires: ncurses-devel, readline-devel
BuildRequires: libstdc++-devel, zlib-devel
BuildRequires: openssl-devel
BuildRequires: libacl-devel
BuildRequires: pkgconfig
+BuildRequires: bzip2-devel
%if ! %{rh7}
BuildRequires: libxml2-devel
%endif
-%if %{python}
-BuildRequires: python, python-devel
-%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
-%endif
%if %{rh7}
BuildRequires: libxml-devel
BuildRequires: glibc-static-devel
%endif
-%if %{suse}
-BuildRequires: termcap
-%else
-BuildRequires: libtermcap-devel
-%endif
-
%if %{mysql} && ! %{suse}
BuildRequires: mysql-devel
%endif
-%if %{postgresql} && %{wb3}
-BuildRequires: rh-postgresql-devel >= %{postgres_version}
-%endif
-
-%if %{postgresql} && ! %{wb3}
+%if %{postgresql}
BuildRequires: %{postgres_devel_package} >= %{postgres_version}
%endif
%{blurb7}
%{blurb8}
+#
+# ===========================================================
+# Generate mysql, sqlite, or postgresql rpm
+# ===========================================================
+#
%if %{mysql}
%package mysql
-%endif
-%if %{sqlite}
-%package sqlite
+Provides: libbaccats-%{version}.so()(64bit)
+#
+# The following provides is to work around an
+# auto generated requires from src/scripts/logwatch/applybaculadate
+# this is a gross kludge to keep it from being a requirement
+#
+Provides: perl(Logwatch)
%endif
%if %{postgresql}
%package postgresql
%if %{suse}
Conflicts: bacula
-Requires: termcap
-%else
-Requires: libtermcap
%endif
%if %{mysql}
Requires: mysql
%endif
-%if %{postgresql} && %{wb3}
-Requires: rh-postgresql >= 7
-%endif
-%if %{postgresql} && ! %{wb3}
+%if %{postgresql}
Requires: postgresql >= 7
%endif
%description postgresql
%endif
-%if %{python}
-Requires: python >= %{pyver}
-%endif
-
%{blurb}
%{blurb2}
%if %{sqlite}
This build incorporates sqlite3 as the catalog database, statically compiled.
%endif
-%if %{python}
-This build includes python scripting support.
-%endif
%if %{tcpwrappers}
This build includes tcp-wrappers support.
%endif
+
+
+#
+# ===========================================================
+# Client -- bacula-fd rpm
+# ===========================================================
+#
%package client
Summary: Bacula - The Network Backup Solution
Group: System Environment/Daemons
Provides: %{product}-libs
%endif
-Requires: libstdc++, zlib, openssl
+Requires: libstdc++, zlib, openssl, bzip2-libs
Requires: glibc, readline, %{name}-libs
-%if %{suse}
-Requires: termcap
-%else
-Requires: libtermcap
-%endif
-
-%if %{python}
-Requires: python >= %{pyver}
-%endif
-
%description client
%{blurb}
%{blurb7}
%{blurb8}
-This is the File daemon (Client) only package. It includes the command line
+This is the File daemon (Client) only package. It includes the command line
console program.
-%if %{python}
-This build includes python scripting support.
-%endif
%if %{tcpwrappers}
This build includes tcp-wrappers support.
%endif
+#
+# ===========================================================
+# Generate updatedb rpm
+# ===========================================================
+#
%if ! %{client_only}
%package updatedb
database.
%endif
+#
+# ===========================================================
+# Generate libs rpm
+# ===========================================================
+#
%package libs
Summary: Bacula - The Network Backup Solution
This package installs the shared libraries used by many bacula programs.
-# Don't strip symbols
-%define debug_package %{nil}
-
# Must explicitly enable debug pkg on SuSE
# but not in opensuse_bs
#%if %{suse} && ! 0%{?opensuse_bs}
#%endif
%prep
-%setup
-%setup -T -D -b 1
+%setup -T -b 0 -n depkgs
+%setup -T -b 1 -n %{product}-%{version}
+%setup -T -D -b 2 -n %{product}-%{version}
# extract depkgs
-%if %{sqlite}
-%setup -T -D -b 2
-%endif
+
%build
%if %{suse}
-export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
+#export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
%endif
+# You can use a cache for depkgs
+# tar xfz depkgs*gz -C ~/
+# cd ~/depkgs
+# touch %{depkgs_version} # depkgs version
+
+if [ -f $HOME/depkgs/%{depkgs_version} ]; then
+ rm -rf %{depkgs}
+ ln -s $HOME/depkgs %{depkgs}
+fi
+
cwd=${PWD}
%if %{sqlite}
cd %{depkgs}
cd ${cwd}
%endif
+cd %{depkgs}
+make lzo
+export LDFLAGS="${LDFLAGS} -L${PWD}/lzo/lib"
+export CPPFLAGS="${CPPFLAGS} -I${PWD}/lzo/include"
+cd ${cwd}
+
# hostname is the build hostname, so use XXX_HOSTNAME_XXX for Address parameter
-sed -i s/hostname/basename/ src/console/bconsole.conf.in src/dird/bacula-dir.conf.in src/qt-console/bat.conf.in src/tray-monitor/tray-monitor.conf.in
+sed -i s/hostname/basename/ src/console/bconsole.conf.in src/dird/bacula-dir.conf.in src/qt-console/bat.conf.in
%if %{sqlite}
# patches for the bundled sqlite scripts
-sed -i s:.SQL_BINDIR.:/opt/bacula/sqlite: src/cats/*_sqlite3_*.in
+sed -i s:.SQLITE_BINDIR.:/opt/bacula/sqlite: src/cats/*_sqlite3_*.in
# patch the bacula-dir init script to remove sqlite service
%if %{suse}
%if %{mysql} && %{x86_64}
export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
%endif
-%if %{python} && %{x86_64}
-export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
-%endif
+
+export BACULA="Bacula"
# Main Bacula configuration
%configure \
--mandir=%{_mandir} \
--with-scriptdir=%{script_dir} \
--with-working-dir=%{working_dir} \
- --with-plugindir=%{script_dir} \
+ --with-plugindir=%{plugin_dir} \
+ --with-logdir=%{log_dir} \
--with-pid-dir=%{pid_dir} \
--with-subsys-dir=%{_subsysdir} \
--enable-smartalloc \
- --disable-gnome \
- --disable-bwx-console \
- --disable-tray-monitor \
--disable-conio \
--enable-readline \
%if %{mysql}
--with-mysql \
%endif
-%if %{sqlite}
- --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
-%endif
%if %{postgresql}
--with-postgresql \
%endif
--disable-bat \
-%if %{python}
- --with-python \
-%endif
%if %{client_only}
--enable-client-only \
%endif
-%if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3}
+%if %{rh7} || %{rh8} || %{rh9}
--disable-batch-insert \
+%endif
+%if %{usesystemd}
+ --with-systemd=%{systemd_dir} \
%endif
--with-tcp-wrappers \
--with-dir-user=%{director_daemon_user} \
make -j3
%install
-
+
cwd=${PWD}
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
mkdir -p $RPM_BUILD_ROOT/etc/init.d
make DESTDIR=$RPM_BUILD_ROOT install
+# bsnapshot
+make DESTDIR=$RPM_BUILD_ROOT -C ../bacula-%{_version}/src/tools/ install-bsnapshot
+
+%if %{usesystemd}
+make DESTDIR=$RPM_BUILD_ROOT -C platforms/systemd install-dir install-service
+%endif
+
# Remove docs for programs that are depreciated
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
+# Remove docs for programs we do not distribute
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bpluginfo.8.%{manpage_ext}
+
+# Remove storage-ctl packaged in shstore rpm
+rm -f $RPM_BUILD_ROOT%{script_dir}/storage-ctl
+rm -f $RPM_BUILD_ROOT%{script_dir}/storage-ctl.conf
+
# fixme - make installs the mysql scripts for sqlite build
%if %{sqlite}
rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
%endif
+# Remove symlinks
+#rm -f $RPM_BUILD_ROOT%{_libdir}/libbaccats.so
+#rm -f $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
+
# install the init scripts
+%if !%{usesystemd}
%if %{suse}
cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
+%endif # suse
%if %{mdk}
cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
+%endif # mdk
%if ! %{suse} && ! %{mdk}
cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
+%endif # !suse && !mdk
chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
+%endif # ! usesystemd
+
%if %{client_only}
rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
+rm -f $RPM_BUILD_ROOT%{script_dir}/breload
+rm -f $RPM_BUILD_ROOT%{script_dir}/manual_prune.pl
+rm -f $RPM_BUILD_ROOT%{systemd_dir}/bacula-dir.service
+rm -f $RPM_BUILD_ROOT%{systemd_dir}/bacula-sd.service
%endif
# install sqlite
# install the updatedb scripts
cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
+# install specific scripts
+
%if ! %{client_only}
# install the sample-query.sql file
cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bregex.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bwild.8.%{manpage_ext}
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
-
rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
-rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
+
%endif
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-%if 0%{?opensuse_bs}
-rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
-%else
rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
-%endif
%if %{mysql}
%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/startmysql
-%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
+%{_libdir}/libbaccats*
%{_libdir}/libbacsql*
+%{_libdir}/libbacsd*.so
%endif
-%if %{sqlite}
-%files sqlite
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
-%{sqlite_bindir}/libsqlite3.a
-%{sqlite_bindir}/sqlite3.h
-%{sqlite_bindir}/sqlite3
-%{_libdir}/libbacsql*
-%endif
-
-
%if %{postgresql}
%files postgresql
%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
+%attr(755, root, %{daemon_group}) %{script_dir}/create_postgresql_database
+%attr(755, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
+%attr(755, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
+%{_libdir}/libbaccats*
%{_libdir}/libbacsql*
+%{_libdir}/libbacsd*.so
%endif
# The rest is DB backend independent
%attr(-, root, %{daemon_group}) %{script_dir}/bacula
%attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
%attr(-, root, %{daemon_group}) %{script_dir}/bconsole
-%attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/create_bacula_database
+%attr(755, root, %{daemon_group}) %{script_dir}/drop_bacula_database
+%attr(755, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
+%attr(755, root, %{daemon_group}) %{script_dir}/make_bacula_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
+%attr(755, root, %{daemon_group}) %{script_dir}/update_bacula_tables
%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
%attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
-%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
-%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
-%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
+%attr(-, root, %{daemon_group}) %{script_dir}/tapealert
+
+%attr(-, root, %{daemon_group}) %{plugin_dir}/bpipe-fd.so
%attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
-%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
-%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
%attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
+%if %{usesystemd}
+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-dir.service
+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-fd.service
+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-sd.service
+%else
+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
+%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
+%endif
+
/etc/logrotate.d/bacula
%{logwatch_dir}/scripts/services/bacula
%{logwatch_dir}/scripts/shared/applybaculadate
%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
%attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
%attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
%attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
+%attr(-, root, %{daemon_group}) %{script_dir}/query.sql
%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
-%{_sbindir}/bacula-dir
+%attr(-, root, %{daemon_group}) %{_sbindir}/bacula-dir
+%attr(-, root, %{daemon_group}) %{_sbindir}/bacula-sd
+%attr(-, root, %{daemon_group}) %{_sbindir}/btraceback
+%attr(-, root, %{daemon_group}) %{_sbindir}/bconsole
+%attr(-, root, %{daemon_group}) %{_sbindir}/bsmtp
+%attr(-, root, %{daemon_group}) %{_sbindir}/bscan
+%attr(-, root, %{daemon_group}) %{_sbindir}/btape
+
+%attr(755, root, root) %{_sbindir}/bsnapshot
+
%{_sbindir}/bacula-fd
-%{_sbindir}/bacula-sd
%{_sbindir}/bacula
%{_sbindir}/bcopy
%{_sbindir}/bextract
%{_sbindir}/bls
-%{_sbindir}/bscan
-%{_sbindir}/btape
-%{_sbindir}/btraceback
-%{_sbindir}/bconsole
-%{_sbindir}/bsmtp
%{_sbindir}/bregex
%{_sbindir}/bwild
%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
%{_mandir}/man8/btape.8.%{manpage_ext}
%{_mandir}/man8/btraceback.8.%{manpage_ext}
%{_mandir}/man8/dbcheck.8.%{manpage_ext}
+%{_mandir}/man8/bregex.8.%{manpage_ext}
+%{_mandir}/man8/bwild.8.%{manpage_ext}
%{_mandir}/man1/bsmtp.1.%{manpage_ext}
%{_mandir}/man1/bat.1.%{manpage_ext}
%_prefix/share/doc/*
-# opensuse build service changes the release itself
-%if 0%{?opensuse_bs}
-%doc ../Release_Notes-%{version}-1.txt
-%else
%doc ../Release_Notes-%{version}-%{release}.txt
-%endif
+
%endif
%if %{mysql}
%if %{postgresql}
%pre postgresql
-DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
+DB_VER=`echo 'SELECT * FROM Version LIMIT 1;' | su - postgres -c 'psql bacula' 2>/dev/null | tail -3 | head -1`
%endif
%if ! %{client_only}
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
- echo "This bacula upgrade will update a bacula database from version 12 to 13."
+ echo "This bacula upgrade will update a bacula database from version 12 to 1014."
echo "You appear to be running database version $DB_VER. You must first update"
echo "your database to version 12 and then install this upgrade. The alternative"
echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current"
# add our links
if [ "$1" -ge 1 ] ; then
%if %{suse} && %{mysql}
- /sbin/chkconfig --add mysql
+ %{service_enable} mysql
%endif
%if %{suse} && %{postgresql}
- /sbin/chkconfig --add postgresql
+ %{service_enable} postgresql
%endif
- /sbin/chkconfig --add bacula-dir
- /sbin/chkconfig --add bacula-fd
- /sbin/chkconfig --add bacula-sd
+ %{service_enable} bacula-dir
+ %{service_enable} bacula-fd
+ %{service_enable} bacula-sd
fi
%endif
if [ -d %{sysconf_dir} ]; then
cd %{sysconf_dir}
- 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
- pass=`openssl rand -base64 33`
- for file in *.conf; do
- sed "s@${string}@${pass}@g" $file > $file.new
- cp -f $file.new $file; rm -f $file.new
- done
- done
-# put actual hostname in conf file
- host=`hostname`
- string="XXX_HOSTNAME_XXX"
+ if [ ! -f .rpm.sed ]; then
+ (umask 0177
+ echo "# This file is used to ensure that all passwords will" > .rpm.sed
+ echo "# match between configuration files" >> .rpm.sed
+ )
+ 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
+ pass=`openssl rand -base64 33`
+ echo "s@${string}@${pass}@g" >> .rpm.sed
+ done
+ fi
+ host=`hostname -s`
+ if [ "$host" = "" ]; then
+ host=localhost
+ fi
for file in *.conf; do
- sed "s@${string}@${host}@g" $file >$file.new
- cp -f $file.new $file; rm -f $file.new
+ sed -f .rpm.sed $file > $file.new
+ sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file
+ rm -f $file.new
done
fi
#check, if mysql can be called successfully at all
if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
-# test for an existing database
-# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
-
-# grant privileges and create tables if they do not exist
-if [ -z "$DB_VER" ]; then
- echo "Hmm, it doesn't look like you have an existing database."
- echo "Granting privileges for MySQL user bacula..."
- %{script_dir}/grant_mysql_privileges
- echo "Creating MySQL bacula database..."
- %{script_dir}/create_mysql_database
- echo "Creating bacula tables..."
- %{script_dir}/make_mysql_tables
-
-# check to see if we need to upgrade a 3.x database
-elif [ "$DB_VER" -lt "13" ]; then
- echo "This release requires an upgrade to your bacula database."
- echo "Backing up your current database..."
- mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
- echo "Upgrading bacula database ..."
- %{script_dir}/update_mysql_tables
- echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
-
-fi
+ # test for an existing database
+ # note: this ASSUMES no password has been set for bacula database
+ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
+
+ # grant privileges and create tables if they do not exist
+ if [ -z "$DB_VER" ]; then
+ echo "Hmm, it doesn't look like you have an existing database."
+ echo "Granting privileges for MySQL user bacula..."
+ %{script_dir}/grant_mysql_privileges
+ echo "Creating MySQL bacula database..."
+ %{script_dir}/create_mysql_database
+ echo "Creating bacula tables..."
+ %{script_dir}/make_mysql_tables
+
+ elif [ "$DB_VER" -ge "12" -a "$DB_VER" -lt "1015" ]; then
+ echo "This release requires an upgrade to your bacula database."
+ echo "Backing up your current database..."
+ mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
+ echo "Upgrading bacula database ..."
+ %{script_dir}/update_mysql_tables
+ echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
+
+ fi
fi
%endif
if [ -s %{working_dir}/bacula.db ]; then
DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
# check to see if we need to upgrade a 3.x database
- if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
+ if [ "$DB_VER" -le "13" ] && [ "$DB_VER" -ge "12" ]; then
echo "This release requires an upgrade to your bacula database."
echo "Backing up your current database..."
echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
%if %{postgresql}
# check if psql can be called successfully at all
-if echo 'select * from Version;' | psql bacula 2>/dev/null; then
-
-# test for an existing database
-# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
-
-# grant privileges and create tables if they do not exist
-if [ -z "$DB_VER" ]; then
- echo "Hmm, doesn't look like you have an existing database."
- echo "Creating PostgreSQL bacula database..."
- %{script_dir}/create_postgresql_database
- echo "Creating bacula tables..."
- %{script_dir}/make_postgresql_tables
- echo "Granting privileges for PostgreSQL user bacula..."
- %{script_dir}/grant_postgresql_privileges
-
-# check to see if we need to upgrade a 5.0.x database
-elif [ "$DB_VER" -lt "13" ]; then
- echo "This release requires an upgrade to your bacula database."
- echo "Backing up your current database..."
- pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
- echo "Upgrading bacula database ..."
- %{script_dir}/update_postgresql_tables
- echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
-
-fi
+if echo 'select * from Version;' | su - postgres -c 'psql bacula' 2>/dev/null; then
+
+ # test for an existing database
+ # note: this ASSUMES no password has been set for bacula database
+ DB_VER=`echo 'SELECT * FROM Version LIMIT 1;' | su - postgres -c 'psql bacula' 2>/dev/null | tail -3 | head -1`
+
+ # grant privileges and create tables if they do not exist
+ if [ -z "$DB_VER" ]; then
+ echo "Hmm, doesn't look like you have an existing database."
+ echo "Creating PostgreSQL bacula database..."
+ su - postgres -c %{script_dir}/create_postgresql_database
+ echo "Creating bacula tables..."
+ su - postgres -c %{script_dir}/make_postgresql_tables
+ echo "Granting privileges for PostgreSQL user bacula..."
+ su - postgres -c %{script_dir}/grant_postgresql_privileges
+
+ elif [ "$DB_VER" -ge "12" -a "$DB_VER" -lt "1015" ]; then
+ echo "This release requires an upgrade to your bacula database."
+ echo "Backing up your current database..."
+ su - postgres -c 'pg_dump bacula' | bzip2 > %{working_dir}/bacula_backup.sql.bz2
+ echo "Upgrading bacula database ..."
+ su - postgres -c %{script_dir}/update_postgresql_tables
+ echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
+ echo "Granting privileges for PostgreSQL user bacula..."
+ su - postgres -c %{script_dir}/grant_postgresql_privileges
+
+ fi
fi
%endif
%if ! %{client_only}
if [ -d %{sysconf_dir} ]; then
cd %{sysconf_dir}
- 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
- pass=`openssl rand -base64 33`
- for file in *.conf; do
- sed "s@${string}@${pass}@g" $file > $file.new
- cp -f $file.new $file; rm -f $file.new
- done
- done
-# put actual hostname in conf file
- host=`hostname`
- string="XXX_HOSTNAME_XXX"
+ if [ ! -f .rpm.sed ]; then
+ (umask 0177
+ echo "# This file is used to ensure that all passwords will" > .rpm.sed
+ echo "# match between configuration files" >> .rpm.sed
+ )
+ 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
+ pass=`openssl rand -base64 33`
+ echo "s@${string}@${pass}@g" >> .rpm.sed
+ done
+ fi
+ host=`hostname -s`
+ if [ "$host" = "" ]; then
+ host=localhost
+ fi
for file in *.conf; do
- sed "s@${string}@${host}@g" $file >$file.new
- cp -f $file.new $file; rm -f $file.new
+ sed -f .rpm.sed $file > $file.new
+ sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file
+ rm -f $file.new
done
fi
%endif
%if ! %{client_only}
# delete our links
if [ $1 = 0 ]; then
- /sbin/chkconfig --del bacula-dir
- /sbin/chkconfig --del bacula-fd
- /sbin/chkconfig --del bacula-sd
+ %{service_disable} bacula-dir
+ %{service_disable} bacula-fd
+ %{service_disable} bacula-sd
fi
%endif
%files client
%defattr(-,root,root)
%attr(-, root, %{daemon_group}) %dir %{script_dir}
+%attr(-, root, %{daemon_group}) %dir %{plugin_dir}
%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
+
+# SD/DIR might write here
+%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{log_dir}
+
+%if %{usesystemd}
+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-fd.service
+%else
%{script_dir}/bacula-ctl-fd
/etc/init.d/bacula-fd
+%endif
/etc/logrotate.d/bacula
%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
+%attr(-, root, %{daemon_group}) %{plugin_dir}/bpipe-fd.so
%{_sbindir}/bconsole
%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
%{_mandir}/man8/bacula.8.%{manpage_ext}
%post client
# add our link
if [ "$1" -ge 1 ] ; then
- /sbin/chkconfig --add bacula-fd
+ %{service_enable} bacula-fd
fi
if [ -d %{sysconf_dir} ]; then
cd %{sysconf_dir}
- 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
- pass=`openssl rand -base64 33`
- for file in *.conf; do
- sed "s@${string}@${pass}@g" $file > $file.new
- cp -f $file.new $file; rm -f $file.new
- done
- done
-# put actual hostname in conf file
- host=`hostname`
- string="XXX_HOSTNAME_XXX"
+ if [ ! -f .rpm.sed ]; then
+ (umask 0177
+ echo "# This file is used to ensure that all passwords will" > .rpm.sed
+ echo "# match between configuration files" >> .rpm.sed
+ )
+ 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
+ pass=`openssl rand -base64 33`
+ echo "s@${string}@${pass}@g" >> .rpm.sed
+ done
+ fi
+ host=`hostname -s`
+ if [ "$host" = "" ]; then
+ host=localhost
+ fi
for file in *.conf; do
- sed "s@${string}@${host}@g" $file >$file.new
- cp -f $file.new $file; rm -f $file.new
+ sed -f .rpm.sed $file > $file.new
+ sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file
+ rm -f $file.new
done
fi
%preun client
# delete our link
if [ $1 = 0 ]; then
- /sbin/chkconfig --del bacula-fd
+ %{service_disable} bacula-fd
fi
%files libs
%{_libdir}/libbac.*
%{_libdir}/libbaccfg*
%{_libdir}/libbacfind*
-%{_libdir}/libbacpy*
%post libs
/sbin/ldconfig
%files updatedb
%defattr(-,root,%{daemon_group})
%{script_dir}/updatedb/*
-#oensuse_bs: directories not owned by any package
-#%{script_dir}/updatedb
%pre updatedb
# create the daemon group
%endif
%changelog
-* Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove --without-qwt from configure statement
-* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- move shared libraries into bacula-libs package
-* Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove deprecated mysql4 and mysql5 build defines
-- add build support for tcpwrappers
-- remove bacula_config file for client only build
-- remove requirements for database server packages
-- enable readline support
-- add fc11 and fc12
-* Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 5.0.1
-- fix client only build
-- clean up requirements for termcap
-- query.sql now empty by default so we install sample-query.sql along side it
-- remove old nobuild_mtx switch
-* Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix mysql database upgrade
-* Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix permissions of dbcheck
-- misc. cleanup
-* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 5.0.0
-- add su112 and fc10 builds, remove doc package declaration.
-- fix source path for logwatch files.
-- restore static bundled build of sqlite (who took that out?) and remove use
-- of system sqlite. we don't support use of sqlite2.
-- upgrade database from version 11 to 12.
-* Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
-- changes to work with opensuse build service
-* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
-- Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
-- removed build of rescue, gnome console and wxconsole
-* Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- Fix bat install which is now handled by make and uses shared libs
-* Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
-* Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- Fix post ldconfig problem in client only build
-* Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove more files installed by client-only build not needed by client package
-- remove libbacsql files from client package
-* Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 3.0.1
-- update for new docs configuration
-* Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add switch to pass Distribution tag
-* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 3.0.0 release
-- database update version 10 to 11
-- make now installs docs so we rm from buildroot
-- add shared libs in %_libdir and other misc new files
-* Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add su111 target
-* Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- set paths for QT using pkgconfig
-* Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
-* Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- adjust /opt/bacula install
-- add build switch to supress rescue package
-* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add support for install to /opt/bacula
-* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove libtermcap dependancy for FC9
-* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix bat dependencies
-* Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add su110 target
-* Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add fc9 target
-* Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- FHS compatibility changes
-* Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove fix for false buffer overflow detection with glibc >= 2.7
-* Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix for false buffer overflow detection with glibc >= 2.7