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 170c101099aa38c2ca1190d60d36bc9054d77f59..917f8b92956352a697670492344f1038397eaa15 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 971438b05769cd40ba8f2ce8b4079583c7182045..24e9fac5c66abae52999262b05740708d72fc76d 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 688045522afbf1143014534c1872c16fd4b8ff1b..f0e6a63175dfbdc6d1d1ff73190d060d00b6ee2a 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 f35e94e4068357173b45abed98ade9fb92c849b1..90c6e71d6e9278cf1dbbb0b34f1b99e11de7ac44 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 a5192eb5f1cbe3c21b1ffa68b8938bf6f6bfd246..9c6bccffb61219cfcec0be87904c1bbe15c5f2a5 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 f7bdb1f3d395c24f5bb709c60a8f4b673da19d3d..30cf02517389fbf948dc3ff188c5bb25e28d5fcd 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 4d8c098e9afd591895f2a48a57317e381ba96fe8..d3982a3963441dfc70dd53b9b9a9461343de1032 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'):