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 99336154deffb99a7a653e5969b412551d0ecbaf..3253f948b8b9687a06ed21747fb4b7d066a45e22 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 9c1c0090770f686436f61f784923799d5199b178..6e1540f108d5f8d54d2c625b071dc90d2dcd7d07 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 a39c1ebdc100c6daa7b8a901c09a2e194d226884..72f1daabcde35a42f19e68e37a462f469aad589a 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 771555a1c04431750e2c39e6e4275f9b6eb69a50..7dbaa90e7735bd5ad438c5c85c0cb60cd9b4b8eb 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 2e8922803986a171b8ea5fbac736fa2b3c594119..b7ebaae630eb5be3a248b65d5c52a0dd29e78b63 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')