1a9c4f1
%global uid 133
e004908
%global username bacula
4dac1ea
49b59b7
Name:               bacula
6e8326d
Version:            11.0.2
657fef9
Release:            3%{?dist}
49b59b7
Summary:            Cross platform network backup for Linux, Unix, Mac and Windows
66f3524
# See LICENSE for details
49b59b7
License:            AGPLv3 with exceptions
49b59b7
URL:                http://www.bacula.org
49b59b7
3eafafa
Source0:            http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
49b59b7
49b59b7
Source2:            quickstart_postgresql.txt
49b59b7
Source3:            quickstart_mysql.txt
49b59b7
Source4:            quickstart_sqlite3.txt
49b59b7
Source5:            README.Redhat
49b59b7
Source6:            %{name}.logrotate
49b59b7
Source10:           %{name}-fd.service
49b59b7
Source11:           %{name}-dir.service
49b59b7
Source12:           %{name}-sd.service
49b59b7
Source15:           %{name}-fd.sysconfig
49b59b7
Source16:           %{name}-dir.sysconfig
49b59b7
Source17:           %{name}-sd.sysconfig
a6a727a
Source19:           https://salsa.debian.org/bacula-team/bacula/-/raw/master/debian/additions/bacula-tray-monitor.png#/bacula-tray-monitor.png
49b59b7
dec0728
Patch1:             %{name}-openssl.patch
dec0728
Patch2:             %{name}-queryfile.patch
dec0728
Patch3:             %{name}-sqlite-priv.patch
dec0728
Patch4:             %{name}-bat-build.patch
dec0728
Patch5:             %{name}-seg-fault.patch
dec0728
Patch6:             %{name}-logwatch.patch
dec0728
Patch7:             %{name}-non-free-code.patch
dec0728
Patch8:             %{name}-desktop.patch
dec0728
Patch9:             %{name}-g++-options.patch
6111889
Patch10:            %{name}-install.patch
6111889
Patch11:            %{name}-docker-plugin.patch
6e2fc90
# Original patch removed by mistake, upstream is not willing to add it again:
6e2fc90
# http://www.bacula.org/git/cgit.cgi/bacula/commit/?h=Branch-7.0&id=51b3b98fb77ab3c0decee455cc6c4d2eb3c5303a
6e2fc90
# Without this, there is no library providing the correct shared object name
6e2fc90
# required by the daemons.
6e2fc90
# http://bugs.bacula.org/view.php?id=2084
1e67f51
Patch12:            %{name}-autoconf.patch
1e67f51
Patch13:            %{name}-build-cdp-plugin.patch
1e67f51
Patch14:            %{name}-nagios.patch
6e8326d
# Included in 11.0.3 - https://www.bacula.org/git/cgit.cgi/bacula/commit/?h=Branch-11.0&id=ef3a7fe40a2aee5e7acb3bf3144bba713c9cf982:
6e8326d
Patch15:            %{name}-nagios-check-fix.patch
6e2fc90
49b59b7
BuildRequires:      desktop-file-utils
3766c97
BuildRequires:      perl-generators
49b59b7
BuildRequires:      sed
49b59b7
4ee7c4d
BuildRequires:      autoconf
4ee7c4d
BuildRequires:      automake
e397501
BuildRequires:      gcc
e397501
BuildRequires:      gcc-c++
49b59b7
BuildRequires:      glibc-devel
49b59b7
BuildRequires:      libacl-devel
49b59b7
BuildRequires:      libstdc++-devel
49b59b7
BuildRequires:      libxml2-devel
49b59b7
BuildRequires:      libcap-devel
49b59b7
BuildRequires:      lzo-devel
15230d8
BuildRequires:      make
49b59b7
BuildRequires:      ncurses-devel
9ad9175
BuildRequires:      openssl-devel
15230d8
BuildRequires:      qt5-qtbase-devel
49b59b7
BuildRequires:      readline-devel
4df972f
BuildRequires:      sed
49b59b7
BuildRequires:      sqlite-devel
ea8caca
BuildRequires:      systemd
15230d8
BuildRequires:      zlib-devel
0745245
3065577
%if 0%{?fedora} || 0%{?rhel} > 7
493b5d1
BuildRequires:      mariadb-connector-c-devel
83856b5
# https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules
83856b5
BuildRequires:      perl-interpreter
493b5d1
%else
493b5d1
BuildRequires:      mysql-devel
83856b5
BuildRequires:      perl
ae55bb6
BuildRequires:      tcp_wrappers-devel
493b5d1
%endif
493b5d1
15230d8
%if 0%{?fedora}
3065577
BuildRequires:      libpq-devel
3065577
%else
3065577
BuildRequires:      postgresql-devel
3065577
%endif
3065577
0745245
%description
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture and is efficient and relatively easy to
8f6eee7
use, while offering many advanced storage management features that make it easy
8f6eee7
to find and recover lost or damaged files.
0745245
8390fc1
%package libs
49b59b7
Summary:            Bacula libraries
964c499
964c499
%description libs
964c499
Bacula is a set of programs that allow you to manage the backup,
964c499
recovery, and verification of computer data across a network of
964c499
different computers. It is based on a client/server architecture.
964c499
964c499
This package contains basic Bacula libraries, which are used by all
964c499
Bacula programs.
964c499
964c499
%package libs-sql
49b59b7
Summary:            Bacula SQL libraries
49b59b7
Obsoletes:          bacula-libs-mysql <= 5.0.3
49b59b7
Obsoletes:          bacula-libs-sqlite <= 5.0.3
49b59b7
Obsoletes:          bacula-libs-postgresql <= 5.0.3
49b59b7
Provides:           bacula-libs-mysql = %{version}-%{release}
49b59b7
Provides:           bacula-libs-sqlite = %{version}-%{release}
49b59b7
Provides:           bacula-libs-postgresql = %{version}-%{release}
8390fc1
964c499
%description libs-sql
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
8390fc1
8f6eee7
This package contains the SQL Bacula libraries, which are used by Director and
8f6eee7
Storage daemons. You have to select your preferred catalog library through the
8f6eee7
alternatives system.
8390fc1
7dc2ef0
%package common
49b59b7
Summary:            Common Bacula files
49b59b7
Provides:           group(%username) = %uid
49b59b7
Provides:           user(%username) = %uid
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
49b59b7
Requires(pre):      shadow-utils
49b59b7
Requires(postun):   shadow-utils
7dc2ef0
7dc2ef0
%description common
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
7dc2ef0
54639b9
This package contains files common to all Bacula daemons.
8390fc1
bf9089a
%package director
49b59b7
Summary:            Bacula Director files
49b59b7
Requires:           bacula-common%{?_isa} = %{version}-%{release}
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
65662da
Requires:           bacula-libs-sql%{?_isa} = %{version}-%{release}
bf9089a
# Director backends merged into core.
49b59b7
Provides:           bacula-director-common = %{version}-%{release}
49b59b7
Obsoletes:          bacula-director-common < 5.2.3-5
49b59b7
Provides:           bacula-director-mysql = %{version}-%{release}
49b59b7
Obsoletes:          bacula-director-mysql < 5.2.3-5
49b59b7
Provides:           bacula-director-sqlite = %{version}-%{release}
49b59b7
Obsoletes:          bacula-director-sqlite < 5.2.3-5
49b59b7
Provides:           bacula-director-postgresql = %{version}-%{release}
49b59b7
Obsoletes:          bacula-director-postgresql < 5.2.3-5
e66bd92
49b59b7
Requires(post):     systemd
49b59b7
Requires(preun):    systemd
49b59b7
Requires(postun):   systemd
7dc2ef0
bf9089a
%description director
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
7dc2ef0
bf9089a
This package contains the director files.
0745245
1fabaac
%package logwatch
1fabaac
Summary:            Bacula Director logwatch scripts
1fabaac
BuildArch:          noarch
9c09f86
Requires:           bacula-director = %{version}-%{release}
1fabaac
Requires:           logwatch
1fabaac
1fabaac
%description logwatch
1fabaac
Bacula is a set of programs that allow you to manage the backup, recovery, and
1fabaac
verification of computer data across a network of different computers. It is
1fabaac
based on a client/server architecture.
1fabaac
1fabaac
This package contains logwatch scripts for Bacula Director.
1fabaac
7dc2ef0
%package storage
49b59b7
Summary:            Bacula storage daemon files
49b59b7
Requires:           bacula-common%{?_isa} = %{version}-%{release}
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
65662da
Requires:           bacula-libs-sql%{?_isa} = %{version}-%{release}
49b59b7
Requires:           mt-st
f89001f
Requires:           mtx
7dc2ef0
# Storage backends merged into core.
49b59b7
Provides:           bacula-storage-common = %{version}-%{release}
49b59b7
Obsoletes:          bacula-storage-common < 5.2.2-2
49b59b7
Provides:           bacula-storage-mysql = %{version}-%{release}
49b59b7
Obsoletes:          bacula-storage-mysql < 5.2.0
49b59b7
Provides:           bacula-storage-sqlite = %{version}-%{release}
49b59b7
Obsoletes:          bacula-storage-sqlite < 5.2.0
49b59b7
Provides:           bacula-storage-postgresql = %{version}-%{release}
49b59b7
Obsoletes:          bacula-storage-postgresql < 5.2.0
50deab8
49b59b7
Requires(post):     systemd
49b59b7
Requires(preun):    systemd
49b59b7
Requires(postun):   systemd
16d9a36
7dc2ef0
%description storage
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
0745245
8f6eee7
This package contains the storage daemon, the daemon responsible for writing
8f6eee7
the data received from the clients onto tape drives or other mass storage
8f6eee7
devices.
0745245
0745245
%package client
49b59b7
Summary:            Bacula backup client
49b59b7
Requires:           bacula-common%{?_isa} = %{version}-%{release}
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
50deab8
49b59b7
Requires(post):     systemd
49b59b7
Requires(preun):    systemd
49b59b7
Requires(postun):   systemd
0745245
0745245
%description client
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
0745245
8f6eee7
This package contains the bacula client, the daemon running on the system to be
8f6eee7
backed up.
0745245
0745245
%package console
49b59b7
Summary:            Bacula management console
49b59b7
Obsoletes:          bacula-console-wxwidgets <= 5.0.3
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
0745245
0745245
%description console
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
0745245
8f6eee7
This package contains the command-line management console for the bacula backup
8f6eee7
system.
0745245
7dc8299
%package console-bat
49b59b7
Summary:            Bacula bat console
06474f4
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
77a6346
Requires:           dejavu-lgc-sans-fonts
7dc8299
7dc8299
%description console-bat
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
7dc8299
8390fc1
This package contains the bat version of the bacula management console.
367ff02
230fff0
%package traymonitor
230fff0
Summary:            Bacula system tray monitor
230fff0
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
77a6346
Requires:           dejavu-lgc-sans-fonts
367ff02
230fff0
%description traymonitor
230fff0
Bacula is a set of programs that allow you to manage the backup, recovery, and
230fff0
verification of computer data across a network of different computers. It is
230fff0
based on a client/server architecture.
367ff02
230fff0
This package contains the Gnome and KDE compatible tray monitor to monitor your
230fff0
bacula server.
0745245
3b6cb34
%package devel
49b59b7
Summary:            Bacula development files
65662da
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
65662da
Requires:           bacula-libs-sql%{?_isa} = %{version}-%{release}
3b6cb34
3b6cb34
%description devel
8f6eee7
Bacula is a set of programs that allow you to manage the backup, recovery, and
8f6eee7
verification of computer data across a network of different computers. It is
8f6eee7
based on a client/server architecture.
3b6cb34
3b6cb34
This development package contains static libraries and header files.
3b6cb34
230fff0
%package -n nagios-plugins-bacula
230fff0
Summary:            Nagios Plugin - check_bacula
230fff0
Requires:           bacula-libs%{?_isa} = %{version}-%{release}
457a0b7
Requires:           nagios-common%{?_isa}
3b6cb34
230fff0
%description -n nagios-plugins-bacula
230fff0
Provides check_bacula support for Nagios.
52eec75
16d9a36
%prep
6e2fc90
%autosetup -p1
f9a2c10
2e1584d
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} .
0745245
4ee7c4d
# Regenerate configure
4ee7c4d
pushd autoconf
4ee7c4d
sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' libtool/libtool.m4
4ee7c4d
aclocal -I bacula-macros/ -I gettext-macros/ -I libtool/
4ee7c4d
popd
4ee7c4d
autoconf -I autoconf/ -o configure autoconf/configure.in
4ee7c4d
0745245
# Remove execution permissions from files we're packaging as docs later on
0745245
find updatedb -type f | xargs chmod -x
0745245
4df972f
# Remove dash requirement:
657fef9
sed -i -e 's|/bin/dash|/bin/sh|g' scripts/baculabackupreport.in
4df972f
0745245
%build
5b12550
export CFLAGS="%{optflags} -I%{_includedir}/ncurses"
5b12550
export CPPFLAGS="%{optflags} -I%{_includedir}/ncurses"
714ac00
export PATH="$PATH:%{_qt5_bindir}"
4ee7c4d
0745245
%configure \
6e2fc90
    --disable-conio \
