%{!?perl_vendorlib: %define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`" ; echo $installvendorlib)} %{!?perl_vendorarch: %define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)} %{!?perl_version: %define perl_version %(eval "`%{__perl} -V:version`" ; echo $version)} %define bacula_ver 5.0.3 %define rescue_ver 5.0.2 %define sel_modn selinux-policy-addon %define sel_modv 0.2.0 Summary: Bacula - The Network Backup Solution Name: bacula Version: %{bacula_ver} Release: 1%{?dist}%{?pext} License: AGPLv3 Group: System Environment/Base Source0: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-%{bacula_ver}.tar.gz Source1: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-docs-%{bacula_ver}.tar.bz2 Source2: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-gui-%{bacula_ver}.tar.gz Source3: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-rescue-%{rescue_ver}.tar.gz Source10: %{name}-dir.init Source11: %{name}-sd.init Source12: %{name}-fd.init Source15: %{name}-dir.sysconfig Source16: %{name}-sd.sysconfig Source17: %{name}-fd.sysconfig Source20: %{name}-bimagemgr.conf Source21: %{name}-bweb.conf Source22: %{name}-web.conf Source30: %{name}-rescue-%{rescue_ver}-missing.tar.gz #Patch0: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{version}-xxx.patch Patch10: %{name}-5.0.3-build.patch Patch11: %{name}-3.0.2-paths.patch Patch12: %{name}-5.0.3-cats.patch Patch13: %{name}-5.0.1-wxwin.patch Patch14: %{name}-gui-2.2.8-config.patch Patch15: %{name}-gui-2.4.3-install.patch Patch16: %{name}-rescue-3.0.1-build.patch Patch20: %{name}-3.0.2-fd_acl_not_impl.patch Patch21: %{name}-5.0.3-clientrunbeforejob.patch URL: http://www.%{name}.org/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Vendor: The Bacula Team Requires(pre): /usr/sbin/groupadd /usr/sbin/useradd Requires(post): /sbin/ldconfig openssl BuildRequires: gettext httpd mkisofs mtx pkgconfig BuildRequires: tcp_wrappers tetex-latex libtermcap-devel BuildRequires: libacl-devel libstdc++-devel openssl-devel BuildRequires: mysql-devel postgresql-devel sqlite-devel BuildRequires: python-devel readline-devel libxml2-devel BuildRequires: glib2-devel gtk2-devel pango-devel latex2html BuildRequires: libcap-devel ncurses-devel zlib-devel BuildRequires: perl(CGI) perl(DBI) perl(Date::Calc) perl(Expect) BuildRequires: perl(GD::Graph) perl(GD) perl(HTML::Template) BuildRequires: perl(Time::ParseDate) %description Bacula is a set of computer programs that permit you to manage backup, recovery and verification of computer data across a network of computers of different kinds. In technical terms, it is a network client/server based backup program. Bacula is relatively easy to use and efficient, while offering many advanced storage management features that make it easy to find and recover lost or damaged files. This package contains common files required for all packages. %package client Summary: The Bacula backup client Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} Requires: gdb Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig /sbin/service Requires(postun): /sbin/service %description client This package contains the Bacula File service (also known as the Client program) which is the software program that is installed on the machine to be backed up. It is specific to the operating system on which it runs and is responsible for providing file attributes and data when requested by the Director. The File services are also responsible for the file system dependent part of restoring the file attributes and data during a recovery operation. %package client-rescue Summary: The Bacula Rescue CD builder Group: Applications/System Requires: %{name}-client = %{version}-%{release} Requires: cdrecord mkisofs %description client-rescue This package contains the Bacula Rescue CD builder, used to build a boot CD which contains a copy of the current system, that can be booted in an emergency to either repair the filesystems, or to load the Bacula File service to recover the system. %package console Summary: The Bacula command console Group: Applications/System Requires: %{name} = %{version}-%{release} %description console This package contains the Bacula Console service, which is the program that allows the administrator or user to communicate with the Bacula Director. It provides a text-based console interface. %package doc Summary: The Bacula documentation Group: Documentation %description doc This package contains the complete Bacula documentation in HTML and PDF format. %package gui-bimagemgr Summary: The Bacula bimagemgr utility Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires: cdrecord httpd mkisofs %description gui-bimagemgr This package contains bimagemgr, an utility to manage backups made to files intended for burning to CD-R disk. bimagemgr allows you to easily see which Volumes have been written to more recently than they have been recorded to CD-R disk and record those which have. %package gui-bimagemgr-selinux Summary: SELinux support for %{name}-gui-bimagemgr Group: System Environment/Base Requires: %{name}-gui-bimagemgr = %{version}-%{release} Requires: %{sel_modn} >= %{sel_modv} Requires(post): /sbin/restorecon %{_sbindir}/selinuxenabled /sbin/fixfiles %description gui-bimagemgr-selinux This package enables %{name}-gui-bimagemgr to work with SELinux. %package gui-brestore Summary: The Bacula brestore utility Group: Applications/Internet Requires: %{name}-console = %{version}-%{release} %description gui-brestore This package contains brestore, a graphical file restoration interface. %package gui-bweb Summary: The Bacula bweb utility Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires: bitstream-vera-fonts httpd Requires: perl(:MODULE_COMPAT_%{perl_version}) %description gui-bweb This package contains bweb, a web based interface for Bacula servers. %package gui-bweb-selinux Summary: SELinux support for %{name}-gui-bweb Group: System Environment/Base Requires: %{name}-gui-bweb = %{version}-%{release} Requires: %{sel_modn} >= %{sel_modv} Requires(post): /sbin/restorecon %{_sbindir}/selinuxenabled /sbin/fixfiles %description gui-bweb-selinux This package enables %{name}-gui-bweb to work with SELinux. %package gui-monitor Summary: The Bacula tray monitor Group: Applications/System Requires: %{name} = %{version}-%{release} %description gui-monitor This package contains the Bacula Monitor service which is the program that allows the administrator or user to watch current status of Bacula Directors (DIR), Bacula File Daemons (FD) and Bacula Storage Daemons (SD). Currently, only a GTK+ version is available, which works with Gnome, KDE, or any window manager that supports the FreeDesktop.org system tray standard. %package gui-web Summary: The Bacula web utility Group: Applications/Internet Requires: httpd php-gd php-gettext php-session php-pear(DB) %description gui-web This package contains %{name}-web, a web server based utility to monitor your Bacula server. %package server-sqlite Summary: The Bacula server for SQLite backends Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} Requires: gdb Requires(post): /sbin/chkconfig /sbin/ldconfig Requires(preun): /sbin/chkconfig /sbin/service Requires(postun): /sbin/ldconfig /sbin/service Conflicts: %{name}-server-mysql %{name}-server-postgresql %description server-sqlite This package contains the Bacula server daemons which use SQLite as database backend for the Catalog service. The Bacula Director service is the program that supervises all the backup, restore, verify and archive operations. The system administrator uses the Bacula Director to schedule backups and to recover files. The Director runs as a daemon in the background. The Bacula Storage services consist of the software programs that perform the storage and recovery of the file attributes and data to the physical backup media or volumes. In other words, the Storage daemon is responsible for reading and writing your tapes (or other storage media, e.g. files). It runs as a daemon on the machine that has the backup device (usually a tape drive). %package server-mysql Summary: The Bacula server for MySQL backends Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} Requires: gdb Requires(post): /sbin/chkconfig /sbin/ldconfig Requires(preun): /sbin/chkconfig /sbin/service Requires(postun): /sbin/ldconfig /sbin/service Conflicts: %{name}-server-sqlite %{name}-server-postgresql %description server-mysql This package contains the Bacula server daemons which use MySQL as database backend for the Catalog service. The Bacula Director service is the program that supervises all the backup, restore, verify and archive operations. The system administrator uses the Bacula Director to schedule backups and to recover files. The Director runs as a daemon in the background. The Bacula Storage services consist of the software programs that perform the storage and recovery of the file attributes and data to the physical backup media or volumes. In other words, the Storage daemon is responsible for reading and writing your tapes (or other storage media, e.g. files). It runs as a daemon on the machine that has the backup device (usually a tape drive). %package server-postgresql Summary: The Bacula server for PostgreSQL backends Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} Requires: gdb Requires(post): /sbin/chkconfig /sbin/ldconfig Requires(preun): /sbin/chkconfig /sbin/service Requires(postun): /sbin/ldconfig /sbin/service Conflicts: %{name}-server-sqlite %{name}-server-mysql %description server-postgresql This package contains the Bacula server daemons which use PostgreSQL as a database backend for the Catalog service. The Bacula Director service is the program that supervises all the backup, restore, verify and archive operations. The system administrator uses the Bacula Director to schedule backups and to recover files. The Director runs as a daemon in the background. The Bacula Storage services consist of the software programs that perform the storage and recovery of the file attributes and data to the physical backup media or volumes. In other words, the Storage daemon is responsible for reading and writing your tapes (or other storage media, e.g. files). It runs as a daemon on the machine that has the backup device (usually a tape drive). %prep %setup -q -a 1 -a 2 -a 3 -a 30 # Upstream patches #%patch0 -p0 # Local patches %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch20 -p1 pushd %{name}-gui-%{bacula_ver} %patch14 -p0 %patch15 -p0 popd pushd %{name}-rescue-%{rescue_ver} %patch16 -p1 popd # Contrib patches %patch21 -p1 # Fix permissions %{__chmod} 0644 %{name}-rescue-%{rescue_ver}/Makefile.in pushd examples find -type f -name "*.pl" -exec %{__chmod} a-x {} \; %{__chmod} a-x afs-%{name} reports/checkhost popd # Cleanup find -type f -name "*.orig" -exec %{__rm} -f {} \; %build BuildApp() { %configure \ CFLAGS="${CFLAGS} -DOPENSSL_NO_KRB5" \ CPPFLAGS="${CPPFLAGS} -DOPENSSL_NO_KRB5" \ --sbindir=%{_bindir} \ --sysconfdir=%{_sysconfdir}/%{name} \ --htmldir=%{_datadir}/%{name}/html \ --with-scriptdir=%{_sysconfdir}/%{name}/scripts \ --with-plugindir=%{_libdir}/%{name} \ --with-archivedir=/tmp \ --disable-bat \ --enable-tray-monitor \ --disable-bwx-console \ --enable-lockmgr \ --enable-ipv6 \ --enable-batch-insert \ --with-openssl \ --with-python \ --with-readline=%{_includedir}/readline \ --disable-conio \ --with-tcp-wrappers \ --with-dir-user=%{name} \ --with-dir-group=%{name} \ --with-sd-user=%{name} \ --with-sd-group=disk \ --with-fd-user=root \ --with-fd-group=%{name} \ --with-working-dir=%{_localstatedir}/lib/%{name} \ --with-basename="XXX_HOSTNAME_XXX" \ --with-dir-password="XXX_DIR_PASS_XXX" \ --with-fd-password="XXX_FD_PASS_XXX" \ --with-sd-password="XXX_SD_PASS_XXX" \ --with-mon-dir-password="XXX_DIR_MON_PASS_XXX" \ --with-mon-fd-password="XXX_FD_MON_PASS_XXX" \ --with-mon-sd-password="XXX_SD_MON_PASS_XXX" \ ${1} %{__make} %{?_smp_mflags} if [ -n "${2}" ]; then LIB=$(basename src/cats/.libs/libbacsql-*.so) NLIB=$(echo ${LIB} | %{__sed} -e "s/-/-${2}-/") %{__cp} -f src/cats/.libs/${LIB} src/${NLIB} %{__cp} -f scripts/bacula_config scripts/bacula_config-${2} else %{__cp} -f src/filed/static-bacula-fd src fi } # static-fd: static linking against OpenSSL isn't possible anymore! # libssl.a -> keyutils.a (dropped by upstream) BuildApp "--enable-static-fd --enable-client-only --disable-libtool \ --without-openssl --without-python --without-tcp-wrappers \ --disable-bat --disable-tray-monitor --disable-bwx-console \ ac_cv_lib_cap_cap_set_proc=no" BuildApp "--with-sqlite3" "sqlite" BuildApp "--with-mysql" "mysql" BuildApp "--with-postgresql" "pgsql" # Build extra GUI's pushd %{name}-gui-%{bacula_ver} %configure \ --sysconfdir=%{_sysconfdir}/%{name} \ --with-bacula=`pwd`/.. \ --with-bimagemgr-cgidir=%{_datadir}/%{name}/bimagemgr/cgi-bin \ --with-bimagemgr-docdir=%{_datadir}/%{name}/bimagemgr/html pushd bweb %{__perl} \ Makefile.PL \ INSTALLDIRS="vendor" %{__make} %{?_smp_mflags} popd popd # Build rescue files pushd %{name}-rescue-%{rescue_ver} %configure \ --sysconfdir=%{_sysconfdir}/%{name}/rescue \ --with-bacula=`pwd`/.. popd # Build documentation pushd %{name}-docs-%{bacula_ver} %configure \ --sysconfdir=%{_sysconfdir}/%{name} \ --with-bacula=`pwd`/.. for DIR in manuals/en/*/; do if [ -f ${DIR}/Makefile ]; then %{__make} -C ${DIR} web mini-clean fi done popd %install [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_initrddir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sysconfdir}/{%{name}/{rescue,updatedb},sysconfig,logrotate.d} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sysconfdir}/log.d/{scripts/services,conf/{logfiles,services}} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sysconfdir}/{httpd/conf.d,pam.d,security/console.apps} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_bindir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sbindir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir}/{applications,pixmaps} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir}/%{name}/{brestore,bweb/tpl} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_datadir}/%{name}/{%{name}-web,bimagemgr,bweb}/{cgi-bin,html} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_localstatedir}/{lib,log}/%{name} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_localstatedir}/cache/{bimagemgr,bweb} %{__make} \ DESTDIR=${RPM_BUILD_ROOT} \ install %{__mv} -f ${RPM_BUILD_ROOT}%{_bindir}/%{name}-{dir,fd,sd} ${RPM_BUILD_ROOT}%{_sbindir} %{__install} -m 0755 src/tools/.libs/bbatch ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0755 src/tools/.libs/grow ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0755 src/tools/.libs/test* ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0755 src/tools/.libs/*test ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0755 src/tools/.libs/*type ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0755 src/libbacsql-*.so ${RPM_BUILD_ROOT}%{_libdir} %{__rm} -f ${RPM_BUILD_ROOT}%{_libdir}/libbacsql-?.?.?.so %{__install} -m 0755 scripts/bacula_config-* ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts %{__rm} -f ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts/bacula_config %{__install} -m 0755 %{SOURCE10} ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-dir %{__install} -m 0755 %{SOURCE11} ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-sd %{__install} -m 0755 %{SOURCE12} ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-fd %{__install} -m 0644 %{SOURCE15} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-dir %{__install} -m 0644 %{SOURCE16} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-sd %{__install} -m 0644 %{SOURCE17} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-fd %{__install} -m 0644 scripts/logrotate ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} %{__install} -m 0644 scripts/m*.bacula ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts/magic %{__cp} -prd examples ${RPM_BUILD_ROOT}%{_datadir}/%{name} touch ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/support.pkg touch ${RPM_BUILD_ROOT}%{_localstatedir}/cache/bimagemgr/temp.html %{__rm} -f ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts/{%{name},%{name}-ctl*,[bg]console} %{__rm} -f ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts/{start,stop}mysql %{__rm} -f ${RPM_BUILD_ROOT}%{_bindir}/{%{name},ing_test} %{__rm} -f ${RPM_BUILD_ROOT}%{_libdir}/lib{bac,baccfg,bacfind,bacpy,bacsql}.{la,so,so.?} %{__rm} -rf ${RPM_BUILD_ROOT}%{_docdir} # Installed but unpackaged files %{__rm} -rf ${RPM_BUILD_ROOT}%{_mandir}/man1/bat.1* %{__rm} -rf ${RPM_BUILD_ROOT}%{_mandir}/man1/bacula-bwxconsole.1* # Install DB update scripts %{__install} -m 0644 updatedb/README ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/updatedb %{__install} -m 0755 updatedb/update_{sqlite3,mysql,postgresql}_*_{?,??} \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/updatedb # Install logwatch addons %{__install} -m 0755 scripts/logwatch/%{name} \ ${RPM_BUILD_ROOT}%{_sysconfdir}/log.d/scripts/services %{__install} -m 0644 scripts/logwatch/logfile.%{name}.conf \ ${RPM_BUILD_ROOT}%{_sysconfdir}/log.d/conf/logfiles/%{name}.conf %{__install} -m 0644 scripts/logwatch/services.%{name}.conf \ ${RPM_BUILD_ROOT}%{_sysconfdir}/log.d/conf/services/%{name}.conf # Install GUI addons %{__install} -m 0644 src/tray-monitor/generic.xpm \ ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/%{name}-tray-monitor.xpm %{__install} -m 0644 scripts/%{name}-tray-monitor.desktop \ ${RPM_BUILD_ROOT}%{_datadir}/applications pushd %{name}-gui-%{bacula_ver} pushd bimagemgr %{__make} \ DESTDIR=${RPM_BUILD_ROOT} \ install %{__install} -m 0640 %{SOURCE20} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d %{__ln_s} -f %{_localstatedir}/cache/bimagemgr/temp.html \ ${RPM_BUILD_ROOT}%{_datadir}/%{name}/bimagemgr/html popd pushd brestore %{__install} -m 0755 brestore.pl ${RPM_BUILD_ROOT}%{_bindir} %{__install} -m 0644 brestore*.glade ${RPM_BUILD_ROOT}%{_datadir}/%{name}/brestore %{__install} -m 0644 brestore.png ${RPM_BUILD_ROOT}%{_datadir}/pixmaps %{__install} -m 0644 brestore.desktop.consolehelper \ ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}-restore.desktop %{__install} -m 0644 brestore.console_apps \ ${RPM_BUILD_ROOT}%{_sysconfdir}/security/console.apps/brestore %{__install} -m 0644 brestore.pamd ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/brestore %{__ln_s} consolehelper ${RPM_BUILD_ROOT}%{_bindir}/brestore popd pushd bweb %{__make} \ PERL_INSTALL_ROOT=${RPM_BUILD_ROOT} \ pure_install find ${RPM_BUILD_ROOT} -type f -name ".packlist" -exec %{__rm} -f {} \; %{__install} -m 0644 html/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}/bweb/html %{__install} -m 0755 cgi/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}/bweb/cgi-bin %{__install} -m 0644 tpl/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}/bweb/tpl %{__install} -m 0644 bweb.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name} %{__install} -m 0644 script/bweb-postgresql.sql \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/scripts %{__install} -m 0640 %{SOURCE21} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d popd pushd %{name}-web %{__cp} -pr * ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{name}-web/html %{__install} -m 0640 %{SOURCE22} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d popd popd # Install rescue files pushd %{name}-rescue-%{rescue_ver} %{__cp} -p {Makefile*,README,version.h} \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue %{__cp} -pr linux ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue touch ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/linux/cdrom/rpm_release %{__cp} -pr knoppix ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue touch ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/knoppix/cdrom/rpm_release %{__install} -m 0755 -D ../src/static-bacula-fd \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/linux/cdrom/%{name}/bin/%{name}-fd %{__install} -m 0755 -D ../src/static-bacula-fd \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/knoppix/cdrom/%{name}/bin/%{name}-fd %{__ln_s} -f %{_sysconfdir}/%{name}/%{name}-fd.conf \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/linux/cdrom/%{name}/bin/%{name}-fd.conf %{__ln_s} -f %{_sysconfdir}/%{name}/%{name}-fd.conf \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/rescue/knoppix/cdrom/%{name}/bin/%{name}-fd.conf popd %pre if ! getent group %{name} >/dev/null 2>&1; then /usr/sbin/groupadd -r %{name} fi if ! getent passwd %{name} >/dev/null 2>&1; then /usr/sbin/useradd -g %{name} -G %{name},disk \ -d %{_localstatedir}/lib/%{name} \ -c "Bacula Service user" \ -r -s /sbin/nologin %{name} fi exit 0 # Always pass %post [ -f %{_sysconfdir}/%{name}/support.pkg ] || { touch %{_sysconfdir}/%{name}/support.pkg %{__chown} root:root %{_sysconfdir}/%{name}/support.pkg %{__chmod} 0600 %{_sysconfdir}/%{name}/support.pkg HOSTNAME="`uname -n | cut -d. -f1`" echo "HOSTNAME=${HOSTNAME}" >>%{_sysconfdir}/%{name}/support.pkg for STRING in DIR_PASS FD_PASS SD_PASS DIR_MON_PASS FD_MON_PASS SD_MON_PASS; do PASSWORD="`openssl rand -base64 36`" echo "${STRING}=${PASSWORD}" >>%{_sysconfdir}/%{name}/support.pkg done } /sbin/ldconfig %post client # Update config for STRING in HOSTNAME FD_PASS FD_MON_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-fd.conf fi done /sbin/chkconfig --add %{name}-fd %post console # Update config for STRING in HOSTNAME DIR_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/bconsole.conf fi done %post gui-bimagemgr usermod -G %{name} apache %post gui-bimagemgr-selinux if /usr/sbin/selinuxenabled && [ -e /selinux/policyvers ]; then /sbin/fixfiles -R %{name}-gui-bimagemgr restore /sbin/restorecon -R %{_localstatedir}/cache/bimagemgr fi %post gui-bweb usermod -G %{name} apache %post gui-bweb-selinux if /usr/sbin/selinuxenabled && [ -e /selinux/policyvers ]; then /sbin/fixfiles -R %{name}-gui-bweb restore /sbin/restorecon -R %{_localstatedir}/cache/bweb fi %post gui-monitor # Update config for STRING in HOSTNAME DIR_MON_PASS FD_MON_PASS SD_MON_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/tray-monitor.conf fi done %post server-sqlite # Update config for STRING in HOSTNAME DIR_PASS FD_PASS SD_PASS DIR_MON_PASS SD_MON_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-dir.conf %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-sd.conf fi done /sbin/chkconfig --add %{name}-sd /sbin/chkconfig --add %{name}-dir /sbin/ldconfig %post server-mysql # Update config for STRING in HOSTNAME DIR_PASS FD_PASS SD_PASS DIR_MON_PASS SD_MON_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-dir.conf %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-sd.conf fi done /sbin/chkconfig --add %{name}-sd /sbin/chkconfig --add %{name}-dir /sbin/ldconfig %post server-postgresql # Update config for STRING in HOSTNAME DIR_PASS FD_PASS SD_PASS DIR_MON_PASS SD_MON_PASS; do REPLACE="`%{__grep} ${STRING} %{_sysconfdir}/%{name}/support.pkg 2>/dev/null | cut -d= -f2`" if [ -n "${REPLACE}" ]; then %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-dir.conf %{__sed} -i -e "s:XXX_${STRING}_XXX:${REPLACE}:g" %{_sysconfdir}/%{name}/%{name}-sd.conf fi done /sbin/chkconfig --add %{name}-sd /sbin/chkconfig --add %{name}-dir /sbin/ldconfig %preun client if [ $1 -eq 0 ]; then # Remove /sbin/service %{name}-fd stop >/dev/null 2>&1 /sbin/chkconfig --del %{name}-fd fi %preun server-sqlite if [ $1 -eq 0 ]; then # Remove /sbin/service %{name}-sd stop >/dev/null 2>&1 /sbin/service %{name}-dir stop >/dev/null 2>&1 /sbin/chkconfig --del %{name}-sd /sbin/chkconfig --del %{name}-dir fi %preun server-mysql if [ $1 -eq 0 ]; then # Remove /sbin/service %{name}-sd stop >/dev/null 2>&1 /sbin/service %{name}-dir stop >/dev/null 2>&1 /sbin/chkconfig --del %{name}-sd /sbin/chkconfig --del %{name}-dir fi %preun server-postgresql if [ $1 -eq 0 ]; then # Remove /sbin/service %{name}-sd stop >/dev/null 2>&1 /sbin/service %{name}-dir stop >/dev/null 2>&1 /sbin/chkconfig --del %{name}-sd /sbin/chkconfig --del %{name}-dir fi %postun -p /sbin/ldconfig %postun client if [ $1 -ge 1 ]; then # Upgrade /sbin/service %{name}-fd condrestart >/dev/null 2>&1 || : fi %postun server-sqlite if [ $1 -eq 0 ]; then # Remove /sbin/ldconfig fi if [ $1 -ge 1 ]; then # Upgrade /sbin/service %{name}-sd condrestart >/dev/null 2>&1 || : /sbin/service %{name}-dir condrestart >/dev/null 2>&1 || : fi %postun server-mysql if [ $1 -eq 0 ]; then # Remove /sbin/ldconfig fi if [ $1 -ge 1 ]; then # Upgrade /sbin/service %{name}-sd condrestart >/dev/null 2>&1 || : /sbin/service %{name}-dir condrestart >/dev/null 2>&1 || : fi %postun server-postgresql if [ $1 -eq 0 ]; then # Remove /sbin/ldconfig fi if [ $1 -ge 1 ]; then # Upgrade /sbin/service %{name}-sd condrestart >/dev/null 2>&1 || : /sbin/service %{name}-dir condrestart >/dev/null 2>&1 || : fi %clean [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc ABOUT-NLS AUTHORS COPYING COPYRIGHT ChangeLog INSTALL %doc LICENSE README ReleaseNotes SUPPORT kernstodo projects %doc technotes unaccepted-projects scripts/*.vim %attr(755,root,%{name}) %dir %{_sysconfdir}/%{name} %attr(600,root,root) %ghost %{_sysconfdir}/%{name}/support.pkg %attr(750,%{name},%{name}) %dir %{_sysconfdir}/%{name}/scripts %{_sysconfdir}/%{name}/scripts/btraceback.dbx %{_sysconfdir}/%{name}/scripts/btraceback.gdb %{_sysconfdir}/%{name}/scripts/btraceback.mdb %{_sysconfdir}/%{name}/scripts/magic %attr(755,root,%{name}) %{_bindir}/bsmtp %attr(755,root,%{name}) %{_bindir}/bregex %attr(755,root,%{name}) %config(noreplace) %{_bindir}/btraceback %attr(755,root,%{name}) %{_bindir}/bwild %attr(755,root,%{name}) %{_bindir}/grow %attr(755,root,%{name}) %{_bindir}/test* %attr(755,root,%{name}) %{_bindir}/*type %{_libdir}/libbac-*.so %{_libdir}/libbaccfg-*.so %{_libdir}/libbacfind-*.so %{_libdir}/libbacpy-*.so %dir %{_libdir}/%{name} %dir %{_datadir}/%{name} %{_datadir}/%{name}/examples %{_mandir}/man1/bsmtp.1* %{_mandir}/man8/bacula.8* %{_mandir}/man8/btraceback.8* %attr(755,%{name},%{name}) %dir %{_localstatedir}/lib/%{name} %files client %defattr(-,root,root) %{_initrddir}/bacula-fd %config(noreplace) %{_sysconfdir}/sysconfig/bacula-fd %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/bacula-fd.conf %attr(751,root,%{name}) %{_sbindir}/bacula-fd %{_libdir}/%{name}/bpipe-fd.so %{_mandir}/man8/bacula-fd.8* %files client-rescue %defattr(-,root,root) %attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/rescue %config %{_sysconfdir}/%{name}/rescue/* %files console %defattr(-,root,root) %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/bconsole.conf %attr(751,root,%{name}) %{_bindir}/bconsole %{_mandir}/man8/bconsole.8* %files doc %defattr(-,root,root) %doc %{name}-docs-%{version}/manuals/en/console/console.pdf %doc %{name}-docs-%{version}/manuals/en/console/console %doc %{name}-docs-%{version}/manuals/en/developers/developers.pdf %doc %{name}-docs-%{version}/manuals/en/developers/developers %doc %{name}-docs-%{version}/manuals/en/main/main.pdf %doc %{name}-docs-%{version}/manuals/en/main/main %doc %{name}-docs-%{version}/manuals/en/misc/misc.pdf %doc %{name}-docs-%{version}/manuals/en/misc/misc %doc %{name}-docs-%{version}/manuals/en/problems/problems.pdf %doc %{name}-docs-%{version}/manuals/en/problems/problems %doc %{name}-docs-%{version}/manuals/en/utility/utility.pdf %doc %{name}-docs-%{version}/manuals/en/utility/utility %files gui-bimagemgr %defattr(-,root,root) %doc %{name}-gui-%{version}/bimagemgr/{COPYING,ChangeLog,README,ReleaseNotes} %{_sysconfdir}/%{name}/scripts/create_cdimage_table.pl %config(noreplace) %{_sysconfdir}/httpd/conf.d/bacula-bimagemgr.conf %dir %{_datadir}/%{name}/bimagemgr %dir %{_datadir}/%{name}/bimagemgr/cgi-bin %{_datadir}/%{name}/bimagemgr/cgi-bin/bimagemgr.pl %attr(640,root,apache) %config %{_datadir}/%{name}/bimagemgr/cgi-bin/config.pm %dir %{_datadir}/%{name}/bimagemgr/html %{_datadir}/%{name}/bimagemgr/html/*.gif %attr(640,apache,apache) %{_datadir}/%{name}/bimagemgr/html/temp.html %attr(750,apache,apache) %dir %{_localstatedir}/cache/bimagemgr %attr(640,apache,apache) %verify(not md5 size mtime) %{_localstatedir}/cache/bimagemgr/temp.html %files gui-bimagemgr-selinux %defattr(-,root,root) %files gui-brestore %defattr(-,root,root) %doc %{name}-gui-%{version}/brestore/{COPYING,INSTALL,README,ReleaseNotes} %config(noreplace) %{_sysconfdir}/pam.d/brestore %config(noreplace) %{_sysconfdir}/security/console.apps/brestore %{_bindir}/brestore %{_bindir}/brestore.pl %config(noreplace) %{_datadir}/applications/bacula-restore.desktop %{_datadir}/pixmaps/brestore.png %{_datadir}/%{name}/brestore %files gui-bweb %defattr(-,root,root) %doc %{name}-gui-%{version}/bweb/{INSTALL,LICENSE,ReleaseNotes,UPGRADE} %attr(640,apache,apache) %config(noreplace) %{_sysconfdir}/%{name}/bweb.conf %{_sysconfdir}/%{name}/scripts/bweb-postgresql.sql %config(noreplace) %{_sysconfdir}/httpd/conf.d/bacula-bweb.conf %{perl_vendorlib}/* %{_datadir}/%{name}/bweb %{_mandir}/man3/*.3* %attr(750,apache,apache) %dir %{_localstatedir}/cache/bweb %files gui-bweb-selinux %defattr(-,root,root) %files gui-monitor %defattr(-,root,root) %attr(644,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/tray-monitor.conf %attr(755,root,%{name}) %{_bindir}/bacula-tray-monitor %{_mandir}/man1/bacula-tray-monitor.1* %{_datadir}/applications/bacula-tray-monitor.desktop %{_datadir}/pixmaps/bacula-tray-monitor.xpm %files gui-web %defattr(-,root,root) %doc %{name}-gui-%{version}/%{name}-web/{CONTACT,COPYING,ChangeLog,README,TODO} %config(noreplace) %{_sysconfdir}/httpd/conf.d/bacula-web.conf %config(noreplace) %{_datadir}/%{name}/bacula-web %files server-sqlite %defattr(-,root,root) %{_initrddir}/bacula-dir %{_initrddir}/bacula-sd %config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir %config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_sysconfdir}/log.d/scripts/services/%{name} %{_sysconfdir}/log.d/conf/logfiles/bacula.conf %{_sysconfdir}/log.d/conf/services/bacula.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/bacula-dir.conf %attr(640,root,disk) %config(noreplace) %{_sysconfdir}/%{name}/bacula-sd.conf %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_bacula_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_catalog_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_sqlite3_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-sqlite %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/dvd-handler %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/query.sql %attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/updatedb %{_sysconfdir}/%{name}/updatedb/README %{_sysconfdir}/%{name}/updatedb/update_sqlite3_* %attr(751,root,%{name}) %{_bindir}/bbatch %attr(751,root,%{name}) %{_bindir}/bscan %attr(751,root,%{name}) %{_bindir}/dbcheck %attr(751,root,%{name}) %{_bindir}/bcopy %attr(751,root,%{name}) %{_bindir}/bls %attr(751,root,%{name}) %{_bindir}/bextract %attr(751,root,%{name}) %{_bindir}/btape %attr(751,root,%{name}) %{_bindir}/*test %attr(751,root,%{name}) %{_sbindir}/bacula-dir %attr(751,root,disk) %{_sbindir}/bacula-sd %{_libdir}/libbacsql-sqlite-*.so %{_mandir}/man8/bacula-dir.8* %{_mandir}/man8/bacula-sd.8* %{_mandir}/man8/bcopy.8* %{_mandir}/man8/bextract.8* %{_mandir}/man8/bls.8* %{_mandir}/man8/bscan.8* %{_mandir}/man8/btape.8* %{_mandir}/man8/dbcheck.8* %attr(755,%{name},%{name}) %dir %{_localstatedir}/log/%{name} %files server-mysql %defattr(-,root,root) %{_initrddir}/bacula-dir %{_initrddir}/bacula-sd %config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir %config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_sysconfdir}/log.d/scripts/services/%{name} %{_sysconfdir}/log.d/conf/logfiles/bacula.conf %{_sysconfdir}/log.d/conf/services/bacula.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/bacula-dir.conf %attr(640,root,disk) %config(noreplace) %{_sysconfdir}/%{name}/bacula-sd.conf %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_bacula_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_catalog_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_mysql_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-mysql %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/dvd-handler %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/query.sql %attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/updatedb %{_sysconfdir}/%{name}/updatedb/README %{_sysconfdir}/%{name}/updatedb/update_mysql_* %attr(751,root,%{name}) %{_bindir}/bbatch %attr(751,root,%{name}) %{_bindir}/bscan %attr(751,root,%{name}) %{_bindir}/dbcheck %attr(751,root,%{name}) %{_bindir}/bcopy %attr(751,root,%{name}) %{_bindir}/bls %attr(751,root,%{name}) %{_bindir}/bextract %attr(751,root,%{name}) %{_bindir}/btape %attr(751,root,%{name}) %{_bindir}/*test %attr(751,root,%{name}) %{_sbindir}/bacula-dir %attr(751,root,disk) %{_sbindir}/bacula-sd %{_libdir}/libbacsql-mysql-*.so %{_mandir}/man8/bacula-dir.8* %{_mandir}/man8/bacula-sd.8* %{_mandir}/man8/bcopy.8* %{_mandir}/man8/bextract.8* %{_mandir}/man8/bls.8* %{_mandir}/man8/bscan.8* %{_mandir}/man8/btape.8* %{_mandir}/man8/dbcheck.8* %attr(755,%{name},%{name}) %dir %{_localstatedir}/log/%{name} %files server-postgresql %defattr(-,root,root) %{_initrddir}/bacula-dir %{_initrddir}/bacula-sd %config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir %config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_sysconfdir}/log.d/scripts/services/%{name} %{_sysconfdir}/log.d/conf/logfiles/bacula.conf %{_sysconfdir}/log.d/conf/services/bacula.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/bacula-dir.conf %attr(640,root,disk) %config(noreplace) %{_sysconfdir}/%{name}/bacula-sd.conf %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_bacula_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_catalog_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*_postgresql_* %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-pgsql %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/dvd-handler %attr(750,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/*-changer.conf %attr(640,root,%{name}) %config(noreplace) %{_sysconfdir}/%{name}/scripts/query.sql %attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/updatedb %{_sysconfdir}/%{name}/updatedb/README %{_sysconfdir}/%{name}/updatedb/update_postgresql_* %attr(751,root,%{name}) %{_bindir}/bbatch %attr(751,root,%{name}) %{_bindir}/bscan %attr(751,root,%{name}) %{_bindir}/dbcheck %attr(751,root,%{name}) %{_bindir}/bcopy %attr(751,root,%{name}) %{_bindir}/bls %attr(751,root,%{name}) %{_bindir}/bextract %attr(751,root,%{name}) %{_bindir}/btape %attr(751,root,%{name}) %{_bindir}/*test %attr(751,root,%{name}) %{_sbindir}/bacula-dir %attr(751,root,disk) %{_sbindir}/bacula-sd %{_libdir}/libbacsql-pgsql-*.so %{_mandir}/man8/bacula-dir.8* %{_mandir}/man8/bacula-sd.8* %{_mandir}/man8/bcopy.8* %{_mandir}/man8/bextract.8* %{_mandir}/man8/bls.8* %{_mandir}/man8/bscan.8* %{_mandir}/man8/btape.8* %{_mandir}/man8/dbcheck.8* %attr(755,%{name},%{name}) %dir %{_localstatedir}/log/%{name} %changelog * Wed Oct 06 2010 Peter Pramberger - 5.0.3-1 - New version (5.0.3) * Fri May 21 2010 Peter Pramberger - 5.0.2-1 - New version (5.0.2) * Thu Mar 04 2010 Peter Pramberger - 5.0.1-1 - New version (5.0.1) * Wed Oct 28 2009 Peter Pramberger - 3.0.3-1 - New version (3.0.3) * Tue Jul 28 2009 Peter Pramberger - 3.0.2-1 - New version (3.0.2) * Tue May 26 2009 Peter Pramberger - 3.0.1-3 - Fixed File service backup abort on ACLs, if sys/fs has no ACLs enabled * Mon May 25 2009 Peter Pramberger - 3.0.1-2 - Fixed database scripts * Sat May 23 2009 Peter Pramberger - 3.0.1-1 - New version (3.0.1) * Sat Mar 28 2009 Peter Pramberger - 2.4.4-1 - New version (2.4.4) * Mon Nov 03 2008 Peter Pramberger - 2.4.3-2 - Added patch for bug #1175 (http://bugs.bacula.org/view.php?id=1175) - Added patch: orphaned-jobs.patch * Thu Oct 23 2008 Peter Pramberger - 2.4.3-1 - New version (2.4.3) * Sat Dec 08 2007 peter.pramberger@member.fsf.org 2.2.6-7 - new version (2.2.6) - added package for bat * Fri Oct 19 2007 peter.pramberger@member.fsf.org 2.2.5-6 - new version (2.2.5) * Fri Jun 22 2007 peter.pramberger@member.fsf.org 2.0.3-5 - added selinux check for bimagemgr/bweb * Fri Jun 01 2007 peter.pramberger@member.fsf.org 2.0.3-4 - created