Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 311099 - app-backup/bacula-5.0.1-r2: Unable to compile with bacula-nodir USE flag set
Summary: app-backup/bacula-5.0.1-r2: Unable to compile with bacula-nodir USE flag set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: App-Backup Team
URL:
Whiteboard:
Keywords:
: 319257 332573 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-24 10:29 UTC by Robin Hill
Modified: 2010-08-19 10:29 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Hill 2010-03-24 10:29:58 UTC
I'm trying to build bacula on one of my systems, using the bacula-nodir flag to prevent building of the director (that's on another system).  The current ebuild is using bacula-clientonly instead of bacula-nodir in a couple of checks, incorrectly enforcing a database USE flag, and installing database update scripts, when neither are required if the director is not being built.

Reproducible: Always

Steps to Reproduce:
1. Set USE flags to "bacula-nodir -mysql -postgres -sqlite3" for app-backup/bacula
2. emerge bacula

Actual Results:  
Fails with error reporting:
 * To use bacula-5.0.1 it is required to set a database in the USE flags.
 * Supported databases are mysql, postgresql, sqlite3

Expected Results:  
Build completes and installs (without the database update scripts).
Comment 1 Robin Hill 2010-03-24 11:31:34 UTC
After including the sqlite3 USE flag, the build still aborted with an error from the configure script.

After checking, it seems that the SQL support is now required for building the storage daemon (though I'm not sure why as it's not linked against the SQL library), hence the USE flag enforcement is actually correct (though I still don't think the database update scripts should be installed).

There's incorrect bacula-nodir USE flag checks in excluding the SQL dependencies (line 36) and the database configure flags (line 158) though.
Comment 2 Phil Stracchino (Unix Ronin) 2010-03-24 22:56:29 UTC
(In reply to comment #1)
> After checking, it seems that the SQL support is now required for building the
> storage daemon (though I'm not sure why as it's not linked against the SQL
> library), hence the USE flag enforcement is actually correct (though I still
> don't think the database update scripts should be installed).


I just ran into this problem myself and was about to report it.

It has been true for some time that you must have SQL support defined when building the SD.  True, the SD itself does not require SQL support; but some of the tools built WITH it (bscan, for instance) do.  Thus SQl support is required both when building the Director and when building the SD.

I'm looking at the logic in the ebuild myself right now.  It's a simple fix.  Basically, --with-${mydbtype} needs to be used in any case OTHER than bacula-clientonly.  This ought to work:


--- bacula-5.0.1-r2.ebuild.orig 2010-03-23 06:12:39.000000000 -0400
+++ bacula-5.0.1-r2.ebuild      2010-03-24 18:55:17.756818447 -0400
@@ -151,14 +151,14 @@
                        $(use_enable static static-fd)"
        else
                myconf="${myconf} \
+                       --with-${mydbtype} \
+                       --enable-batch-insert \
                        $(use_enable static static-tools) \
                        $(use_enable static static-fd) \
                        $(use_enable !bacula-nodir build-dird) \
                        $(use_enable !bacula-nosd build-stored)"
                if ! use bacula-nodir; then
                        myconf="${myconf} \
-                               --with-${mydbtype} \
-                               --enable-batch-insert \
                                $(use_enable static static-dir)"
                fi
                if ! use bacula-nosd; then
Comment 3 Phil Stracchino (Unix Ronin) 2010-03-24 23:42:26 UTC
I have just tested and verified the above fix.  Could someone please apply that patch?
Comment 4 Robin Hill 2010-03-25 08:51:18 UTC
You also need the below change to the dependencies.

I'm not really happy with this though - it means a full postgres install is required in order to build binaries that have no postgres dependency (and this definitely was not required for Bacula 3.0.x).  I've tested and you can actually build the SD against sqlite3 regardless of which database the director is using, which is at least a lot smaller dependency.  Would making sqlite3 a requirement for bacula-nodir be a better option?

--- bacula-5.0.1-r2.ebuild.orig 2010-03-25 08:43:08.000000000 +0000
+++ bacula-5.0.1-r2.ebuild      2010-03-25 08:44:12.000000000 +0000
@@ -33,12 +33,10 @@
        >=sys-libs/zlib-1.1.4
        dev-libs/gmp
        !bacula-clientonly? (
-               !bacula-nodir? (
-                       postgres? ( >=virtual/postgresql-server-7.4 )
-                       mysql? ( virtual/mysql )
-                       sqlite3? ( dev-db/sqlite:3 )
-                       virtual/mta
-               )
+               postgres? ( >=virtual/postgresql-server-7.4 )
+               mysql? ( virtual/mysql )
+               sqlite3? ( dev-db/sqlite:3 )
+               !bacula-nodir? ( virtual/mta )
        )
        qt4? (
                x11-libs/qt-svg:4
Comment 5 Robin Hill 2010-03-25 16:25:01 UTC
I've brought this up on the bacula mailing list, and it seems that the database is required for building btape, bscan, etc. which we're including with the bacula-nodir option, so I guess the database dependency is required and I'll just have to put up with a full postgres install I don't use.
Comment 6 Thomas Beierlein gentoo-dev 2010-05-11 12:01:39 UTC
*** Bug 319257 has been marked as a duplicate of this bug. ***
Comment 7 Phil Stracchino (Unix Ronin) 2010-05-13 13:09:53 UTC
This problem is still present in 5.0.2.  Here is a rather simpler patch against 5.0.2:

--- bacula-5.0.2.ebuild.orig    2010-05-11 02:50:19.000000000 -0400
+++ bacula-5.0.2.ebuild 2010-05-13 08:54:37.622249278 -0400
@@ -153,11 +153,12 @@
                                --with-${mydbtype} \
                                --enable-batch-insert \
                                $(use_enable static static-dir)"
                fi
                if ! use bacula-nosd; then
-                       myconf="${myconf} $(use_enable static static-sd)"
+                       myconf="${myconf} $(use_enable static static-sd) \
+                               --with-${mydbtype}"
                fi
        fi

        if use qt4 && has_version '<x11-libs/qwt-5'; then
                eerror "x11-libs/qwt found in a version < 5, thus the"


In a full configuration this will result in '--with-[database type]' being specified twice, but this is harmless.
Comment 8 Wolfram Schlich (RETIRED) gentoo-dev 2010-05-14 08:08:19 UTC
Fixed in a revamp of 5.0.2.
No revbump as it doesn't affect already installed packages.
Comment 9 Thomas Beierlein gentoo-dev 2010-08-19 10:29:54 UTC
*** Bug 332573 has been marked as a duplicate of this bug. ***