[pkg-bacula-commits] [SCM] Bacula, a network backup, recovery and verification program branch, master, updated. debian/5.0.3-1-6-gab5fc63

Luca Capello luca at pca.it
Wed May 2 14:35:50 UTC 2012


The following commit has been merged in the master branch:
commit 8fd8ebdd06b9cde0e0cdb3e17d53745f0fafa0c0
Author: Jan Hauke Rahm <jhr at debian.org>
Date:   Wed Apr 13 15:24:49 2011 +0200

    Rework patching to use 3.0 (quilt)

diff --git a/debian/additions/postinst-common b/debian/additions/postinst-common
index e3d3871..52b43f9 100644
--- a/debian/additions/postinst-common
+++ b/debian/additions/postinst-common
@@ -18,7 +18,7 @@ else
 fi
 
 # Final config fix
-sed -e "s/@hostname@/`hostname`/" < $SOURCE > $TARGET
+sed -e "s/@debian_hostname@/`hostname`/" < $SOURCE > $TARGET
 
 # get rid of now unnecessary file
 rm -f $TMPCONFIG
diff --git a/debian/bacula-common.install b/debian/bacula-common.install
index a79fb79..409b3bc 100644
--- a/debian/bacula-common.install
+++ b/debian/bacula-common.install
@@ -6,3 +6,9 @@ debian/tmp-install-sqlite3/usr/lib/bacula/libbac.* usr/lib/bacula
 debian/tmp-install-sqlite3/usr/lib/bacula/libbac-* usr/lib/bacula
 debian/tmp-install-sqlite3/usr/lib/bacula/libbacpy* usr/lib/bacula
 debian/tmp-install-sqlite3/usr/sbin/bsmtp		usr/lib/bacula
+debian/tmp-install-sqlite3/etc/bacula/tray-monitor.conf	usr/share/bacula-common/defconfig
+debian/tmp-install-sqlite3/etc/bacula/bat.conf			usr/share/bacula-common/defconfig
+debian/tmp-install-sqlite3/etc/bacula/bconsole.conf		usr/share/bacula-common/defconfig
+debian/tmp-install-sqlite3/etc/bacula/bacula-sd.conf		usr/share/bacula-common/defconfig
+debian/tmp-install-sqlite3/etc/bacula/bacula-fd.conf		usr/share/bacula-common/defconfig
+debian/tmp-install-sqlite3/etc/bacula/bacula-dir.conf		usr/share/bacula-common/defconfig
diff --git a/debian/bacula-console-qt.postinst b/debian/bacula-console-qt.postinst
index b3ac18f..2b99d97 100644
--- a/debian/bacula-console-qt.postinst
+++ b/debian/bacula-console-qt.postinst
@@ -37,7 +37,7 @@ case "$1" in
 	fi
 
 	# bconsole & wx-console use the same config file ;)
-	sed -e "s~@hostname@~localhost~" < $SRCDIR/$CFGFILE > $TARGET
+	sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CFGFILE > $TARGET
 
 	chown root:bacula $TARGET
 	chmod 640 $TARGET
diff --git a/debian/bacula-console.postinst b/debian/bacula-console.postinst
index 13d153a..bb05260 100644
--- a/debian/bacula-console.postinst
+++ b/debian/bacula-console.postinst
@@ -37,7 +37,7 @@ case "$1" in
 		TARGET=$DSTDIR/$CONFIG.dist
 	fi
 
-	sed -e "s~@hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
+	sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
 
 	chown root:bacula $TARGET
 	chmod 640 $TARGET
diff --git a/debian/bacula-fd.postinst b/debian/bacula-fd.postinst
index 0f26189..45f0175 100644
--- a/debian/bacula-fd.postinst
+++ b/debian/bacula-fd.postinst
@@ -41,7 +41,7 @@ case "$1" in
 		TARGET=$DSTDIR/$CONFIG.dist
 	fi
 
