s4:dsdb/samdb: add configure checks for libgpgme
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Jan 2016 09:51:38 +0000 (10:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2016 14:03:27 +0000 (16:03 +0200)
This will be used to store the cleartext utf16 password
GPG encrypted as 'Primary:SambaGPG' in the
supplementalCredentials attribute.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/dsdb/samdb/ldb_modules/wscript [new file with mode: 0644]
wscript

diff --git a/source4/dsdb/samdb/ldb_modules/wscript b/source4/dsdb/samdb/ldb_modules/wscript
new file mode 100644 (file)
index 0000000..65f36ac
--- /dev/null
@@ -0,0 +1,32 @@
+
+import Logs, Options, sys
+import samba3
+
+def set_options(opt):
+    help =  "Build with gpgme support (default=auto). "
+    help += "This requires gpgme devel and python packages "
+    help += "(e.g. libgpgme11-dev, python-gpgme on debian/ubuntu)."
+
+    opt.SAMBA3_ADD_OPTION('gpgme', default=None, help=(help))
+
+    return
+
+def configure(conf):
+    conf.SET_TARGET_TYPE('gpgme', 'EMPTY')
+
+    if Options.options.with_gpgme != False:
+        conf.find_program('gpgme-config', var='GPGME_CONFIG')
+
+        if conf.env.GPGME_CONFIG:
+            conf.CHECK_CFG(path=conf.env.GPGME_CONFIG, args="--cflags --libs",
+                           package="", uselib_store="gpgme",
+                           msg='Checking for gpgme support')
+
+        if conf.CHECK_FUNCS_IN('gpgme_new', 'gpgme', headers='gpgme.h'):
+            conf.DEFINE('ENABLE_GPGME', '1')
+
+        if not conf.CONFIG_SET('ENABLE_GPGME'):
+            if Options.options.with_gpgme == True:
+                conf.fatal('GPGME support requested, but no suitable GPGME library found')
+            else:
+                Logs.warn('no suitable GPGME library found')
diff --git a/wscript b/wscript
index ff4bceec7b31a01f00e577209f5c210e0f8ed09a..77aacef65e4215e24104904f25620a4985f95e72 100644 (file)
--- a/wscript
+++ b/wscript
@@ -39,6 +39,7 @@ def set_options(opt):
     opt.RECURSE('lib/ldb')
     opt.RECURSE('selftest')
     opt.RECURSE('source4/lib/tls')
     opt.RECURSE('lib/ldb')
     opt.RECURSE('selftest')
     opt.RECURSE('source4/lib/tls')
+    opt.RECURSE('source4/dsdb/samdb/ldb_modules')
     opt.RECURSE('pidl')
     opt.RECURSE('source3')
     opt.RECURSE('lib/util')
     opt.RECURSE('pidl')
     opt.RECURSE('source3')
     opt.RECURSE('lib/util')
@@ -152,6 +153,7 @@ def configure(conf):
     if conf.CONFIG_GET('KRB5_VENDOR') in (None, 'heimdal'):
         conf.RECURSE('source4/heimdal_build')
     conf.RECURSE('source4/lib/tls')
     if conf.CONFIG_GET('KRB5_VENDOR') in (None, 'heimdal'):
         conf.RECURSE('source4/heimdal_build')
     conf.RECURSE('source4/lib/tls')
+    conf.RECURSE('source4/dsdb/samdb/ldb_modules')
     conf.RECURSE('source4/ntvfs/sysdep')
     conf.RECURSE('lib/util')
     conf.RECURSE('lib/util/charset')
     conf.RECURSE('source4/ntvfs/sysdep')
     conf.RECURSE('lib/util')
     conf.RECURSE('lib/util/charset')