build: Move uid_wrapper to third_party
authorAndreas Schneider <asn@samba.org>
Tue, 7 Nov 2017 11:02:19 +0000 (12:02 +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
third_party/uid_wrapper/uid_wrapper.c [moved from lib/uid_wrapper/uid_wrapper.c with 100% similarity]
third_party/uid_wrapper/wscript [moved from lib/uid_wrapper/wscript with 95% similarity]
third_party/wscript
wscript
wscript_build

index 9933615..3253f94 100644 (file)
@@ -54,3 +54,8 @@ Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER
 def CHECK_RESOLV_WRAPPER(conf):
     return conf.CHECK_BUNDLED_SYSTEM_PKG('resolv_wrapper', minversion='1.1.4')
 Build.BuildContext.CHECK_RESOLV_WRAPPER = CHECK_RESOLV_WRAPPER
+
+@conf
+def CHECK_UID_WRAPPER(conf):
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('uid_wrapper', minversion='1.2.4')
+Build.BuildContext.CHECK_UID_WRAPPER = CHECK_UID_WRAPPER
similarity index 95%
rename from lib/uid_wrapper/wscript
rename to third_party/uid_wrapper/wscript
index 9c1c009..6e1540f 100644 (file)
@@ -6,7 +6,7 @@ import os, sys
 VERSION="1.2.4"
 
 def configure(conf):
-    if conf.CHECK_BUNDLED_SYSTEM('uid_wrapper', minversion=VERSION, set_target=False):
+    if conf.CHECK_UID_WRAPPER():
         conf.DEFINE('USING_SYSTEM_UID_WRAPPER', 1)
         libuid_wrapper_so_path = 'libuid_wrapper.so'
     else:
@@ -113,7 +113,7 @@ syscall(SYS_setgroups32, 0, NULL);
 
         # Create full path to uid_wrapper
         blddir = os.path.realpath(conf.blddir)
-        libuid_wrapper_so_path = blddir + '/default/lib/uid_wrapper/libuid-wrapper.so'
+        libuid_wrapper_so_path = blddir + '/default/third_party/uid_wrapper/libuid-wrapper.so'
 
     conf.DEFINE('LIBUID_WRAPPER_SO_PATH', libuid_wrapper_so_path)
     conf.DEFINE('UID_WRAPPER', 1)
@@ -128,4 +128,3 @@ def build(bld):
                           deps='dl',
                           install=False,
                           realname='libuid-wrapper.so')
-
index a39c1eb..72f1daa 100644 (file)
@@ -55,6 +55,7 @@ def configure(conf):
         conf.RECURSE('socket_wrapper')
         conf.RECURSE('nss_wrapper')
         conf.RECURSE('resolv_wrapper')
+        conf.RECURSE('uid_wrapper')
 
 
 def build(bld):
@@ -85,3 +86,5 @@ def build(bld):
         bld.RECURSE('nss_wrapper')
     if bld.CONFIG_GET('RESOLV_WRAPPER'):
         bld.RECURSE('resolv_wrapper')
+    if bld.CONFIG_GET('UID_WRAPPER'):
+        bld.RECURSE('uid_wrapper')
diff --git a/wscript b/wscript
index 771555a..7dbaa90 100644 (file)
--- a/wscript
+++ b/wscript
@@ -171,6 +171,11 @@ def configure(conf):
             else:
                 conf.define('USING_SYSTEM_RESOLV_WRAPPER', 1)
 
+            if not conf.CHECK_UID_WRAPPER():
+                raise Utils.WafError('uid_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+            else:
+                conf.define('USING_SYSTEM_UID_WRAPPER', 1)
+
     conf.RECURSE('lib/ldb')
 
     if not (Options.options.without_ad_dc):
@@ -199,7 +204,6 @@ def configure(conf):
     conf.RECURSE('lib/crypto')
     conf.RECURSE('pidl')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
-        conf.RECURSE('lib/uid_wrapper')
         if Options.options.with_pam:
             conf.RECURSE('lib/pam_wrapper')
         if Options.options.with_ntvfs_fileserver != False:
index 2e89228..b7ebaae 100644 (file)
@@ -69,8 +69,6 @@ bld.RECURSE('source4/lib/cmdline')
 bld.RECURSE('source4/lib/http')
 if bld.CONFIG_GET('PAM_WRAPPER') and Options.options.with_pam:
     bld.RECURSE('lib/pam_wrapper')
-if bld.CONFIG_GET('UID_WRAPPER'):
-    bld.RECURSE('lib/uid_wrapper')
 if bld.CHECK_FOR_THIRD_PARTY():
     bld.RECURSE('third_party')
 bld.RECURSE('source4/lib/stream')