[bacula] Various build fixes and changes. Still has problems with libbaccats-%{version}.so symlink
Simone Caronni
slaanesh at fedoraproject.org
Fri Dec 2 17:36:14 UTC 2011
commit 900706a53080f57dee1dd501db35ba4e55d074c8
Author: Simone Caronni <negativo17 at gmail.com>
Date: Fri Dec 2 18:35:52 2011 +0100
Various build fixes and changes. Still has problems with libbaccats-%{version}.so symlink
bacula-5.0.1-dsolink.patch | 11 --
bacula-5.0.2-python27.patch | 22 ---
bacula-5.0.3-dsolink.patch | 165 ----------------------
bacula-5.0.3-maxvalue.patch | 78 ----------
bacula-5.0.3-mysql55.patch | 11 --
bacula-5.0.3-tray-dir.patch | 13 --
bacula-config.patch => bacula-5.2.2-config.patch | 0
bacula-bwxconsole.desktop | 11 --
bacula-dir.init | 15 +--
bacula-fd.init | 15 +--
bacula-fd.sysconfig | 3 +-
bacula-gconsole.desktop | 12 --
bacula-pamd.patch | 23 ---
bacula-sd.init | 15 +--
bacula-traymonitor.console_apps | 3 -
bacula-traymonitor.desktop | 11 --
bacula-wxconsole.console_apps | 3 -
bacula-wxconsole.desktop | 11 --
bacula-wxconsole.patch | 10 --
bacula.spec | 111 +++++++++------
20 files changed, 70 insertions(+), 473 deletions(-)
---
diff --git a/bacula-config.patch b/bacula-5.2.2-config.patch
similarity index 100%
rename from bacula-config.patch
rename to bacula-5.2.2-config.patch
diff --git a/bacula-dir.init b/bacula-dir.init
index 75ea041..02376ac 100644
--- a/bacula-dir.init
+++ b/bacula-dir.init
@@ -33,19 +33,6 @@ if [ "$DIR_GROUP" != '' ]; then
OPTS="$OPTS -g $DIR_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '^[^#].*_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
checkdatabase() {
# First, get the currently selected database backend from the
# alternatives system.
@@ -87,7 +74,7 @@ start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
# Removed for now, as the db might not be on localhost
# checkdatabase
daemon $prog $OPTS
diff --git a/bacula-fd.init b/bacula-fd.init
index 044eb19..60f257f 100644
--- a/bacula-fd.init
+++ b/bacula-fd.init
@@ -33,24 +33,11 @@ if [ "$FD_GROUP" != '' ]; then
OPTS="$OPTS -g $FD_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
daemon $prog $OPTS
RETVAL=$?
echo
diff --git a/bacula-fd.sysconfig b/bacula-fd.sysconfig
index 796ad1a..2476fec 100644
--- a/bacula-fd.sysconfig
+++ b/bacula-fd.sysconfig
@@ -2,4 +2,5 @@
# If no user is set bacula will run as root
FD_USER=root
-FD_GROUP=root
\ No newline at end of file
+FD_GROUP=root
+
diff --git a/bacula-sd.init b/bacula-sd.init
index 98bb972..6fb5e8d 100644
--- a/bacula-sd.init
+++ b/bacula-sd.init
@@ -32,19 +32,6 @@ if [ "$SD_GROUP" != '' ]; then
OPTS="$OPTS -g $SD_GROUP"
fi
-checkconf() {
- # Check if we still have our @@PLACEHOLDERS@@ in the config.
- # If yes, refuse to start, the user has never touched the config.
- grep -q '^[^#].*_PASSWORD@@' $CONFIG
- if [ $? -eq 0 ]; then
- echo -n "Error: Default password in config"
- echo_failure
- echo
- exit 6
- fi
-}
-
-
checkdatabase() {
# First, get the currently selected database backend from the
# alternatives system.
@@ -86,7 +73,7 @@ start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- checkconf
+ bacula-checkconf $CONFIG
# Disabled, the DB does not necessarily run on the same machine
# checkdatabase
daemon $prog $OPTS
diff --git a/bacula.spec b/bacula.spec
index f82c782..2dd82d4 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -1,12 +1,13 @@
Name: bacula
Version: 5.2.2
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: Cross platform network backup for Linux, Unix, Mac and Windows
# See LICENSE for details
License: GPLv2 with exceptions
Group: System Environment/Daemons
URL: http://www.bacula.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
Source0: http://www.bacula.org/downloads/Bacula-%{version}/%{name}-%{version}.tar.gz
Source1: http://www.bacula.org/downloads/Bacula-%{version}/%{name}-docs-%{version}.tar.bz2
Source6: bacula.logrotate
@@ -21,7 +22,7 @@ Source15: bacula-fd.sysconfig
Source16: bacula-dir.sysconfig
Source17: bacula-sd.sysconfig
Source18: bacula-checkconf
-Patch1: bacula-config.patch
+Patch1: bacula-5.2.2-config.patch
Patch2: bacula-5.0.2-openssl.patch
Patch3: bacula-5.0.2-config.patch
Patch4: bacula-5.2.2-dsolink.patch
@@ -29,6 +30,7 @@ Patch5: bacula-5.0.3-log-path.patch
Patch6: bacula-5.0.3-sqlite-priv.patch
Patch7: bacula-5.2.1-bat-pamd.patch
Patch8: bacula-5.2.2-qt-console-optflags.patch
+
BuildRequires: openssl-devel, ncurses-devel, perl, glibc-devel
BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
BuildRequires: mysql-devel, postgresql-devel
@@ -37,7 +39,7 @@ BuildRequires: libacl-devel, latex2html, tetex-latex, tetex, ghostscript
BuildRequires: readline-devel
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
-BuildRequires: qt-devel >= 4.6
+BuildRequires: qt4-devel >= 4.6.2
%endif
%if 0%{?fedora} >= 7 || 0%{?rhel} >= 6
@@ -120,8 +122,6 @@ Group: System Environment/Daemons
Requires: bacula-director = %{version}-%{release}
Requires: bacula-common%{?_isa} = %{version}-%{release}
Requires: logwatch
-Requires(pre): fedora-usermgmt
-Requires(postun): fedora-usermgmt
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
Requires(post): systemd-sysv
Requires(post): systemd-units
@@ -134,7 +134,6 @@ Requires(preun): /sbin/service
Requires(postun): /sbin/service
%endif
-
%description director-common
Bacula is a set of programs that allow you to manage the backup,
recovery, and verification of computer data across a network of
@@ -172,12 +171,13 @@ This package contains the bacula client, the daemon running on the
system to be backed up.
-%package storage-common
-Summary: Common Bacula storage daemon files
+%package storage
+Summary: Bacula storage daemon files
Group: System Environment/Daemons
Requires: bacula-common%{?_isa} = %{version}-%{release}
# Storage backends merged into core.
-Provides: bacula-storage = %{version}-%{release}
+Provides: bacula-storage-common = %{version}-%{release}
+Obsoletes: bacula-storage-common < 5.2.2-2
Provides: bacula-storage-mysql = %{version}-%{release}
Obsoletes: bacula-storage-mysql < 5.2.0
Provides: bacula-storage-sqlite = %{version}-%{release}
@@ -196,8 +196,7 @@ Requires(preun): /sbin/service
Requires(postun): /sbin/service
%endif
-
-%description storage-common
+%description storage
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.
@@ -212,7 +211,7 @@ Summary: Common Bacula utilities
Group: System Environment/Daemons
Requires(pre): fedora-usermgmt
Obsoletes: bacula-console-gnome <= 2.4, bacula-traymonitor <= 2.4
-Obsoletes: bacula-sysconfdir <= 2.4
+Obsoletes: bacula-sysconfdir <= 2.4, bacula-console-wxwidgets
%description common
Bacula is a set of programs that allow you to manage the backup,
@@ -221,9 +220,9 @@ different computers. It is based on a client/server architecture.
%package console
-Summary: Bacula management console
-Group: System Environment/Daemons
-Requires: bacula-common = %{version}-%{release}
+Summary: Bacula management console
+Group: System Environment/Daemons
+Requires: bacula-common%{?_isa} = %{version}-%{release}
%description console
Bacula is a set of programs that allow you to manage the backup,
@@ -253,6 +252,9 @@ This package contains the bat version of the bacula management console
%package docs
Summary: Bacula documentation
Group: Documentation
+%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
+BuildArch: noarch
+%endif
%description docs
Bacula is a set of programs that allow you to manage the backup,
@@ -263,7 +265,7 @@ This package contains the documentation for most of the bacula-packages.
%package -n nagios-plugins-bacula
-Summary: Nagios Plugin - check_oracle
+Summary: Nagios Plugin - check_bacula
Group: Applications/System
%description -n nagios-plugins-bacula
@@ -294,9 +296,9 @@ find -type f -name '*.c' | xargs chmod -x
find -type f -name '*.h' | xargs chmod -x
%build
+build() {
export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
-export QMAKE=/usr/bin/qmake-qt4
%configure \
--sysconfdir=%{_sysconfdir}/bacula \
--with-dir-user=bacula \
@@ -331,7 +333,15 @@ export QMAKE=/usr/bin/qmake-qt4
--with-sqlite3 \
--with-mysql \
--with-postgresql \
- --enable-bat
+ $*
+}
+
+%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
+export QMAKE=/usr/bin/qmake-qt4
+build --enable-bat
+%else
+build
+%endif
if test $? != 0; then
tail -500 config.log
@@ -343,7 +353,6 @@ fi
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-#%{__make} %{?_smp_mflags} NO_ECHO=
%{__make} %{?_smp_mflags}
pushd examples/nagios/check_bacula
@@ -352,7 +361,7 @@ popd
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
pushd src/qt-console/tray-monitor
/usr/bin/qmake-qt4
- %{__make} %{?_smp_mflags}
+ %{__make} %{?_smp_mflags}
popd
%endif
@@ -369,19 +378,19 @@ make install DESTDIR=%{buildroot}
# install the nagios plugin
%{__mkdir_p} %{buildroot}%{_libdir}/nagios/plugins
-%{__install} -m0755 examples/nagios/check_bacula/check_bacula %{buildroot}%{_libdir}/nagios/plugins/
+%{__install} -m0755 examples/nagios/check_bacula/.libs/check_bacula %{buildroot}%{_libdir}/nagios/plugins/
# Remove unused stuff
rm -f %{buildroot}%{_libexecdir}/bacula/bconsole
rm -f %{buildroot}%{_mandir}/man1/bacula-bwxconsole.1*
rm -f %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1*
-# rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so
+rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so
mkdir -p %{buildroot}%{_bindir}
# Bat
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
-install -m 755 -D src/qt-console/bat %{buildroot}%{_sbindir}
+install -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}
install -m 644 -D src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf
install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png
install -m 644 -D scripts/bat.pamd %{buildroot}%{_sysconfdir}/pam.d/bat
@@ -402,13 +411,13 @@ install -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/lo
install -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
install -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
+install -m 755 -D %{SOURCE18} %{buildroot}%{_sbindir}/bacula-checkconf
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
# Systemd unit files
mkdir -p ${buildroot}%{_unitdir}
install -m 755 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
install -m 755 -D %{SOURCE11} %{buildroot}%{_unitdir}/bacula-dir.service
install -m 755 -D %{SOURCE12} %{buildroot}%{_unitdir}/bacula-sd.service
-install -m 755 -D %{SOURCE18} %{buildroot}%{_sbindir}/bacula-checkconf
%else
# Initscripts
install -m 755 -D %{SOURCE7} %{buildroot}%{_initrddir}/bacula-fd
@@ -421,16 +430,9 @@ install -m 644 -D %{SOURCE15} %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd
install -m 644 -D %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir
install -m 644 -D %{SOURCE17} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd
-# Wipe backup files from the multiple make install calls
-rm -vf %{buildroot}%{_sysconfdir}/bacula/*.{new,old}
-rm -vf %{buildroot}%{_libexecdir}/bacula/*.{new,old}
-
# Create the spooling
mkdir -p %{buildroot}%{_localstatedir}/spool/bacula
-# Move some files around
-#mv %{buildroot}%{_libexecdir}/bacula/query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
-
# Nuke the scripts we do not need
rm -vf %{buildroot}%{_libexecdir}/bacula/{bacula,bacula-ctl-*,startmysql,stopmysql}
@@ -548,27 +550,27 @@ fi
/bin/systemctl try-restart bacula-dir.service >/dev/null 2>&1 || :
-%post storage-common
+%post storage
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
-%preun storage-common
+%preun storage
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable bacula-sd.service > /dev/null 2>&1 || :
/bin/systemctl stop bacula-sd.service > /dev/null 2>&1 || :
fi
-%postun storage-common
+%postun storage
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
fi
-%triggerun storage-common -- bacula-storage-common < 5.0.3-10
+%triggerun storage -- bacula-storage-common < 5.0.3-10
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply bacula-sd
# to migrate them to systemd targets
@@ -614,18 +616,18 @@ if [ "$1" -ge "1" ]; then
fi
-%post storage-common
+%post storage
/sbin/chkconfig --add bacula-sd
-%preun storage-common
+%preun storage
if [ "$1" = 0 ]; then
/sbin/service bacula-sd stop >/dev/null 2>&1 || :
/sbin/chkconfig --del bacula-sd
fi
-%postun storage-common
+%postun storage
if [ "$1" -ge "1" ]; then
/sbin/service bacula-sd condrestart >/dev/null 2>&1 || :
fi
@@ -635,7 +637,7 @@ fi
%files common
%defattr(-,root,root,-)
-%doc AUTHORS ChangeLog COPYING LICENSE README SUPPORT VERIFYING examples/
+%doc AUTHORS ChangeLog COPYING LICENSE README SUPPORT VERIFYING
%config(noreplace) %{_sysconfdir}/logrotate.d/bacula
%dir %{_sysconfdir}/%{name}
%dir %{_libexecdir}/%{name}
@@ -649,24 +651,22 @@ fi
%{_libexecdir}/%{name}/btraceback.mdb
%{_libdir}/libbac-%{version}.so
%{_libdir}/libbac.so
-%{_libdir}/libbaccats-%{version}.so
%{_libdir}/libbaccats.so
+%{_libdir}/libbaccats-%{version}.so
%{_libdir}/libbaccfg-%{version}.so
%{_libdir}/libbaccfg.so
%{_libdir}/libbacfind-%{version}.so
%{_libdir}/libbacfind.so
%{_libdir}/libbacpy-%{version}.so
%{_libdir}/libbacpy.so
-%{_libdir}/libbacsql-%{version}.so
%{_libdir}/libbacsql.so
+%{_libdir}/libbacsql-%{version}.so
%{_mandir}/man1/bsmtp.1.gz
%{_mandir}/man8/bacula.8.gz
%{_mandir}/man8/btraceback.8.gz
%dir %attr(750, bacula, bacula) %{_localstatedir}/log/bacula
%dir %attr(750, bacula, bacula) %{_localstatedir}/spool/bacula
-%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
%{_sbindir}/bacula-checkconf
-%endif
%files client
%defattr(-,root,root,-)
@@ -704,7 +704,6 @@ fi
%defattr(-,root,root,-)
%doc updatedb
%attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf
-#%config(noreplace) %{_sysconfdir}/bacula/query.sql
%config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
%config(noreplace) %{_sysconfdir}/logwatch/conf/services/bacula.conf
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir
@@ -719,10 +718,10 @@ fi
%{_sbindir}/bregex
%{_sbindir}/bwild
%{_sbindir}/dbcheck
-%{_mandir}/man8/dbcheck.8.gz
%{_mandir}/man8/bacula-dir.8.gz
%{_mandir}/man8/bregex.8.gz
%{_mandir}/man8/bwild.8.gz
+%{_mandir}/man8/dbcheck.8.gz
%{_libexecdir}/%{name}/create_bacula_database
%{_libexecdir}/%{name}/delete_catalog_backup
%{_libexecdir}/%{name}/disk-changer
@@ -770,7 +769,7 @@ fi
%{_libexecdir}/%{name}/make_postgresql_tables
%{_libexecdir}/%{name}/update_postgresql_tables
-%files storage-common
+%files storage
%defattr(-,root,root,-)
%{_sbindir}/bacula-sd
%{_sbindir}/bcopy
@@ -810,6 +809,26 @@ fi
%changelog
+* Thu Dec 02 2011 Simone Caronni <negativo17 at gmail.com> - 5.2.2-4
+- Rename storage-common to storage and make it provide storage-common.
+
+* Thu Dec 01 2011 Simone Caronni <negativo17 at gmail.com> - 5.2.2-3
+- Add missing conditional for bat in the build section.
+- Make bat require qt4-devel on build (rhel 5 fix).
+- Bumped requirement for qt >= 4.6.2 for 5.2.2.
+- Renamed bacula-config.patch to bacula-5.2.2-config.patch as it
+ always changes.
+- Fix installation of bat and check_bacula binaries. Enabling
+ libtool for bpipe-fd.so produces binaries under .libs.
+- Removed fedora-usermgmt requirement for director-common.
+- Removed examples from docs and make them "noarch".
+- Fix bacula-console requirements.
+- Fix nagios plugin summary.
+- Removed checkconf functions from SysV init files and replace
+ the call with the script used in systemd service files. Make
+ the script available in all builds.
+- Make docs NoArch where supported.
+
* Thu Dec 1 2011 Tom Callaway <spot at fedoraproject.org> - 5.2.2-2
- resolve broken dependency issues
More information about the scm-commits
mailing list