%define _hardened_build 1 %define working_dir /var/spool/bacula2 %define script_dir /usr/libexec/bacula2 Summary: Backup client for bacula version 2 server Name: bacula2 Version: 2.4.4 Release: 27%{?dist} # See LICENSE for details License: GPLv2 with exceptions Source0: http://downloads.sf.net/bacula/bacula-%{version}.tar.gz Source8: bacula2-fd.service Patch0: bacula2-2.4.4-utf8.patch Patch1: bacula2-config.patch Patch2: bacula2-3.0.2-openssl.patch Patch3: bacula2-2.4.4-python27.patch Patch4: bacula2-2.4.4-daemon-name.patch # lib/sha1* are non-free (but distributable) Patch5: bacula-2.4.4-non-free-code.patch URL: http://www.bacula.org/ BuildRequires: compat-openssl10-devel, perl-interpreter BuildRequires: libacl-devel, zlib-devel, python-devel, BuildRequires: libstdc++-devel, libxml2-devel, pkgconfig BuildRequires: glibc-devel, sed, systemd # This is actually tcp_wrappers-devel but I don't want to deviate from the main # Fedora/EPEL packages without good reason. BuildRequires: /usr/include/tcpd.h %description Bacula is a set of programs that allow you to manage the backup, recovery, and verification of computer data across a network of different computers. It is based on a client/server architecture and is efficient and relatively easy to use, while offering many advanced storage management features that make it easy to find and recover lost or damaged files. The bacula2 packages are clients suitable for use with a bacula version 2.x server (director), since later clients are incompatible. %package client Summary: Bacula backup client Group: System Environment/Daemons Requires: bacula2-common = %{version}-%{release} %description client Bacula is a set of programs that allow you to manage the backup, recovery, and verification of computer data across a network of different computers. It is based on a client/server architecture. This package contains the bacula version 2 client, the daemon running on the system to be backed up to a bacula version 2 server (director). %package common Summary: Common Bacula utilities Group: System Environment/Daemons Requires(pre): shadow-utils %description common Bacula is a set of programs that allow you to manage the backup, recovery, and verification of computer data across a network of different computers. It is based on a client/server architecture. The bacula2 packages are clients suitable for use with a bacula version 2.x server (director), since later clients are incompatible. %prep %setup -q -n bacula-%{version} # Patching and other source preparation %patch0 -p1 %patch1 -p1 %patch2 -p2 %patch3 -p0 %patch5 -p1 # Remove execution permissions from files we're packaging as docs later on find examples -type f | xargs chmod -x find updatedb -type f | xargs chmod -x # Fix perms of c files to silent rpmlint for debuginfo chmod -x src/console/conio.c %build # GCC 4.3+/glibc detects a false positive buffer overflow in bacula 2.4 so we # need to disable FORTIFY_SOURCE: # - http://www.mail-archive.com/bacula-devel@lists.sourceforge.net/msg01786.html # - http://bugs.bacula.org/view.php?id=1220 # - http://bugs.bacula.org/view.php?id=1042 CFLAGS="$(echo %{optflags}|sed s/-D_FORTIFY_SOURCE=./-U_FORTIFY_SOURCE/)" \ %configure \ --sysconfdir=%{_sysconfdir}/bacula2 \ --with-fd-user=root \ --with-fd-group=root \ --with-fd-password=@@FD_PASSWORD@@ \ --with-mon-dir-password=@@MON_DIR_PASSWORD@@ \ --with-mon-fd-password=@@MON_FD_PASSWORD@@ \ --with-mon-sd-password=@@MON_SD_PASSWORD@@ \ --with-working-dir=%{working_dir} \ --with-scriptdir=%{script_dir} \ --with-smtp-host=localhost \ --with-subsys-dir=%{_localstatedir}/lock/subsys \ --with-pid-dir=%{_localstatedir}/run \ --enable-client-only \ --enable-largefile \ --with-openssl \ --with-tcp-wrappers \ --with-python \ --enable-smartalloc %{__make} %{?_smp_mflags} %install make install DESTDIR=%{buildroot} # Desktop Integration for the console apps and the traymonitor mkdir -p %{buildroot}%{_bindir} # Initscript install -m 755 -D %{SOURCE8} %{buildroot}%{_unitdir}/bacula2-fd.service # Create the spool directory (bacula user's home directory) mkdir -p %{buildroot}%{_localstatedir}/spool/bacula2 # rename files so that they don't interfer with the main bacula package mv %{buildroot}%{_sbindir}/bacula-fd %{buildroot}%{_sbindir}/bacula2-fd mv %{buildroot}%{_mandir}/man8/bacula-fd.8.gz %{buildroot}%{_mandir}/man8/bacula2-fd.8.gz # Nuke commands we do not need rm -vf %{buildroot}%{_sbindir}/{bconsole,btraceback} # Nuke the scripts we do not need rm -rvf %{buildroot}%{_libexecdir}/ # Nuke manpages for commands we do not ship rm -vf %{buildroot}%{_mandir}/man1/{bat,bsmtp,bacula-bgnome-console,bacula-bwxconsole,bacula-tray-monitor}.1.gz rm -vf %{buildroot}%{_mandir}/man8/{bacula,bacula-*,bconsole,bcopy,bextract,bls,bscan,btape,btraceback,dbcheck}.8.gz # Nuke config files rm -vf %{buildroot}%{_sysconfdir}/bacula2/bconsole.conf # Fix up some perms so rpmlint does not complain too much chmod 755 %{buildroot}%{_sbindir}/* %pre common getent group bacula >/dev/null || groupadd -r bacula getent passwd bacula >/dev/null || \ useradd -r -s /sbin/nologin -d %{_localstatedir}/spool/bacula2 -M \ -c 'Bacula Backup System' -g bacula bacula exit 0 %post client %systemd_post bacula2-fd.service %preun client %systemd_preun bacula2-fd.service %postun client %systemd_postun_with_restart bacula2-fd.service %files common %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING LICENSE README SUPPORT VERIFYING examples/ %dir %{_sysconfdir}/bacula2/ %dir %attr(750, bacula, bacula) %{_localstatedir}/spool/bacula2/ %files client %defattr(-,root,root,-) %{_sbindir}/bacula2-fd %{_unitdir}/bacula2-fd.service %config(noreplace) %{_sysconfdir}/bacula2/bacula-fd.conf %{_mandir}/man8/bacula2-fd.8* %changelog * Wed Aug 02 2017 Fedora Release Engineering - 2.4.4-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 2.4.4-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Tue Mar 14 2017 Jon Ciesla - 2.4.4-25 - systemd cleanup. * Tue Feb 21 2017 Jon Ciesla - 2.4.4-24 - Use compat-openssl10 * Fri Feb 10 2017 Fedora Release Engineering - 2.4.4-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Feb 03 2016 Fedora Release Engineering - 2.4.4-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Wed Jun 17 2015 Fedora Release Engineering - 2.4.4-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat May 02 2015 Kalev Lember - 2.4.4-20 - Rebuilt for GCC 5 C++11 ABI change * Fri Aug 15 2014 Fedora Release Engineering - 2.4.4-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 2.4.4-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu Feb 20 2014 Jon Ciesla - 2.4.4-17 - Fix directory ownership conflict, BZ 1015688. - Date fixups. * Sat Aug 03 2013 Fedora Release Engineering - 2.4.4-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Tue May 28 2013 Tom Callaway - 2.4.4-15 - drop non-free sha1 code bits * Wed Feb 13 2013 Fedora Release Engineering - 2.4.4-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Jul 18 2012 Fedora Release Engineering - 2.4.4-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Apr 12 2012 Jon Ciesla - 2.4.4-12 - Added hardened build. * Mon Mar 19 2012 Jon Ciesla - 2.4.4-11 - Additional patch for 799167. * Tue Mar 06 2012 Jon Ciesla - 2.4.4-10 - Fix PID listed in unit file, BZ 799167. * Thu Jan 12 2012 Fedora Release Engineering - 2.4.4-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Nov 22 2011 Jon Ciesla 2.4.4-8 - Migrated to systemd, BZ 754475. * Mon Feb 07 2011 Fedora Release Engineering - 2.4.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Fri Jul 30 2010 Jon Ciesla 2.4.4-6 - Python 2.7 patch. * Fri Jul 30 2010 Jon Ciesla 2.4.4-5 - Python 2.7 rebuild. * Mon Mar 22 2010 Jon Ciesla 2.4.4-4 - Renamed sources and patches to avoid clobering Bacula SRPM. * Sat Feb 6 2010 Felix Schwarz 2.4.4-3 - Changed all names to bacula2 so that the package can be installed in parallel to a modern bacula package - Disabled FORTIFY_SOURCE due - GCC 4.3+ detects false positive * Fri Feb 5 2010 Paul Howarth 2.4.4-2 - Fork to bacula2, a client-only package to support use of bacula version 2 servers on more recent distributions * Wed Jan 14 2009 Jon Ciesla 2.4.4-1 - Update to 2.4.4, fix alternatives. * Thu Sep 13 2007 Andreas Thienemann 2.0.3-10 - Applied restore fix to sd. #288981 * Wed Jul 25 2007 Andreas Thienemann 2.0.3-9 - Corrected the %%post alternatives calls. Fixing #249560. * Thu Jul 19 2007 Andreas Thienemann 2.0.3-8 - Moved some files around in the %%files section and refactored spec parts a bit - Fixed up the catalog-backup scripts by including them in the alternatives system - Applied tls patch fixing some tls disconnection issues. * Wed Jul 18 2007 Andreas Thienemann 2.0.3-7 - Minor specchanges, mostly typos in the comments - Incorporated minor changes from dgilmore's review. * Fri Jul 13 2007 Andreas Thienemann 2.0.3-6 - Fixing %%preun scripts. Thx to Dan for spotting this * Fri Jul 13 2007 Andreas Thienemann 2.0.3-5 - Fixed provides and requires * Wed Jul 11 2007 Andreas Thienemann 2.0.3-4 - Fixed many rpmlint issues * Thu Apr 26 2007 Andreas Thienemann 2.0.3-3 - Final cleanups for fedora - Removed webgui for now. It will be back in a future release - Added LANG=C calls to the initscripts * Thu Apr 26 2007 Andreas Thienemann 2.0.3-2 - Added logdir - Fixed up doc-creation to actually work - Fixed up web interface - Included docs sub-package - Included README et al as docs where appropriate * Sat Mar 10 2007 Andreas Thienemann 2.0.3-1 - Updated to 2.0.3 - Reverted the database-check as we're not sure the db is running on the local machine. A later revision might parse the bacula-dir.conf file and just connect to the db to see if it's running. * Wed Feb 28 2007 Andreas Thienemann 2.0.2-1 - Further updates on the spec * Sun Feb 18 2007 Andreas Thienemann 2.0.2-1 - Much work on the spec - Updated to 2.0.2 * Sat Feb 18 2006 Andreas Thienemann 1.38.11-1 - Initial spec.