[bacula] Pass hostname through configure

Simone Caronni slaanesh at fedoraproject.org
Sun Dec 11 17:29:06 UTC 2011


commit f45ba58e483ec4061e5a98e87341d608f279cb8c
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Sun Dec 11 18:28:18 2011 +0100

    Pass hostname through configure

 bacula-5.2.2-config.patch   |  129 -------------------------------------------
 bacula-5.2.2-hostname.patch |   19 ++++++
 bacula.spec                 |    8 ++-
 3 files changed, 25 insertions(+), 131 deletions(-)
---
diff --git a/bacula-5.2.2-hostname.patch b/bacula-5.2.2-hostname.patch
new file mode 100644
index 0000000..2ceae2b
--- /dev/null
+++ b/bacula-5.2.2-hostname.patch
@@ -0,0 +1,19 @@
+diff -Naur bacula-5.2.2.old/configure bacula-5.2.2/configure
+--- bacula-5.2.2.old/configure	2011-11-26 15:08:12.000000000 +0100
++++ bacula-5.2.2/configure	2011-12-11 18:17:30.530625327 +0100
+@@ -30019,15 +30019,6 @@
+ MACOSX=
+ COMPRESS_MANPAGES=yes
+ 
+-hostname=`uname -n | cut -d '.' -f 1`
+-if test x${hostname} = x ; then
+-   hostname="localhost"
+-fi
+-ping -c 1 $hostname 2>/dev/null 1>/dev/null
+-if test ! $? = 0; then
+-  hostname="localhost"
+-fi
+-
+ case "$DISTNAME" in
+ aix)
+    DISTVER=`uname -r`
diff --git a/bacula.spec b/bacula.spec
index 0748e8a..e0236f7 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -22,7 +22,8 @@ Source15:		bacula-fd.sysconfig
 Source16:		bacula-dir.sysconfig
 Source17:		bacula-sd.sysconfig
 Source18:		bacula-checkconf
-Patch1:			bacula-5.2.2-config.patch
+# Bug: hostname is ignored during configure, always picks "uname -n"
+Patch1:			bacula-5.2.2-hostname.patch
 Patch2:			bacula-5.0.2-openssl.patch
 Patch3:			bacula-5.2.2-queryfile.patch
 Patch4:			bacula-5.2.2-mysql.patch
@@ -293,7 +294,7 @@ Provides check_bacula support for Nagios.
 %prep
 %setup -q
 %setup -q -a 1 -D -T
-%patch1 -p1 -b .config
+%patch1 -p1 -b .hostname
 %patch2 -p2 -b .openssl
 %patch3 -p1 -b .queryfile
 %patch4 -p1 -b .mysql
@@ -316,6 +317,7 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
 	--with-sd-group=disk \
 	--with-fd-user=root \
 	--with-fd-group=root \
+	--with-hostname=localhost \
 	--with-basename=bacula \
 	--with-dir-password=@@DIR_PASSWORD@@ \
 	--with-fd-password=@@FD_PASSWORD@@ \
@@ -832,6 +834,8 @@ fi
 - Add bat html docs so the help button works.
 - Minor packaging changes.
 - Default permissions on bconsole and bat.
+- Use localhost as default on config files instead of patching fake
+  example.com hostnames.
 
 * Sat Dec 10 2011 Simone Caronni <negativo17 at gmail.com> - 5.2.2-10
 - Added patch for mysql 5.5.18 from Oliver Falk.


More information about the scm-commits mailing list