build: Move nss_wrapper to third_party
authorAndreas Schneider <asn@samba.org>
Tue, 7 Nov 2017 10:40:11 +0000 (11:40 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 25 Nov 2017 09:14:13 +0000 (10:14 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
buildtools/wafsamba/samba_third_party.py
lib/README
selftest/target/Samba3.pm
third_party/nss_wrapper/nss_wrapper.c [moved from lib/nss_wrapper/nss_wrapper.c with 100% similarity]
third_party/nss_wrapper/nss_wrapper.pl [moved from lib/nss_wrapper/nss_wrapper.pl with 100% similarity]
third_party/nss_wrapper/wscript [moved from lib/nss_wrapper/wscript with 96% similarity]
third_party/wscript
wscript
wscript_build

index 170c101..917f8b9 100644 (file)
@@ -44,3 +44,8 @@ Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
 def CHECK_SOCKET_WRAPPER(conf):
     return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.1.7')
 Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
+
+@conf
+def CHECK_NSS_WRAPPER(conf):
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.3')
+Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER
index 971438b..24e9fac 100644 (file)
@@ -1,7 +1,5 @@
 compression - Various compression algorithms (MSZIP, lzxpress)
 dnspython - Python module for working with DNS.
-nss_wrapper - Wrapper for the user and group NSS API allowing the use 
-              of other data sources.
 popt - Command-line option parsing library
 replace - Provides replacements for standard (POSIX, C99) functions 
           not provided by the host platform.
index 6880455..f0e6a63 100755 (executable)
@@ -1598,7 +1598,7 @@ sub provision($$$$$$$$$)
        my $conffile="$libdir/server.conf";
        my $dfqconffile="$libdir/dfq.conf";
 
-       my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/lib/nss_wrapper/nss_wrapper.pl";
+       my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/third_party/nss_wrapper/nss_wrapper.pl";
        my $nss_wrapper_passwd = "$privatedir/passwd";
        my $nss_wrapper_group = "$privatedir/group";
        my $nss_wrapper_hosts = "$ENV{SELFTEST_PREFIX}/hosts";
similarity index 96%
rename from lib/nss_wrapper/wscript
rename to third_party/nss_wrapper/wscript
index f35e94e..90c6e71 100644 (file)
@@ -5,7 +5,7 @@ import os
 VERSION="1.1.3"
 
 def configure(conf):
-    if conf.CHECK_BUNDLED_SYSTEM('nss_wrapper', minversion=VERSION, set_target=False):
+    if conf.CHECK_NSS_WRAPPER():
         conf.DEFINE('USING_SYSTEM_NSS_WRAPPER', 1)
         libnss_wrapper_so_path = 'libnss_wrapper.so'
     else:
@@ -102,7 +102,7 @@ def configure(conf):
 
         # Create full path to nss_wrapper
         blddir = os.path.realpath(conf.blddir)
-        libnss_wrapper_so_path = blddir + '/default/lib/nss_wrapper/libnss-wrapper.so'
+        libnss_wrapper_so_path = blddir + '/default/third_party/nss_wrapper/libnss-wrapper.so'
 
     conf.DEFINE('LIBNSS_WRAPPER_SO_PATH', libnss_wrapper_so_path)
     conf.DEFINE('NSS_WRAPPER', 1)
index a5192eb..9c6bccf 100644 (file)
@@ -53,6 +53,7 @@ def configure(conf):
     conf.RECURSE('aesni-intel')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
         conf.RECURSE('socket_wrapper')
+        conf.RECURSE('nss_wrapper')
 
 
 def build(bld):
@@ -79,3 +80,5 @@ def build(bld):
     bld.RECURSE('aesni-intel')
     if bld.CONFIG_GET('SOCKET_WRAPPER'):
         bld.RECURSE('socket_wrapper')
+    if bld.CONFIG_GET('NSS_WRAPPER'):
+        bld.RECURSE('nss_wrapper')
diff --git a/wscript b/wscript
index f7bdb1f..30cf025 100644 (file)
--- a/wscript
+++ b/wscript
@@ -161,6 +161,11 @@ def configure(conf):
             else:
                 conf.define('USING_SYSTEM_SOCKET_WRAPPER', 1)
 
+            if not conf.CHECK_NSS_WRAPPER():
+                raise Utils.WafError('nss_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+            else:
+                conf.define('USING_SYSTEM_NSS_WRAPPER', 1)
+
     conf.RECURSE('lib/ldb')
 
     if not (Options.options.without_ad_dc):
@@ -189,7 +194,6 @@ def configure(conf):
     conf.RECURSE('lib/crypto')
     conf.RECURSE('pidl')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
-        conf.RECURSE('lib/nss_wrapper')
         conf.RECURSE('lib/resolv_wrapper')
         conf.RECURSE('lib/uid_wrapper')
         if Options.options.with_pam:
index 4d8c098..d3982a3 100644 (file)
@@ -67,8 +67,6 @@ bld.RECURSE('source4/lib/messaging')
 bld.RECURSE('source4/lib/events')
 bld.RECURSE('source4/lib/cmdline')
 bld.RECURSE('source4/lib/http')
-if bld.CONFIG_GET('NSS_WRAPPER'):
-    bld.RECURSE('lib/nss_wrapper')
 if bld.CONFIG_GET('PAM_WRAPPER') and Options.options.with_pam:
     bld.RECURSE('lib/pam_wrapper')
 if bld.CONFIG_GET('RESOLV_WRAPPER'):