message "Samba can use samba-vfs with a virus scanner," &&
message "You will still have to select which scanner to use." &&
-config_query SAMBA_VSCAN "Do you want to add support for on-acces virus
scannning?" n
+config_query SAMBA_VSCAN "Do you want to add support for on-acces virus
scannning?" n &&
+
+# must be the last query
+if spell_ok tdb || spell_ok talloc; then
+ message "${MESSAGE_COLOR}Installed versions of tdb and/or talloc spells
detected." &&
+ message "You won't be able to use internal copies of them from
$SPELL.${DEFAULT_COLOR}" &&
+ config_query SAMBA_CROSSLIB "Do you want to avoid that and run conflicts
procedure?" n
+fi
diff --git a/net/samba/CONFLICTS b/net/samba/CONFLICTS
index dc88904..2d8d6f0 100755
--- a/net/samba/CONFLICTS
+++ b/net/samba/CONFLICTS
@@ -1 +1,6 @@
-conflicts samba4
+conflicts samba4 &&
+
+if [[ $SAMBA_CROSSLIB == y ]]; then
+ conflicts tdb y
+ conflicts talloc y
+fi
diff --git a/net/samba/DEPENDS b/net/samba/DEPENDS
index 2d7e83e..48e457e 100755
--- a/net/samba/DEPENDS
+++ b/net/samba/DEPENDS
@@ -11,15 +11,27 @@ else
"for LDAP support"
fi &&
-optional_depends talloc \
- "--enable-external-libtalloc" \
- "--disable-external-libtalloc" \
- "to use system talloc library" &&
-
-optional_depends tdb \
- "--enable-external-libtdb" \
- "--disable-external-libtdb" \
- "to use system tdb library" &&
+if ! spell_ok talloc; then
+ optional_depends talloc \
+ "--enable-external-libtalloc" \
+ "--disable-external-libtalloc" \
+ "to use system talloc library"
+else
+ if [[ $SAMBA_CROSSLIB == n ]]; then
+ depends talloc '--enable-external-libtalloc'
+ fi
+fi &&
+
+if ! spell_ok tdb; then
+ optional_depends tdb \
+ "--enable-external-libtdb" \
+ "--disable-external-libtdb" \
+ "to use system tdb library"
+else
+ if [[ $SAMBA_CROSSLIB == n ]]; then
+ depends tdb '--enable-external-libtdb'
+ fi
+fi &&