On Sun, 12 Dec 2010 20:09:38 +0100, gregor herrmann wrote:

> Now the question is how to proceed:

Some more investigation:

> - Apply a similar patch like fix_scripts.sed again; I have to admit
>   that the magic in the old debian/rules seems a bit complicated :)

If we go this way the affected scripts in
bacula-director-pgsql_5.0.2-2.1_i386.deb are:

etc/bacula/scripts/make_catalog_backup:BINDIR=/usr/lib/postgresql/9.0/bin
etc/bacula/scripts/make_catalog_backup.pl:$ENV{PATH}="/usr/lib/postgresql/9.0/bin:$ENV{PATH}";
usr/share/bacula-director/update_postgresql_tables:bindir=/usr/lib/postgresql/9.0/bin
usr/share/bacula-director/make_postgresql_tables:bindir=/usr/lib/postgresql/9.0/bin
usr/share/bacula-director/grant_postgresql_privileges:bindir=/usr/lib/postgresql/9.0/bin

Patching them is certainly possible (although not completly trivial)
but the most invasive change to the package of these three options.

> - Directly patch the path in configure (and maybe
>   autoconf/bacula-macros/db.m4?)

Patching configure is enough, and changing `"$PG_CONFIG" --bindir`
there to /usr/bin is enough. --libdir and --includedir have the some
(version-agnostic) output with both 8.4 and 9.0 [0]

I've built the package with the attached patch and verified that all
scripts mentioned above contain /usr/bin as $bindir etc.

> - An easy ways seems to be to call ./configure with
>   "--with-postgresql=/usr". That leads to
>     SQL binaries Directory   /usr/bin
>   in config.out [0] and BINDIR in make_catalog_backup is set to
>   /usr/bin (and $ENV{PATH} in make_catalog_backup.pl doesn't contain
>   /usr/lib/postgresql/9.0/bin any more).
> 
> The third option looks quite promising; the only thing that concerns
> me is that the batch insert support seems to get turned off?! But
> this only happens on i386 and not on amd64 so it is probably
> unrelated. -- I'm attaching the trivial diff for this possible
> solution.

With the patch to configure (and not using the
"--with-postgresql=/usr" option) batch insert support is again
enabled on i386.
 

Cheers,
gregor
  

[0] 

Setting up libpq-dev (8.4.5-0squeeze2) ...                           

$ pg_config --includedir --libdir --bindir                                   
/usr/include/postgresql                                                      
/usr/lib                                                          
/usr/lib/postgresql/8.4/bin                                        

                                                                                
        
Setting up libpq-dev (9.0.1-2) ...                                              
    

$ pg_config --includedir --libdir --bindir                                      
    
/usr/include/postgresql                        
/usr/lib                                        
/usr/lib/postgresql/9.0/bin                                          

-- 
 .''`.   http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-    NP: Rolling Stones: Ygts
only in patch2:
unchanged:
--- bacula-5.0.2.orig/configure
+++ bacula-5.0.2/configure
@@ -27991,7 +27991,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
@@ -28878,7 +28878,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

Attachment: signature.asc
Description: Digital signature

Reply via email to