6e2fc90
    --disable-rpath \
4ee7c4d
    --disable-s3 \
6e2fc90
    --docdir=%{_datadir}/bacula \
6e2fc90
    --enable-bat \
6e2fc90
    --enable-batch-insert \
6e2fc90
    --enable-build-dird \
6e2fc90
    --enable-build-stored \
6e2fc90
    --enable-includes \
6e2fc90
    --enable-largefile \
6e2fc90
    --enable-readline \
6e2fc90
    --enable-smartalloc \
6e2fc90
    --sysconfdir=%{_sysconfdir}/bacula \
6e2fc90
    --with-basename=bacula \
6e2fc90
    --with-bsrdir=%{_localstatedir}/spool/bacula \
6e2fc90
    --with-dir-password=@@DIR_PASSWORD@@ \
6e2fc90
    --with-fd-password=@@FD_PASSWORD@@ \
6e2fc90
    --with-hostname=localhost \
6e2fc90
    --with-logdir=%{_localstatedir}/log/bacula \
6e2fc90
    --with-mon-dir-password=@@MON_DIR_PASSWORD@@ \
6e2fc90
    --with-mon-fd-password=@@MON_FD_PASSWORD@@ \
6e2fc90
    --with-mon-sd-password=@@MON_SD_PASSWORD@@ \