-	sed -e s~@hostname@~`hostname`~ \
+	sed -e s~@debian_hostname@~`hostname`~ \
 	-e s~XXX_FDPASSWORD_XXX~$FDPASSWD~ \
 	-e s~XXX_MONFDPASSWORD_XXX~$FDMPASSWD~ < $SRCDIR/$CONFIG > $TARGET
 	
diff --git a/debian/bacula-sd.postinst b/debian/bacula-sd.postinst
index 9cc16be..ed1212f 100644
--- a/debian/bacula-sd.postinst
+++ b/debian/bacula-sd.postinst
@@ -41,7 +41,7 @@ case "$1" in
 		TARGET=$DSTDIR/$CONFIG.dist
 	fi
 
-	sed -e s~@hostname@~`hostname`~ \
+	sed -e s~@debian_hostname@~`hostname`~ \
 	-e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \
 	-e s~XXX_MONSDPASSWORD_XXX~$SDMPASSWD~ < $SRCDIR/$CONFIG > $TARGET
 	
diff --git a/debian/bacula-traymonitor.postinst b/debian/bacula-traymonitor.postinst
index 3405db1..d5cfec6 100644
--- a/debian/bacula-traymonitor.postinst
+++ b/debian/bacula-traymonitor.postinst
@@ -38,7 +38,7 @@ case "$1" in
             TARGET=$DSTDIR/$CONFIG.dist
         fi
 
-        sed -e "s~@hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
+        sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
         chown root:bacula $TARGET
         chmod 640 $TARGET
 
