[pkg-bacula-commits] [SCM] Bacula, a network backup, recovery and verification program branch, master, updated. debian/5.2.6+dfsg-2-19-g9b3421a

Alexander Golovko alexandro at ankalagon.ru
Wed Jul 25 21:19:34 UTC 2012


The following commit has been merged in the master branch:
commit 1ca440fc3758a28fdcd17c05aa24f724934dbc5f
Author: Alexander Golovko <alexandro at ankalagon.ru>
Date:   Tue Jul 24 20:31:21 2012 +0400

    one-pass build instead of each dbtype separate.
    
    Switch to building stuff for all database types in the same time.

diff --git a/debian/bacula-common-db.install.in b/debian/bacula-common-db.install.in
index 245ba02..31de74d 100644
--- a/debian/bacula-common-db.install.in
+++ b/debian/bacula-common-db.install.in
@@ -1,2 +1,2 @@
 usr/lib/bacula/libbacsql*.so
-usr/lib/bacula/libbaccats*.so
+usr/lib/bacula/libbaccats-XX_DBLONGNAME_XX*.so
diff --git a/debian/bacula-common-db.links.in b/debian/bacula-common-db.links.in
new file mode 100644
index 0000000..edec476
--- /dev/null
+++ b/debian/bacula-common-db.links.in
@@ -0,0 +1,2 @@
+usr/lib/bacula/libbaccats-XX_DBLONGNAME_XX.so usr/lib/bacula/libbaccats-5.2.6.so
+usr/lib/bacula/libbaccats-5.2.6.so usr/lib/bacula/libbaccats.so
diff --git a/debian/changelog b/debian/changelog
index 3205446..70c89c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,10 @@
 bacula (5.2.6+dfsg-3) unstable; urgency=high
 
   [ Alexander Golovko ]