6e2fc90
    --with-mysql \
6e2fc90
    --with-openssl \
6e2fc90
    --with-pid-dir=%{_localstatedir}/run \
6111889
    --with-plugindir=%{_libdir}/%{name} \
6e2fc90
    --with-postgresql \
6e2fc90
    --with-scriptdir=%{_libexecdir}/bacula \
6e2fc90
    --with-sd-password=@@SD_PASSWORD@@ \
6e2fc90
    --with-smtp-host=localhost \
6e2fc90
    --with-sqlite3 \
6e2fc90
    --with-subsys-dir=%{_localstatedir}/lock/subsys \
3065577
%if 0%{!?fedora} || 0%{!?rhel} > 7
6e2fc90
    --with-tcp-wrappers \
e7a0671
%endif
6e2fc90
    --with-working-dir=%{_localstatedir}/spool/bacula \
6e2fc90
    --with-x
0745245
16d9a36
# Remove RPATH
16d9a36
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
16d9a36
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
eb59c7c
4ee7c4d
%make_build
1e67f51
%make_build -C src/tools/cdp-client
4ee7c4d
%make_build -C examples/nagios/check_bacula
4dac1ea
230fff0
pushd src/qt-console/tray-monitor
714ac00
    %{?qmake_qt5}%{!?qmake_qt5:qmake-qt5} tray-monitor.pro
