Add manpages argument to SAMBA_LIBRARY().
[samba.git] / source4 / lib / ldb / wscript
index 971c6688f30747648bc9a980688f7b7d70853997..61fe9cbe402e283c77d6f5542d74edf9951291f0 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'ldb'
-VERSION = '0.9.10'
+VERSION = '0.9.11'
 
 blddir = 'bin'
 
@@ -15,8 +15,9 @@ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
 
 import wafsamba, samba_dist
 
-samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
-                        lib/tdb:lib/tdb lib/tevent:lib/tevent buildtools:buildtools''')
+samba_dist.DIST_DIRS('''source4/lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
+                        lib/tdb:lib/tdb lib/tevent:lib/tevent lib/popt:lib/popt
+                        buildtools:buildtools''')
 
 
 def set_options(opt):
@@ -36,14 +37,20 @@ def configure(conf):
 
     s4_build = getattr(conf.env, '_SAMBA_BUILD_', 0) == 4
 
+    conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
 
-    if not s4_build:
+    if not conf.env.standalone_ldb:
         if conf.CHECK_BUNDLED_SYSTEM('ldb', minversion=VERSION,
                                      onlyif='talloc tdb tevent',
                                      implied_deps='replace talloc tdb tevent'):
             conf.define('USING_SYSTEM_LDB', 1)
+
+    if conf.env.standalone_ldb:
+        conf.find_program('xsltproc', var='XSLTPROC')
+
         # we need this for the ldap backend
-        conf.CHECK_FUNCS_IN('ber_flush ldap_open', 'lber ldap', headers='lber.h ldap.h', mandatory=True)
+        if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+            conf.env.ENABLE_LDAP_BACKEND = True
 
     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
 
@@ -132,7 +139,7 @@ def build(bld):
     bld.SAMBA_MODULE('ldb_ldap', 'ldb_ldap/ldb_ldap.c',
                      init_function='LDB_BACKEND(ldapi),LDB_BACKEND(ldaps),LDB_BACKEND(ldap)',
                      deps='talloc lber ldap',
-                     enabled=not s4_build,
+                     enabled=bld.env.ENABLE_LDAP_BACKEND,
                      subsystem='LIBLDB')
 
     # we're not currently linking against the ldap libs, but ldb.pc.in
@@ -146,6 +153,9 @@ def build(bld):
     ldb_deps = 'tevent LIBLDB'
     if s4_build:
         ldb_deps += ' LDBSAMBA POPT_CREDENTIALS POPT_SAMBA LIBCMDLINE_CREDENTIALS gensec'
+        abi_file='ABI/ldb-samba4-%s.sigs' % VERSION
+    else:
+        abi_file='ABI/ldb-%s.sigs' % VERSION
 
     if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
         modules_dir = bld.EXPAND_VARIABLES('${LDB_MODULESDIR}')
@@ -153,10 +163,13 @@ def build(bld):
                           COMMON_SRC + ' ' + LDB_MAP_SRC,
                           deps=ldb_deps,
                           includes='include',
-                          public_headers='include/ldb.h include/ldb_errors.h',
+                          public_headers='include/ldb.h include/ldb_errors.h '\
+                                                                        'include/ldb_module.h',
                           pc_files='ldb.pc',
                           cflags='-DLDB_MODULESDIR=\"%s\"' % modules_dir,
-                          vnum=VERSION)
+                          abi_file=abi_file,
+                          abi_match='!ldb_*module_ops !ldb_*backend_ops ldb_*',
+                          vnum=VERSION, manpages='man/ldb3.')
 
     bld.SAMBA_SUBSYSTEM('LIBLDB_CMDLINE',
                         'tools/ldbutil.c tools/cmdline.c',
@@ -164,15 +177,14 @@ def build(bld):
 
     LDB_TOOLS='ldbadd ldbsearch ldbdel ldbmodify ldbedit ldbrename'
     for t in LDB_TOOLS.split():
-        bld.SAMBA_BINARY(t, 'tools/%s.c' % t, deps='LIBLDB_CMDLINE')
+        bld.SAMBA_BINARY(t, 'tools/%s.c' % t, deps='LIBLDB_CMDLINE', manpages='man/%s.1' % t)
 
     # ldbtest doesn't get installed
     bld.SAMBA_BINARY('ldbtest', 'tools/ldbtest.c', deps='LIBLDB_CMDLINE', install=False)
 
-    if s4_build:
-        bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
-                         deps='ldb',
-                         realname='ldb.so')
+    bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
+                     deps='ldb',
+                     realname='ldb.so')
 
 
 def test(ctx):
@@ -180,3 +192,7 @@ def test(ctx):
     import Utils
     cmd = 'tests/test-tdb.sh'
     os.system(cmd)
+
+def dist():
+    '''makes a tarball for distribution'''
+    samba_dist.dist()