[bacula] Reduce some config patching through configure

Simone Caronni slaanesh at fedoraproject.org
Mon Dec 5 14:04:12 UTC 2011


commit d6447bbfd6a283ac717e1882e13a2dd177020f50
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Mon Dec 5 15:03:01 2011 +0100

    Reduce some config patching through configure

 bacula-5.0.2-config.patch    |   12 ---
 bacula-5.2.2-config.patch    |  199 +++++++++++++++++++++---------------------
 bacula-5.2.2-queryfile.patch |   12 +++
 bacula.spec                  |   11 ++-
 4 files changed, 120 insertions(+), 114 deletions(-)
---
diff --git a/bacula-5.2.2-config.patch b/bacula-5.2.2-config.patch
index b6ab503..b1e1bc0 100644
--- a/bacula-5.2.2-config.patch
+++ b/bacula-5.2.2-config.patch
@@ -1,115 +1,118 @@
---- bacula-2.4.3/src/dird/bacula-dir.conf.in.orig	2008-12-10 10:17:27.000000000 -0600
-+++ bacula-2.4.3/src/dird/bacula-dir.conf.in	2008-12-10 10:17:27.000000000 -0600
-@@ -16 +16 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -30 +30 @@
--  Client = @basename at -fd 
-+  Client = bacula-fd 
-@@ -51 +51 @@
--#  Client = @basename at 2-fd
-+#  Client = bacula2-fd
-@@ -82 +82 @@
--  Client=@basename at -fd                 
-+  Client=bacula-fd                 
-@@ -157,2 +157,2 @@
--  Name = @basename at -fd
+diff -Naur bacula-5.2.2.old/src/dird/bacula-dir.conf.in bacula-5.2.2/src/dird/bacula-dir.conf.in
+--- bacula-5.2.2.old/src/dird/bacula-dir.conf.in	2011-12-05 13:30:02.993111136 +0100
++++ bacula-5.2.2/src/dird/bacula-dir.conf.in	2011-12-05 13:37:34.149637004 +0100
+@@ -154,7 +154,7 @@
+ # Client (File Services) to backup
+ Client {
+   Name = @basename at -fd
 -  Address = @hostname@
-+  Name = bacula-fd
 +  Address = client.example.com
-@@ -172,2 +172,2 @@
--#  Name = @basename at 2-fd                
+   FDPort = @fd_port@
+   Catalog = MyCatalog
+   Password = "@fd_password@"          # password for FileDaemon
+@@ -169,7 +169,7 @@
+ #
+ #Client {
+ #  Name = @basename at 2-fd                
 -#  Address = @hostname at 2
-+#  Name = bacula2-fd                
-+#  Address = client2.example.com
-@@ -187 +187 @@
++#  Address = client.example.com2
+ #  FDPort = @fd_port@
+ #  Catalog = MyCatalog
+ #  Password = "@fd_password at 2"         # password for FileDaemon 2
+@@ -183,7 +183,7 @@
+ Storage {
+   Name = File
+ # Do not use "localhost" here    
 -  Address = @hostname@                # N.B. Use a fully qualified name here
 +  Address = storage.example.com                # N.B. Use a fully qualified name here
-@@ -200 +200 @@
+   SDPort = @sd_port@
+   Password = "@sd_password@"
+   Device = FileStorage
+@@ -196,7 +196,7 @@
+ #Storage {
+ #  Name = DDS-4    
+ #  Do not use "localhost" here
 -#  Address = @hostname@                # N.B. Use a fully qualified name here
 +#  Address = storage.example.com                # N.B. Use a fully qualified name here
-@@ -212 +212 @@
+ #  SDPort = @sd_port@
+ #  Password = "@sd_password@"          # password for Storage daemon
+ #  Device = DDS-4                      # must be same as Device in Storage daemon
+@@ -208,7 +208,7 @@
+ #Storage {
+ #  Name = "8mmDrive"
+ #  Do not use "localhost" here
 -#  Address = @hostname@                # N.B. Use a fully qualified name here
 +#  Address = storage.example.com                # N.B. Use a fully qualified name here
-@@ -223 +223 @@
+ #  SDPort = @sd_port@
+ #  Password = "@sd_password@"
+ #  Device = "Exabyte 8mm"
+@@ -219,7 +219,7 @@
+ #Storage {
+ #  Name = "DVD"
+ #  Do not use "localhost" here
 -#  Address = @hostname@                # N.B. Use a fully qualified name here
 +#  Address = storage.example.com                # N.B. Use a fully qualified name here
-@@ -299 +299 @@
--  Name = @basename at -mon
-+  Name = bacula-mon
---- bacula-2.4.3/src/filed/bacula-fd.conf.in.orig	2008-12-10 10:19:12.000000000 -0600
-+++ bacula-2.4.3/src/filed/bacula-fd.conf.in	2008-12-10 10:19:12.000000000 -0600
-@@ -14 +14 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -23 +23 @@
--  Name = @basename at -mon
-+  Name = bacula-mon
-@@ -32 +32 @@
--  Name = @basename at -fd
-+  Name = bacula-fd
-@@ -42 +42 @@
--  director = @basename at -dir = all, !skipped, !restored
-+  director = bacula-dir = all, !skipped, !restored
---- bacula-2.4.3/src/stored/bacula-sd.conf.in.orig	2008-12-10 10:21:45.000000000 -0600
-+++ bacula-2.4.3/src/stored/bacula-sd.conf.in	2008-12-10 10:21:45.000000000 -0600
-@@ -14 +14 @@
--  Name = @basename at -sd
-+  Name = bacula-sd
-@@ -25 +25 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -34 +34 @@
--  Name = @basename at -mon
-+  Name = bacula-mon
-@@ -228 +228 @@
--  director = @basename at -dir = all
-+  director = bacula-dir = all
---- bacula-2.4.3/src/wx-console/bwx-console.conf.in.orig	2008-12-10 10:22:23.000000000 -0600
-+++ bacula-2.4.3/src/wx-console/bwx-console.conf.in	2008-12-10 10:22:23.000000000 -0600
-@@ -6 +6 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -8 +8 @@
+ #  SDPort = @sd_port@
+ #  Password = "@sd_password@"
+ #  Device = "DVD Writer"
+diff -Naur bacula-5.2.2.old/src/qt-console/bat.conf.in bacula-5.2.2/src/qt-console/bat.conf.in
+--- bacula-5.2.2.old/src/qt-console/bat.conf.in	2011-12-05 13:30:03.128113691 +0100
++++ bacula-5.2.2/src/qt-console/bat.conf.in	2011-12-05 13:39:38.359990302 +0100
+@@ -5,6 +5,6 @@
+ Director {
+   Name = @basename at -dir
+   DIRport = @dir_port@
 -  address = @hostname@
-+  address = server.example.com
---- bacula-2.4.3/src/tray-monitor/tray-monitor.conf.in.orig	2008-12-10 10:28:02.000000000 -0600
-+++ bacula-2.4.3/src/tray-monitor/tray-monitor.conf.in	2008-12-10 10:28:02.000000000 -0600
-@@ -6 +6 @@
--  Name = @basename at -mon
-+  Name = bacula-mon
-@@ -12,2 +12,2 @@
--  Name = @basename at -fd
++  address = director.example.com
+   Password = "@dir_password@"
+ }
+diff -Naur bacula-5.2.2.old/src/stored/stored.conf.in bacula-5.2.2/src/stored/stored.conf.in
+--- bacula-5.2.2.old/src/stored/stored.conf.in	2011-12-05 13:30:03.112113391 +0100
++++ bacula-5.2.2/src/stored/stored.conf.in	2011-12-05 13:40:04.777491664 +0100
+@@ -8,7 +8,7 @@
+ #
+ Storage {
+   Name = "Storage daemon"
+-  Address = @hostname@
++  Address = storage.example.com
+   SDPort = @sd_port@                  # Directors port      
+   WorkingDirectory = "@working_dir@"
+   Pid Directory = "@piddir@"
+diff -Naur bacula-5.2.2.old/src/tray-monitor/tray-monitor.conf.in bacula-5.2.2/src/tray-monitor/tray-monitor.conf.in
+--- bacula-5.2.2.old/src/tray-monitor/tray-monitor.conf.in	2011-12-05 13:30:02.984110966 +0100
++++ bacula-5.2.2/src/tray-monitor/tray-monitor.conf.in	2011-12-05 13:39:13.096510765 +0100
+@@ -10,20 +10,20 @@
+    
+ Client {
+   Name = @basename at -fd
 -  Address = @hostname@
-+  Name = bacula-fd
 +  Address = client.example.com
-@@ -19,2 +19,2 @@
--  Name = @basename at -sd
+   FDPort = @fd_port@
+   Password = "@mon_fd_password@"          # password for FileDaemon
+ }
+ 
+ Storage {
+   Name = @basename at -sd
 -  Address = @hostname@
-+  Name = bacula-sd
 +  Address = storage.example.com
-@@ -26 +26 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -28 +28 @@
--  address = @hostname@
-+  Address = director.example.com
---- bacula-2.4.3/src/qt-console/bat.conf.in.orig	2008-12-10 10:27:02.000000000 -0600
-+++ bacula-2.4.3/src/qt-console/bat.conf.in	2008-12-10 10:27:02.000000000 -0600
-@@ -6 +6 @@
--  Name = @basename at -dir
-+  Name = bacula-dir
-@@ -8 +8 @@
+   SDPort = @sd_port@
+   Password = "@mon_sd_password@"          # password for StorageDaemon
+ }
+ 
+ Director {
+   Name = @basename at -dir
+-  DIRport = @dir_port@
++  DIRport = director.example.com
+   address = @hostname@
+ }
+diff -Naur bacula-5.2.2.old/src/wx-console/bwx-console.conf.in bacula-5.2.2/src/wx-console/bwx-console.conf.in
+--- bacula-5.2.2.old/src/wx-console/bwx-console.conf.in	2011-12-05 13:30:03.090112973 +0100
++++ bacula-5.2.2/src/wx-console/bwx-console.conf.in	2011-12-05 13:40:37.193106792 +0100
+@@ -5,6 +5,6 @@
+ Director {
+   Name = @basename at -dir
+   DIRport = @dir_port@
 -  address = @hostname@
-+  address = server.example.com
---- bacula-2.4.3/src/stored/stored.conf.in.orig	2008-12-10 10:27:44.000000000 -0600
-+++ bacula-2.4.3/src/stored/stored.conf.in	2008-12-10 10:27:44.000000000 -0600
-@@ -11 +11 @@
--  Address = @hostname@
-+  Address = storage.example.com
-@@ -22 +22 @@
--  Name = @hostname at -dir
-+  Name = bacula-dir
-@@ -54 +54 @@
--  director = @hostname at -dir = all
-+  director = bacula-dir = all
++  address = director.example.com
+   Password = "@dir_password@"
+ }
diff --git a/bacula-5.2.2-queryfile.patch b/bacula-5.2.2-queryfile.patch
new file mode 100644
index 0000000..4684234
--- /dev/null
+++ b/bacula-5.2.2-queryfile.patch
@@ -0,0 +1,12 @@
+diff -Naur bacula-5.2.2.old/src/dird/bacula-dir.conf.in bacula-5.2.2/src/dird/bacula-dir.conf.in
+--- bacula-5.2.2.old/src/dird/bacula-dir.conf.in	2011-12-05 13:51:20.375282302 +0100
++++ bacula-5.2.2/src/dird/bacula-dir.conf.in	2011-12-05 13:54:12.809538069 +0100
+@@ -15,7 +15,7 @@
+ Director {                            # define myself
+   Name = @basename at -dir
+   DIRport = @dir_port@                # where we listen for UA connections
+-  QueryFile = "@scriptdir@/query.sql"
++  QueryFile = "@sysconfdir@/query.sql"
+   WorkingDirectory = "@working_dir@"
+   PidDirectory = "@piddir@"
+   Maximum Concurrent Jobs = 1
diff --git a/bacula.spec b/bacula.spec
index a58e62d..292a344 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -1,6 +1,6 @@
 Name:			bacula
 Version:		5.2.2
-Release:		4%{?dist}
+Release:		5%{?dist}
 Summary:		Cross platform network backup for Linux, Unix, Mac and Windows
 # See LICENSE for details
 License:		GPLv2 with exceptions
@@ -24,7 +24,7 @@ Source17:		bacula-sd.sysconfig
 Source18:		bacula-checkconf
 Patch1:			bacula-5.2.2-config.patch
 Patch2:			bacula-5.0.2-openssl.patch
-Patch3:			bacula-5.0.2-config.patch
+Patch3:			bacula-5.2.2-queryfile.patch
 Patch4:			bacula-5.2.2-dsolink.patch
 Patch5:			bacula-5.0.3-log-path.patch
 Patch6:			bacula-5.0.3-sqlite-priv.patch
@@ -275,9 +275,9 @@ Provides check_bacula support for Nagios.
 %prep
 %setup -q
 %setup -q -a 1 -D -T
-%patch1 -p1
+%patch1 -p1 -b .config
 %patch2 -p2 -b .openssl
-%patch3 -p2 -b .config
+%patch3 -p1 -b .queryfile
 %patch4 -p1 -b .dsolink
 %patch5 -p2 -b .log-path
 %patch6 -p0 -b .priv
@@ -307,6 +307,7 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
 	--with-sd-group=disk \
 	--with-fd-user=root \
 	--with-fd-group=root \
+	--with-basename=bacula \
 	--with-dir-password=@@DIR_PASSWORD@@ \
 	--with-fd-password=@@FD_PASSWORD@@ \
 	--with-sd-password=@@SD_PASSWORD@@ \
@@ -314,6 +315,7 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
 	--with-mon-fd-password=@@MON_FD_PASSWORD@@ \
 	--with-mon-sd-password=@@MON_SD_PASSWORD@@ \
 	--with-working-dir=%{_localstatedir}/spool/bacula \
+	--with-logdir=%{_localstatedir}/log/bacula \
 	--with-scriptdir=%{_libexecdir}/bacula \
 	--with-plugindir=%{_libdir}/bacula \
 	--with-smtp-host=localhost \
@@ -820,6 +822,7 @@ fi
 %changelog
 * Mon Dec 05 2011 Simone Caronni <negativo17 at gmail.com> - 5.2.2-5
 - Remove redundant user/group in service files.
+- Reduce patching for what can be passed through configure.
 
 * 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.


More information about the scm-commits mailing list