4ee7c4d
    %make_build
230fff0
popd
f89001f
e397501
# Convert image to png for tray monitor icon
0745245
%install
e8889c2
%make_install
1e67f51
%make_install -C src/tools/cdp-client
1e67f51
%make_install -C examples/nagios/check_bacula
fae5422
a38ed26
# This will be managed through alternatives, as it requires the name to NOT
a38ed26
# change between upgrades, so the versioned library name can not be used.
e95438f
rm -f %{buildroot}%{_libdir}/libbaccats.so
0745245
367ff02
# Bat
f89001f
install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png
ea4bc47
install -p -m 644 -D scripts/bat.desktop %{buildroot}%{_datadir}/applications/bat.desktop
665925f
install -p -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}/bat
ab134d0
2354547
install -p -m 644 -D manpages/bacula-tray-monitor.1 %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1
a6a727a
install -p -m 644 -D %{SOURCE19} %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.png
ea4bc47
install -p -m 644 -D scripts/bacula-tray-monitor.desktop %{buildroot}%{_datadir}/applications/bacula-tray-monitor.desktop
367ff02
3b6cb34
# Logrotate
33a6de8
mkdir -p %{buildroot}%{_localstatedir}/log/bacula
33a6de8
install -p -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/bacula
0745245
3b6cb34
# Logwatch
33a6de8
install -p -m 755 -D scripts/logwatch/bacula %{buildroot}%{_sysconfdir}/logwatch/scripts/services/bacula
33a6de8
install -p -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
33a6de8
install -p -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
33a6de8
install -p -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
0745245
99bb2e4
# Systemd unit files
33a6de8
mkdir -p %{buildroot}%{_unitdir}
63bda35
install -p -m 644 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
63bda35
install -p -m 644 -D %{SOURCE11} %{buildroot}%{_unitdir}/bacula-dir.service
63bda35
install -p -m 644 -D %{SOURCE12} %{buildroot}%{_unitdir}/bacula-sd.service
Jan Görig e51227f
16d9a36
# Sysconfig
33a6de8
install -p -m 644 -D %{SOURCE15} %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd
33a6de8
install -p -m 644 -D %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir
33a6de8
install -p -m 644 -D %{SOURCE17} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd
Jan Görig e51227f
3b6cb34
# Spool directory
33a6de8
mkdir -p %{buildroot}%{_localstatedir}/spool/bacula
0745245
3b6cb34
# Remove stuff we do not need
07d3fd8
rm -f %{buildroot}%{_libexecdir}/bacula/{bacula,bacula-ctl-*,startmysql,stopmysql,bconsole,make_catalog_backup}
d49b54f
rm -f %{buildroot}%{_sbindir}/bacula
d49b54f
rm -f %{buildroot}%{_mandir}/man8/bacula.8.gz
3eafafa
rm -f %{buildroot}%{_libdir}/*.la
b5979e3
rm -f %{buildroot}%{_datadir}/bacula/{ChangeLog,INSTALL,LICENSE*,README,ReleaseNotes,VERIFYING,technotes}
0745245
0745245
# Fix up some perms so rpmlint does not complain too much
0745245
chmod 755 %{buildroot}%{_sbindir}/*
6111889
chmod 755 %{buildroot}%{_libdir}/%{name}/*
0745245
chmod 755 %{buildroot}%{_libexecdir}/bacula/*
0745245
chmod 644 %{buildroot}%{_libexecdir}/bacula/btraceback.*
0745245
6e2fc90
%ldconfig_scriptlets libs
964c499
964c499
%post libs-sql
5f381d6
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-mysql.so 50
5f381d6
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-sqlite3.so 40
5f381d6
/usr/sbin/alternatives --install %{_libdir}/libbaccats.so libbaccats.so %{_libdir}/libbaccats-postgresql.so 60
29391a8
ddc6de9
# Fix for automatic selection of backends during upgrades
ddc6de9
if readlink /etc/alternatives/libbaccats.so | grep --silent mysql || \
6e2fc90
    readlink /etc/alternatives/bacula-dir | grep --silent mysql || \
6e2fc90
    readlink /etc/alternatives/bacula-sd | grep --silent mysql; then
6e2fc90
    /usr/sbin/alternatives --set libbaccats.so %{_libdir}/libbaccats-mysql.so
ddc6de9
elif readlink /etc/alternatives/libbaccats.so | grep --silent sqlite || \
6e2fc90
    readlink /etc/alternatives/bacula-dir | grep --silent sqlite || \
6e2fc90
    readlink /etc/alternatives/bacula-sd | grep --silent sqlite; then
6e2fc90
    /usr/sbin/alternatives --set libbaccats.so %{_libdir}/libbaccats-sqlite3.so
ddc6de9
else
6e2fc90
    /usr/sbin/alternatives --set libbaccats.so %{_libdir}/libbaccats-postgresql.so
ddc6de9
fi
6e2fc90
%{?ldconfig}
16d9a36
964c499
%preun libs-sql
e45f06f
if [ "$1" = 0 ]; then
6e2fc90
    /usr/sbin/alternatives --remove libbaccats.so %{_libdir}/libbaccats-mysql.so
6e2fc90
    /usr/sbin/alternatives --remove libbaccats.so %{_libdir}/libbaccats-sqlite3.so
6e2fc90
    /usr/sbin/alternatives --remove libbaccats.so %{_libdir}/libbaccats-postgresql.so
e45f06f
fi
3b2d941
6e2fc90
%ldconfig_postun libs-sql
4dac1ea
0745245
%pre common
e004908
getent group %username >/dev/null || groupadd -g %uid -r %username &>/dev/null || :
e004908
getent passwd %username >/dev/null || useradd -u %uid -r -s /sbin/nologin \
e004908
    -d /var/spool/bacula -M -c 'Bacula Backup System' -g %username %username &>/dev/null || :
e004908
exit 0
4dac1ea
2529f6c
%post client
2529f6c
%systemd_post %{name}-fd.service
2529f6c
2529f6c
%preun client
2529f6c
%systemd_preun %{name}-fd.service
2529f6c
2529f6c
%postun client
2529f6c
%systemd_postun_with_restart %{name}-fd.service
2529f6c
2529f6c
%post director
2529f6c
%systemd_post %{name}-dir.service
2529f6c
2529f6c
%preun director
2529f6c
%systemd_preun %{name}-dir.service
2529f6c
2529f6c
%postun director
2529f6c
%systemd_postun_with_restart %{name}-dir.service
2529f6c
2529f6c
%post storage
2529f6c
%systemd_post %{name}-sd.service
2529f6c
2529f6c
%preun storage
2529f6c
%systemd_preun %{name}-sd.service
2529f6c
2529f6c
%postun storage
2529f6c
%systemd_postun_with_restart %{name}-sd.service
2529f6c
8390fc1
%files libs
e3a719c
%license LICENSE
b5979e3
%doc AUTHORS ChangeLog SUPPORT ReleaseNotes LICENSE-FAQ LICENSE-FOSS
8390fc1
%{_libdir}/libbac-%{version}.so
964c499
%{_libdir}/libbaccfg-%{version}.so
964c499
%{_libdir}/libbacfind-%{version}.so
f89001f
%{_libdir}/libbacsd-%{version}.so
964c499
964c499
%files libs-sql
6e2fc90
# On Fedora 28 this gets recreated automatically even if the library is
6e2fc90
# deleted in the install section.
a38ed26
# On EPEL 6 this is required until RPM assembly time or an error is given due
a38ed26
# to the missing library.
a38ed26
# So: leave the library in place until the very end and just exclude it.
a303913
%exclude %{_libdir}/libbaccats-%{version}.so
bf9089a
%{_libdir}/libbaccats-mysql-%{version}.so
bf9089a
%{_libdir}/libbaccats-mysql.so
bf9089a
%{_libdir}/libbaccats-postgresql-%{version}.so
bf9089a
%{_libdir}/libbaccats-postgresql.so
bf9089a
%{_libdir}/libbaccats-sqlite3-%{version}.so
bf9089a
%{_libdir}/libbaccats-sqlite3.so
bf9089a
%{_libdir}/libbacsql-%{version}.so
0745245
0745245
%files common
021eba8
%doc README.Redhat quickstart_*
0745245
%config(noreplace) %{_sysconfdir}/logrotate.d/bacula
2354547
%dir %{_localstatedir}/log/bacula %attr(750, bacula, bacula)
2354547
%dir %{_localstatedir}/spool/bacula %attr(750, bacula, bacula)
16d9a36
%dir %{_libexecdir}/%{name}
2354547
%dir %{_sysconfdir}/%{name} %attr(755,root,root)
16d9a36
%{_libexecdir}/%{name}/btraceback.dbx
16d9a36
%{_libexecdir}/%{name}/btraceback.gdb
16d9a36
%{_libexecdir}/%{name}/bacula_config
16d9a36
%{_libexecdir}/%{name}/btraceback.mdb
fa942d0
%{_mandir}/man8/btraceback.8*
2354547
%{_sbindir}/btraceback
0745245
bf9089a
%files director
145c1df
%doc updatedb examples/sample-query.sql
2354547
%config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf %attr(640,root,bacula)
2354547
%config(noreplace) %{_sysconfdir}/bacula/query.sql %attr(640,root,bacula)
16d9a36
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir
f89001f
%{_libexecdir}/%{name}/baculabackupreport
16d9a36
%{_libexecdir}/%{name}/create_bacula_database
16d9a36
%{_libexecdir}/%{name}/delete_catalog_backup
16d9a36
%{_libexecdir}/%{name}/drop_bacula_database
16d9a36
%{_libexecdir}/%{name}/drop_bacula_tables
16d9a36
%{_libexecdir}/%{name}/grant_bacula_privileges
16d9a36
%{_libexecdir}/%{name}/make_bacula_tables
16d9a36
%{_libexecdir}/%{name}/make_catalog_backup.pl
16d9a36
%{_libexecdir}/%{name}/update_bacula_tables
16d9a36
%{_libexecdir}/%{name}/create_mysql_database
16d9a36
%{_libexecdir}/%{name}/drop_mysql_database
16d9a36
%{_libexecdir}/%{name}/drop_mysql_tables
16d9a36
%{_libexecdir}/%{name}/grant_mysql_privileges
16d9a36
%{_libexecdir}/%{name}/make_mysql_tables
16d9a36
%{_libexecdir}/%{name}/update_mysql_tables
16d9a36
%{_libexecdir}/%{name}/create_sqlite3_database
16d9a36
%{_libexecdir}/%{name}/drop_sqlite3_database
16d9a36
%{_libexecdir}/%{name}/drop_sqlite3_tables
16d9a36
%{_libexecdir}/%{name}/grant_sqlite3_privileges
16d9a36
%{_libexecdir}/%{name}/make_sqlite3_tables
16d9a36
%{_libexecdir}/%{name}/update_sqlite3_tables
16d9a36
%{_libexecdir}/%{name}/create_postgresql_database
16d9a36
%{_libexecdir}/%{name}/drop_postgresql_database
16d9a36
%{_libexecdir}/%{name}/drop_postgresql_tables
16d9a36
%{_libexecdir}/%{name}/grant_postgresql_privileges
16d9a36
%{_libexecdir}/%{name}/make_postgresql_tables
16d9a36
%{_libexecdir}/%{name}/update_postgresql_tables
2354547
%{_mandir}/man1/bsmtp.1*
2354547
%{_mandir}/man8/bacula-dir.8*
2354547
%{_mandir}/man8/bregex.8*
2354547
%{_mandir}/man8/bwild.8*
2354547
%{_mandir}/man8/dbcheck.8*
2354547
%{_sbindir}/bacula-dir
f89001f
%{_sbindir}/bdirjson
2354547
%{_sbindir}/bregex
2354547
%{_sbindir}/bsmtp
2354547
%{_sbindir}/bwild
2354547
%{_sbindir}/dbcheck
2354547
%{_unitdir}/bacula-dir.service
0745245
1fabaac
%files logwatch
1fabaac
%config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
1fabaac
%config(noreplace) %{_sysconfdir}/logwatch/conf/services/bacula.conf
1fabaac
%{_sysconfdir}/logwatch/scripts/services/bacula
1fabaac
%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
1fabaac
900706a
%files storage
2354547
%config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf %attr(640,root,root)
16d9a36
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd
5fd2356
%{_libexecdir}/%{name}/disk-changer
e1c3953
%{_libexecdir}/%{name}/isworm
5fd2356
%{_libexecdir}/%{name}/mtx-changer
5fd2356
%{_libexecdir}/%{name}/mtx-changer.conf
f89001f
%{_libexecdir}/%{name}/tapealert
fa942d0
%{_mandir}/man8/bacula-sd.8*
fa942d0
%{_mandir}/man8/bcopy.8*
fa942d0
%{_mandir}/man8/bextract.8*
fa942d0
%{_mandir}/man8/bls.8*
fa942d0
%{_mandir}/man8/bscan.8*
fa942d0
%{_mandir}/man8/btape.8*
2354547
%{_sbindir}/bacula-sd
2354547
%{_sbindir}/bcopy
2354547
%{_sbindir}/bextract
2354547
%{_sbindir}/bls
2354547
%{_sbindir}/bscan
f89001f
%{_sbindir}/bsdjson
2354547
%{_sbindir}/btape
2354547
%{_unitdir}/bacula-sd.service
2354547
7dc2ef0
%files client
2354547
%config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf %attr(640,root,root)
2354547
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-fd
2354547
%{_mandir}/man8/bacula-fd.8*
6111889
%{_libdir}/%{name}/bpipe-fd.so
1e67f51
%{_libdir}/%{name}/cdp-fd.so
6111889
%{_libdir}/%{name}/docker-fd.so
7dc2ef0
%{_sbindir}/bacula-fd
f89001f
%{_sbindir}/bfdjson
1e67f51
%{_sbindir}/cdp-client
7dc2ef0
%{_unitdir}/bacula-fd.service
7dc2ef0
7dc2ef0
%files console
2354547
%config(noreplace) %{_sysconfdir}/bacula/bconsole.conf %attr(640,root,root)
fa942d0
%{_mandir}/man8/bconsole.8*
2354547
%{_sbindir}/bconsole
f89001f
%{_sbindir}/bbconsjson
7dc2ef0
7dc2ef0
%files console-bat
2354547
%config(noreplace) %{_sysconfdir}/bacula/bat.conf %attr(640,root,root)
f89001f
%{_datadir}/applications/bat.desktop
65662da
%{_datadir}/bacula/*.html
65662da
%{_datadir}/bacula/*.png
f89001f
%{_datadir}/pixmaps/bat_icon.png
2354547
%{_mandir}/man1/bat.1*
2354547
%{_sbindir}/bat
367ff02
230fff0
%files traymonitor
a6a727a
%config(noreplace) %{_sysconfdir}/bacula/bacula-tray-monitor.conf %attr(640,root,root)
08f1b7d
%{_datadir}/applications/bacula-tray-monitor.desktop
230fff0
%{_datadir}/pixmaps/bacula-tray-monitor.png
2354547
%{_mandir}/man1/bacula-tray-monitor.1*
2354547
%{_sbindir}/bacula-tray-monitor
7dc2ef0
3b6cb34
%files devel
3b6cb34
%{_includedir}/bacula
8e73d46
%{_libdir}/libbac.so
8e73d46
%{_libdir}/libbaccfg.so
8e73d46
%{_libdir}/libbacfind.so
f89001f
%{_libdir}/libbacsd.so
8e73d46
%{_libdir}/libbacsql.so
8e73d46
230fff0
%files -n nagios-plugins-bacula
230fff0
%{_libdir}/nagios/plugins/check_bacula
0745245
0745245
%changelog
657fef9
* Fri Apr 16 2021 Simone Caronni <negativo17@gmail.com> - 11.0.2-3
657fef9
- All scripts require sh, so use that also for the backup report.
657fef9
4df972f
* Fri Apr 16 2021 Simone Caronni <negativo17@gmail.com> - 11.0.2-2
4df972f
- Remove dash build requirement.
4df972f
6e8326d
* Fri Apr 16 2021 Simone Caronni <negativo17@gmail.com> - 11.0.2-1
6e8326d
- Update to 11.0.2.
6e8326d
a41734c
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 11.0.1-2
a41734c
- Rebuilt for updated systemd-rpm-macros
a41734c
  See https://pagure.io/fesco/issue/2583.
a41734c
f430161
* Thu Feb 11 2021 Simone Caronni <negativo17@gmail.com> - 11.0.1-1
f430161
- Update to 11.0.1.
f430161
a303289
* Mon Feb 08 2021 Pavel Raiskup <praiskup@redhat.com> - 11.0.0-5
a303289
- rebuild for libpq ABI fix rhbz#1908268
a303289
46bdc7e
* Thu Jan 28 2021 Simone Caronni <negativo17@gmail.com> - 11.0.0-4
46bdc7e
- Remove leftover ImageMagick build requirement.
46bdc7e
a65350e
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11.0.0-3
a65350e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
a65350e
1e67f51
* Fri Jan 15 2021 Simone Caronni <negativo17@gmail.com> - 11.0.0-2
1e67f51
- Build CDP plugin components.
1e67f51
6111889
* Tue Jan 12 2021 Simone Caronni <negativo17@gmail.com> - 11.0.0-1
6111889
- Update to 11.0.0.
6111889
- Enable Docker plugin.
6111889
15230d8
* Tue Jan 12 2021 Simone Caronni <negativo17@gmail.com> - 9.6.7-1
15230d8
- Update to 9.6.7.
15230d8
- Drop support for building on CentOS/RHEL 6 and upgrades from version 2.4.
15230d8
- Trim changelog.
15230d8
0acb600
* Wed Oct 07 2020 Simone Caronni <negativo17@gmail.com> - 9.6.6-1
0acb600
- Update to 9.6.6.
0acb600
7ed76fa
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.6.5-2
7ed76fa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
7ed76fa
db8f94b
* Fri Jul 24 2020 Simone Caronni <negativo17@gmail.com> - 9.6.5-1
db8f94b
- Update to 9.6.5.
db8f94b
fa08626
* Tue Mar 17 2020 Simone Caronni <negativo17@gmail.com> - 9.6.3-1
fa08626
- Update to 9.6.3.
fa08626
ab134d0
* Thu Mar 05 2020 Simone Caronni <negativo17@gmail.com> - 9.6.2-2
ab134d0
- Fix RHEL/CentOS 6 builds.
ab134d0
184ea64
* Sat Feb 29 2020 Simone Caronni <negativo17@gmail.com> - 9.6.2-1
184ea64
- Update to 9.6.2.
184ea64
7278ebf
* Mon Feb 10 2020 Václav Doležal <vdolezal@redhat.com> - 9.4.4-4
7278ebf
- Fix FTBFS (#1799185)
7278ebf
48e34c9
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.4-3
48e34c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
48e34c9
14b1674
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.4-2
14b1674
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
14b1674
9e04034
* Wed May 29 2019 Simone Caronni <negativo17@gmail.com> - 9.4.4-1
9e04034
- Update to 9.4.4.
9e04034
789c54e
* Sat May 18 2019 Simone Caronni <negativo17@gmail.com> - 9.4.3-2
789c54e
- SPEC file cleanups.
789c54e
35d34b2
* Wed May 15 2019 Simone Caronni <negativo17@gmail.com> - 9.4.3-1
35d34b2
- Update to 9.4.3.
35d34b2
5b12550
* Thu Apr 18 2019 Simone Caronni <negativo17@gmail.com> - 9.4.2-1
5b12550
- Update to 9.4.2.
5b12550
9cd6e60
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 9.4.1-6
9cd6e60
- Rebuild for readline 8.0
9cd6e60
59455ba
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.1-5
59455ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
59455ba
da98dcc
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 9.4.1-4
da98dcc
- Rebuilt for libcrypt.so.2 (#1666033)
da98dcc
83856b5
* Sun Jan 13 2019 Simone Caronni <negativo17@gmail.com> - 9.4.1-3
83856b5
- Build QT programs with QT 5 on RHEL/CentOS 7. Also, reduce the number of
83856b5
  required QT packages for building.
83856b5
4ee7c4d
* Sun Jan 13 2019 Simone Caronni <negativo17@gmail.com> - 9.4.1-2
4ee7c4d
- Add Debian patch to enable/disable S3 support at configure time.
4ee7c4d
- Disable S3 as it does not currently build:
4ee7c4d
  http://bugs.bacula.org/view.php?id=2446
4ee7c4d
- Update RPM macros.
4ee7c4d
041e434
* Sat Jan 12 2019 Simone Caronni <negativo17@gmail.com> - 9.4.1-1
041e434
- Update to 9.4.1.
041e434
e1c3953
* Sat Jan 12 2019 Simone Caronni <negativo17@gmail.com> - 9.4.0-1
e1c3953
- Update to 9.4.0.
e1c3953
3065577
* Sat Jan 12 2019 Simone Caronni <negativo17@gmail.com> - 9.2.1-2
3065577
- Make the build succeed also on supported RHEL and Fedora releases.
3065577
- Remove Fedora 27 references.