diff --git a/debian/patches/fix-default-config b/debian/patches/fix-default-config
new file mode 100644
index 0000000..df0f6ad
--- /dev/null
+++ b/debian/patches/fix-default-config
@@ -0,0 +1,186 @@
+--- a/src/dird/bacula-dir.conf.in
++++ b/src/dird/bacula-dir.conf.in
+@@ -13,7 +13,7 @@
+ #
+ 
+ Director {                            # define myself
+-  Name = @basename at -dir
++  Name = @debian_hostname at -dir
+   DIRport = @dir_port@                # where we listen for UA connections
+   QueryFile = "@scriptdir@/query.sql"
+   WorkingDirectory = "@working_dir@"
+@@ -21,13 +21,14 @@
+   Maximum Concurrent Jobs = 1
+   Password = "@dir_password@"         # Console password
+   Messages = Daemon
++  DirAddress = 127.0.0.1
+ }
+ 
+ JobDefs {
+   Name = "DefaultJob"
+   Type = Backup
+   Level = Incremental
+-  Client = @basename at -fd 
++  Client = @debian_hostname at -fd
+   FileSet = "Full Set"
+   Schedule = "WeeklyCycle"
+   Storage = File
+@@ -48,7 +49,7 @@
+ 
+ #Job {
+ #  Name = "BackupClient2"
+-#  Client = @basename at 2-fd
++#  Client = @debian_hostname at 2-fd
+ #  JobDefs = "DefaultJob"
+ #}
+ 
+@@ -76,7 +77,7 @@
+ Job {
+   Name = "RestoreFiles"
+   Type = Restore
+-  Client=@basename at -fd                 
++  Client=@debian_hostname at -fd
+   FileSet="Full Set"                  
+   Storage = File                      
+   Pool = Default
+@@ -153,7 +154,7 @@
+ 
+ # Client (File Services) to backup
+ Client {
+-  Name = @basename at -fd
++  Name = @debian_hostname at -fd
+   Address = @hostname@
+   FDPort = @fd_port@
+   Catalog = MyCatalog
+@@ -168,7 +169,7 @@
+ #  You should change Name, Address, and Password before using
+ #
+ #Client {
+-#  Name = @basename at 2-fd                
++#  Name = @debian_hostname at 2-fd
+ #  Address = @hostname at 2
+ #  FDPort = @fd_port@
+ #  Catalog = MyCatalog
+@@ -251,8 +252,8 @@
+ #  tell (most) people that its coming from an automated source.
+ 
+ #
+-  mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
+-  operatorcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
++  mailcommand = "/usr/lib/bacula/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
++  operatorcommand = "/usr/lib/bacula/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
+   mail = @job_email@ = all, !skipped            
+   operator = @job_email@ = mount
+   console = all, !skipped, !saved
+@@ -270,7 +271,7 @@
+ # Message delivery for daemon messages (no job).
+ Messages {
+   Name = Daemon
+-  mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
++  mailcommand = "/usr/lib/bacula/bsmtp -h @smtp_host@ -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
+   mail = @job_email@ = all, !skipped            
+   console = all, !skipped, !saved
+   append = "@working_dir@/log" = all, !skipped
+@@ -307,7 +308,7 @@
+ # Restricted console used by tray-monitor to get the status of the director
+ #
+ Console {
+-  Name = @basename at -mon
++  Name = @debian_hostname at -mon
+   Password = "@mon_dir_password@"
+   CommandACL = status, .status
+ }
+--- a/src/filed/bacula-fd.conf.in
++++ b/src/filed/bacula-fd.conf.in
+@@ -11,7 +11,7 @@
+ # List Directors who are permitted to contact this File daemon
+ #
+ Director {
+-  Name = @basename at -dir
++  Name = @debian_hostname at -dir
+   Password = "@fd_password@"
+ }
+ 
+@@ -20,7 +20,7 @@
+ #   status of the file daemon
+ #
+ Director {
+-  Name = @basename at -mon
++  Name = @debian_hostname at -mon
+   Password = "@mon_fd_password@"
+   Monitor = yes
+ }
+@@ -29,15 +29,16 @@
+ # "Global" File daemon configuration specifications
+ #
+ FileDaemon {                          # this is me
+-  Name = @basename at -fd
++  Name = @debian_hostname at -fd
+   FDport = @fd_port@                  # where we listen for the director
+   WorkingDirectory = @working_dir@
+   Pid Directory = @piddir@
+   Maximum Concurrent Jobs = 20
++  FDAddress = 127.0.0.1
+ }
+ 
+ # Send all messages except skipped files back to Director
+ Messages {
+   Name = Standard
+-  director = @basename at -dir = all, !skipped, !restored
++  director = @debian_hostname at -dir = all, !skipped, !restored
+ }
+--- a/src/stored/bacula-sd.conf.in
++++ b/src/stored/bacula-sd.conf.in
+@@ -11,18 +11,19 @@
+ #
+ 
+ Storage {                             # definition of myself
+-  Name = @basename at -sd
++  Name = @debian_hostname at -sd
+   SDPort = @sd_port@                  # Director's port      
+   WorkingDirectory = "@working_dir@"
+   Pid Directory = "@piddir@"
+   Maximum Concurrent Jobs = 20
++  SDAddress = 127.0.0.1
+ }
+ 
+ #
+ # List Directors who are permitted to contact Storage daemon
+ #
+ Director {
+-  Name = @basename at -dir
++  Name = @debian_hostname at -dir
+   Password = "@sd_password@"
+ }
+ 
+@@ -31,7 +32,7 @@
+ #   status of the storage daemon
+ #
+ Director {
+-  Name = @basename at -mon
++  Name = @debian_hostname at -mon
+   Password = "@mon_sd_password@"
+   Monitor = yes
+ }
+@@ -201,5 +202,5 @@
+ #
+ Messages {
+   Name = Standard
+-  director = @basename at -dir = all
++  director = @debian_hostname at -dir = all
+ }
+--- a/src/stored/stored.conf.in
++++ b/src/stored/stored.conf.in
+@@ -13,6 +13,7 @@
+   WorkingDirectory = "@working_dir@"
+   Pid Directory = "@piddir@"
+   Subsys Directory = "@subsysdir@"
++  SDAddress = 127.0.0.1
+ }
+ 
+ #
+#--- /dev/null
+#+++ b/scripts/logwatch/logfile.bacula.conf.in
+#@@ -0,0 +1,2 @@
+#+# What actual file?  Defaults to LogPath if not absolute path....
+#+LogFile = /var/lib/bacula/log
diff --git a/debian/patches/fix-sql-bindir b/debian/patches/fix-sql-bindir
new file mode 100644
index 0000000..0afc034
--- /dev/null
+++ b/debian/patches/fix-sql-bindir
@@ -0,0 +1,20 @@
+--- a/configure
++++ b/configure
+@@ -27993,7 +27993,7 @@
+           if test -n "$PG_CONFIG";then
+               POSTGRESQL_INCDIR=`"$PG_CONFIG" --includedir`
+               POSTGRESQL_LIBDIR=`"$PG_CONFIG" --libdir`
+-              POSTGRESQL_BINDIR=`"$PG_CONFIG" --bindir`
++              POSTGRESQL_BINDIR=/usr/bin
+           elif test -f /usr/local/include/libpq-fe.h; then
+               POSTGRESQL_INCDIR=/usr/local/include
+               if test -d /usr/local/lib64; then
+@@ -28880,7 +28880,7 @@
+            db_prog="postgresql"
+            PG_CONFIG=`which pg_config`
+            if test -n "$PG_CONFIG"; then
+-              SQL_BINDIR=`"$PG_CONFIG" --bindir`
++              SQL_BINDIR=/usr/bin
+               SQL_LIBDIR=`"$PG_CONFIG" --libdir`
+            elif test -f /usr/local/bin/psql; then
+               SQL_BINDIR=/usr/local/bin
diff --git a/debian/patches/fix_config b/debian/patches/fix_config
deleted file mode 100644
index 15b8a6c..0000000
--- a/debian/patches/fix_config
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-
-if [ -z "$1" -o -z "$2" ]; then
-	test -n "$DH_VERBOSE" && echo "Params missing!" >/dev/fd/2;
-	exit 1
-fi
-	
-cat $1 | sed -e s~`uname -n | cut -d '.' -f 1`~@hostname@~g | sed -r -f `dirname $0`/fix_config.sed > $2
diff --git a/debian/patches/fix_config.sed b/debian/patches/fix_config.sed
deleted file mode 100644
index d8e4566..0000000
--- a/debian/patches/fix_config.sed
+++ /dev/null
@@ -1,2 +0,0 @@
-s~/usr/sbin/bsmtp~/usr/lib/bacula/bsmtp~g
-s~/home/kern/bacula/bin/mtx-changer~/etc/bacula/scripts/mtx-changer~g
diff --git a/debian/patches/fix_director b/debian/patches/fix_director
deleted file mode 100644
index dba40de..0000000
--- a/debian/patches/fix_director
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-set -e
-
-
-if [ -z "$1" -o -z "$2" ]; then
-	test -n "$DH_VERBOSE" && echo "Params missing!" >/dev/fd/2;
-	exit 1
-fi
-	
-cat $1 | sed -e s~`hostname`~@hostname@~g | \
-	sed -e "s~Address =`hostname`~Address = @fqdn@~g" | \
-	sed -f `dirname $0`/fix_director.sed | \
-	sed -f `dirname $0`/fix_config.sed > $2
diff --git a/debian/patches/fix_director.sed b/debian/patches/fix_director.sed
deleted file mode 100644
index 030c9ff..0000000
--- a/debian/patches/fix_director.sed
+++ /dev/null
@@ -1,2 +0,0 @@
-s~Job[ ]+= "/etc/bacula/scripts/~Job = "/usr/lib/bacula/~
-s~user = bacula; password = ""~user = @db_user@; password = "@db_pswd@"~
diff --git a/debian/patches/fix_scripts.sed b/debian/patches/fix_scripts.sed
deleted file mode 100644
index 47d858f..0000000
--- a/debian/patches/fix_scripts.sed
+++ /dev/null
@@ -1,3 +0,0 @@
-s~^bindir=@SQL_BINDIR@~bindir=/usr/bin~g
-s~@working_dir@~/var/lib/bacula~
-s~MTX=mtx~MTX=/usr/sbin/mtx~
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4a1f57e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+fix-default-config
+fix-sql-bindir
diff --git a/debian/rules b/debian/rules
index ab5075e..2ddc13e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -134,7 +134,7 @@ build-indep-stamp:
 	touch $@
 
 
-build: patch build-arch build-indep
+build: build-arch build-indep
 
 ###############################################
 # Cleaning macro
@@ -156,13 +156,11 @@ clean:
 
 	$(RM) build-arch-flavor-stamp
 
-	$(RM) patch-stamp
-
 
 # Macro to extract a here document and put it in place
 # args: 1 -- db name, 2 -- file to extract, 3 -- version
 define ext-upgrade
-debian/patches/extract_here < $(2) > debian/bacula-director-$(1)/$(DBC)/bacula-director-$(1)/upgrade/$(1)/$(3)
+debian/scripts/extract_here < $(2) > debian/bacula-director-$(1)/$(DBC)/bacula-director-$(1)/upgrade/$(1)/$(3)
 endef
 
 # Macro to process upgrades for all flavors
@@ -186,7 +184,7 @@ endef
 # args: 1 -- db name, 2 -- file to extract
 # We append so we can do the postgresql hack for datestyle
 define ext-install
-debian/patches/extract_here < $(2) > debian/bacula-director-$(1)/$(DBC)/bacula-director-$(1)/install/$(1)
+debian/scripts/extract_here < $(2) > debian/bacula-director-$(1)/$(DBC)/bacula-director-$(1)/install/$(1)
 endef
 
 install: build install-stamp
@@ -198,6 +196,8 @@ install-stamp: build-stamp $(foreach v,$(VARIANTS),install-stamp-$(v))
 	dh_install -pbacula-console -pbacula-console-qt
 	cp $(DEFAULTINSTALLDIR)/usr/sbin/bconsole debian/bacula-console/usr/sbin/bacula-console
 	cp debian/tmp-build-$(DEFAULTVARIANT)/src/qt-console/.libs/bat debian/bacula-console-qt/usr/bin/bat
+	chmod 755 debian/scripts/extract_here
+	chmod 755 debian/additions/bconsole
 
 ######### dbconfig-common stuff
 #	$(call ext-upgrade-all,7_to_8,1.36.0)
@@ -260,30 +260,13 @@ install-indep: build install-stamp
 install-arch: build install-stamp
 	dh_install -a
 	dh_link -pbacula-common
-	for f in bconsole.conf bat.conf \
-		bacula-sd.conf bacula-fd.conf tray-monitor.conf; do \
-		debian/patches/fix_config \
-			debian/tmp-install-sqlite3/etc/bacula/$$f \
-			debian/bacula-common/usr/share/bacula-common/defconfig/$$f; \
-	done
-	debian/patches/fix_director \
-		debian/tmp-install-sqlite3/etc/bacula/bacula-dir.conf \
-		debian/bacula-common/usr/share/bacula-common/defconfig/bacula-dir.conf
 
 	cp $(CURDIR)/debian/common-functions $(CURDIR)/debian/bacula-common/usr/share/bacula-common
 	chmod 755 $(CURDIR)/debian/bacula-common/usr/lib/bacula/btraceback
 
-patch: patch-stamp
-patch-stamp:
-	chmod 755 debian/patches/fix_config debian/patches/fix_director \
-		debian/patches/extract_here
-	chmod 755 debian/additions/bconsole
-
-	touch patch-stamp
-
 # Build architecture-independent files here.
 # Pass -i to all debhelper commands in this target to reduce clutter.
-binary-indep: build install-indep patch
+binary-indep: build install-indep
 	dh_testdir -i
 	dh_testroot -i
 #	dh_installdebconf -i
diff --git a/debian/patches/extract_here b/debian/scripts/extract_here
similarity index 100%
rename from debian/patches/extract_here
rename to debian/scripts/extract_here
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)

-- 
Bacula, a network backup, recovery and verification program



More information about the pkg-bacula-commits mailing list