+  * debian/bacula-common-db.install.in, debian/bacula-common-db.links.in,
+    debian/patches/fix-default-dbtype.patch, debian/rules:
+    + Build packages for all database types in the same time, not a separate
+      process for sqlite3, mysql and pgsql.
   * debian/patches/fix-systemd-daemon-user-group.patch,
     debian/patches/series:
     + fix daemons user/group on systems with systemd (Closes: #679958).
diff --git a/debian/patches/fix-default-dbtype.patch b/debian/patches/fix-default-dbtype.patch
new file mode 100644
index 0000000..f6449d0
--- /dev/null
+++ b/debian/patches/fix-default-dbtype.patch
@@ -0,0 +1,28 @@
+Description: Change default dbtype for possibility to install correct files
+ in packages for different dbtype.
+Author: Alexander Golovko <alexandro at ankalagon.ru>
+Last-Update: 2012-07-24
+
+
+--- a/platforms/systemd/bacula-dir.service.in
++++ b/platforms/systemd/bacula-dir.service.in
+@@ -18,7 +18,7 @@ Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.
+ After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+ # Dependency about the database
+ # We let administrators decide if they need it (if local db instance)
+-# Wants=@DEFAULT_DB_TYPE at .service
++# Wants=XX_DBLONGNAME_XX.service
+ # Check if working dir exist and is a directory
+ ConditionPathIsDirectory=@working_dir@
+ # Before=
+--- a/src/cats/make_catalog_backup.in
++++ b/src/cats/make_catalog_backup.in
+@@ -19,7 +19,7 @@
+ #
+ #
+ 
+-default_db_type=@DEFAULT_DB_TYPE@
++default_db_type=XX_DBLONGNAME_XX
+ 
+ #
+ # See if the fifth argument is a valid backend name.
diff --git a/debian/patches/series b/debian/patches/series
index 98f8e5e..59da68f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 fix-default-config
+fix-default-dbtype.patch
 fix-sql-bindir
 switch-nonfree-sha1-to-openssl.patch
 fix-binutils-gold-linking.patch
diff --git a/debian/rules b/debian/rules
index ccea066..e33722c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -47,20 +47,14 @@ CONF_ALL	= \
 	--with-subsys-dir=/run/lock \
 	--with-dump-email=root \
 	--with-job-email=root \
-	--with-systemd=/lib/systemd/system
+	--with-systemd=/lib/systemd/system \
+	--with-mysql --with-postgresql --with-sqlite3 \
+	--enable-bat --enable-tray-monitor --enable-bwx-console --with-x
 
 ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
 CONF_ALL	+= --disable-acl --disable-xattr
 endif
 
-# Only for the last variant we build client stuff
-CONF_common	= --disable-tray-monitor --disable-bat
-
-CONF_mysql	= --with-mysql --without-postgresql --without-sqlite3 $(CONF_common)
-CONF_pgsql	= --with-postgresql --without-mysql --without-sqlite3 $(CONF_common)
-CONF_sqlite3	= --with-sqlite3 --without-mysql --without-postgresql \
-		  --enable-bat --enable-tray-monitor --enable-bwx-console --with-x
-
 LONGNAME_mysql		= mysql
 LONGNAME_pgsql		= postgresql
 LONGNAME_sqlite3	= sqlite3
@@ -71,7 +65,7 @@ LONGNAME_sqlite3	= sqlite3
 # args: 1 -- template file
 #       2 -- db type
 define template-subst
-sed -e 's/XX_DB_XX/$(2)/' '$(1)' > '$(patsubst %.in,%,$(subst -db.,-$(2).,$(1)))';
+sed -e 's/XX_DB_XX/$(2)/' -e 's/XX_DBLONGNAME_XX/$(LONGNAME_$(2))/' '$(1)' >'$(patsubst %.in,%,$(subst -db.,-$(2).,$(1)))';
 endef
 
 # Macro for cleanup file generated for specified database from specified template
@@ -118,10 +112,7 @@ override_dh_installinit:
 override_dh_install:
 	chmod 755 debian/additions/postinst-common
 	chmod 755 debian/scripts/install-dbconfig
-	dh_install \
-		-Nbacula-director-pgsql -Nbacula-sd-pgsql -Nbacula-common-pgsql \
-		-Nbacula-director-mysql -Nbacula-sd-mysql -Nbacula-common-mysql \
-		-Nbacula-director-sqlite3 -Nbacula-sd-sqlite3 -Nbacula-common-sqlite3
+	dh_install
 	chmod 755 debian/bacula-common/usr/lib/bacula/btraceback
 	######### dbconfig-common stuff
 	# Sometimes the latest release doesn't have a copy of the data in updatedb.
@@ -135,6 +126,14 @@ override_dh_install:
 	# dh_install can not rename files, so doing here
 	mv debian/bacula-traymonitor/usr/share/pixmaps/generic.xpm \
 		debian/bacula-traymonitor/usr/share/pixmaps/bacula-tray-monitor.xpm
+	# fix database type in some scripts
+	$(foreach db,$(VARIANTS),sed -i \
+	  -e "s/XX_DB_XX/$(db)/" \
+		-e "s/XX_DBLONGNAME_XX/$(LONGNAME_$(db))/" \
+		debian/bacula-director-$(db)/etc/bacula/scripts/make_catalog_backup \
+		debian/bacula-director-$(db)/etc/bacula/scripts/make_catalog_backup.pl \
+		debian/bacula-director-$(db)/lib/systemd/system/bacula-dir.service;)
+
 
 override_dh_installdocs:
 	dh_installdocs -pbacula --link-doc=bacula-common
@@ -143,26 +142,13 @@ override_dh_installdocs:
 		done
 	dh_installdocs -Nbacula
 
-override_dh_auto_build: maintfiles
+override_dh_auto_configure:
+	$(foreach db,$(VARIANTS),$(call db-templates-subst,$(db)))
 	autoconf -I autoconf/ -o configure autoconf/configure.in
-	dh_prep
-	dh_installdirs
-	dh_auto_configure -- $(CONF_ALL) $(CONF_pgsql)
-	dh_auto_build --parallel
-	dh_auto_install
-	dh_install -pbacula-director-pgsql -pbacula-sd-pgsql -pbacula-common-pgsql
-	dh_auto_clean
-	rm -rf debian/tmp
-	dh_auto_configure -- $(CONF_ALL) $(CONF_mysql)
-	dh_auto_build --parallel
-	dh_auto_install
-	dh_install -pbacula-director-mysql -pbacula-sd-mysql -pbacula-common-mysql
-	dh_auto_clean
-	rm -rf debian/tmp
-	dh_auto_configure -- $(CONF_ALL) $(CONF_sqlite3)
+	dh_auto_configure -- $(CONF_ALL)
+
+override_dh_auto_build:
 	dh_auto_build --parallel
-	dh_auto_install
-	dh_install -pbacula-director-sqlite3 -pbacula-sd-sqlite3 -pbacula-common-sqlite3
 
 override_dh_strip:
 	for pkg in $(DBGPKGS); do \
@@ -184,10 +170,4 @@ override_dh_fixperms:
 	chmod -x debian/bacula-common/usr/share/doc/bacula-common/examples/nagios/check_bacula/README
 	chmod +x debian/bacula-director-*/etc/bacula/scripts/make_catalog_backup_awk
 
-override_dh_prep:
-override_dh_auto_configure:
 override_dh_auto_test:
-override_dh_auto_install:
-
-maintfiles:
-	$(foreach db,$(VARIANTS),$(call db-templates-subst,$(db)))

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



More information about the pkg-bacula-commits mailing list