auth: Move auth_session_info into IDL
[samba.git] / source4 / librpc / wscript_build
old mode 100644 (file)
new mode 100755 (executable)
index 5dba84c..ce015cc
-bld.SAMBA_LIBRARY('LIBNDR',
-       'ndr/ndr_string.c ../../librpc/ndr/ndr_basic.c ../../librpc/ndr/uuid.c ../torture/ndr/ndr.c ../../librpc/ndr/ndr_misc.c ../../librpc/gen_ndr/ndr_misc.c',
-       # PC_FILES='../librpc/ndr.pc',
-       public_deps='LIBSAMBA-ERRORS talloc LIBSAMBA-UTIL CHARSET LIBSAMBA-HOSTCONFIG',
-       public_headers='../../librpc/ndr/libndr.h ../../librpc/gen_ndr/misc.h ../../librpc/gen_ndr/ndr_misc.h',
-       vnum='0.0.1'
-       )
-
-
-bld.SAMBA_BINARY('ndrdump',
-       '../../librpc/tools/ndrdump.c',
-       manpages='../../librpc/tools/ndrdump.1',
-       installdir='BINDIR',
-       deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT POPT_SAMBA NDR_TABLE LIBSAMBA-ERRORS'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_COMPRESSION',
-       '../../librpc/ndr/ndr_compression.c',
-       public_deps='LIBSAMBA-ERRORS LIBNDR',
-       deps='ZLIB LZXPRESS'
-       )
+#!/usr/bin/env python
 
+bld.RECURSE('../../librpc/idl')
+bld.RECURSE('../../librpc/tools')
+bld.RECURSE('idl')
 
-bld.SAMBA_SUBSYSTEM('NDR_SECURITY',
-       '../../librpc/gen_ndr/ndr_security.c ../../librpc/ndr/ndr_sec_helper.c gen_ndr/ndr_server_id.c',
-       public_deps='LIBNDR LIBSECURITY',
-       public_headers='../libcli/security/security.h gen_ndr/server_id.h'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_AUDIOSRV',
-       '../../librpc/gen_ndr/ndr_audiosrv.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_NAMED_PIPE_AUTH',
-       '../../librpc/gen_ndr/ndr_named_pipe_auth.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DNSSERVER',
-       '../../librpc/gen_ndr/ndr_dnsserver.c',
-       public_deps='LIBNDR'
+bld.SAMBA_SUBSYSTEM('NDR_SERVER_ID4',
+       source='gen_ndr/ndr_server_id4.c',
+       deps='ndr',
+       public_headers='gen_ndr/server_id4.h',
+       header_path='gen_ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_WINSTATION',
-       'gen_ndr/ndr_winstation.c',
-       public_deps='LIBNDR'
+       source='gen_ndr/ndr_winstation.c',
+       public_deps='ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_IRPC',
-       'gen_ndr/ndr_irpc.c',
-       public_deps='LIBNDR NDR_SECURITY NDR_NBT'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DCOM',
-       '../../librpc/gen_ndr/ndr_dcom.c',
-       public_deps='LIBNDR NDR_SECURITY NDR_ORPC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_WMI',
-       '../../librpc/ndr/ndr_wmi.c ../../librpc/gen_ndr/ndr_wmi.c',
-       public_deps='LIBNDR NDR_SECURITY NDR_DCOM'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DSBACKUP',
-       '../../librpc/gen_ndr/ndr_dsbackup.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_EFS',
-       '../../librpc/gen_ndr/ndr_efs.c',
-       public_deps='LIBNDR NDR_SECURITY'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_ROT',
-       '../../librpc/gen_ndr/ndr_rot.c',
-       public_deps='LIBNDR NDR_ORPC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_FRSRPC',
-       '../../librpc/ndr/ndr_frsrpc.c ../../librpc/gen_ndr/ndr_frsrpc.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_FRSAPI',
-       '../../librpc/gen_ndr/ndr_frsapi.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_FRSTRANS',
-       '../../librpc/gen_ndr/ndr_frstrans.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DRSUAPI',
-       '../../librpc/ndr/ndr_drsuapi.c ../../librpc/gen_ndr/ndr_drsuapi.c',
-       public_deps='LIBNDR NDR_COMPRESSION NDR_SECURITY NDR_STANDARD ASN1_UTIL'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DRSBLOBS',
-       '../../librpc/ndr/ndr_drsblobs.c ../../librpc/gen_ndr/ndr_drsblobs.c',
-       public_deps='LIBNDR NDR_DRSUAPI'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DFSBLOBS',
-       '../../librpc/gen_ndr/ndr_dfsblobs.c',
-       public_deps='LIBNDR'
+       source='gen_ndr/ndr_irpc.c',
+       public_deps='ndr NDR_SECURITY NDR_NBT'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_SASL_HELPERS',
-       'gen_ndr/ndr_sasl_helpers.c',
-       public_deps='LIBNDR'
+       source='gen_ndr/ndr_sasl_helpers.c',
+       public_deps='ndr'
        )
 
 
-bld.SAMBA_SUBSYSTEM('NDR_POLICYAGENT',
-       '../../librpc/gen_ndr/ndr_policyagent.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_UNIXINFO',
-       '../../librpc/gen_ndr/ndr_unixinfo.c',
-       public_deps='LIBNDR NDR_SECURITY'
-       )
-
 
 bld.SAMBA_SUBSYSTEM('NDR_NFS4ACL',
-       'gen_ndr/ndr_nfs4acl.c',
-       public_deps='LIBNDR NDR_SECURITY'
+       source='gen_ndr/ndr_nfs4acl.c',
+       public_deps='ndr NDR_SECURITY'
        )
 
 
-bld.SAMBA_SUBSYSTEM('NDR_SPOOLSS',
-       '../../librpc/gen_ndr/ndr_spoolss.c',
-       public_deps='LIBNDR NDR_SPOOLSS_BUF NDR_SECURITY'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_SPOOLSS_BUF',
-       '../../librpc/ndr/ndr_spoolss_buf.c'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_EPMAPPER',
-       '../../librpc/gen_ndr/ndr_epmapper.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DBGIDL',
-       '../../librpc/gen_ndr/ndr_dbgidl.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DSSETUP',
-       '../../librpc/gen_ndr/ndr_dssetup.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_MSGSVC',
-       '../../librpc/gen_ndr/ndr_msgsvc.c',
-       public_deps='LIBNDR'
-       )
-
 
 bld.SAMBA_SUBSYSTEM('NDR_WINSIF',
-       'gen_ndr/ndr_winsif.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_MGMT',
-       '../../librpc/gen_ndr/ndr_mgmt.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_PROTECTED_STORAGE',
-       '../../librpc/gen_ndr/ndr_protected_storage.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_ORPC',
-       '../../librpc/ndr/ndr_orpc.c ../../librpc/gen_ndr/ndr_orpc.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_OXIDRESOLVER',
-       '../../librpc/gen_ndr/ndr_oxidresolver.c',
-       public_deps='LIBNDR NDR_ORPC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_REMACT',
-       '../../librpc/gen_ndr/ndr_remact.c',
-       public_deps='LIBNDR NDR_ORPC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_WZCSVC',
-       '../../librpc/gen_ndr/ndr_wzcsvc.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_BROWSER',
-       '../../librpc/gen_ndr/ndr_browser.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_W32TIME',
-       '../../librpc/gen_ndr/ndr_w32time.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_SCERPC',
-       '../../librpc/gen_ndr/ndr_scerpc.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_TRKWKS',
-       '../../librpc/gen_ndr/ndr_trkwks.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_KEYSVC',
-       '../../librpc/gen_ndr/ndr_keysvc.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_KRB5PAC',
-       '../../librpc/ndr/ndr_krb5pac.c ../../librpc/gen_ndr/ndr_krb5pac.c',
-       public_deps='LIBNDR NDR_STANDARD NDR_SECURITY'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_XATTR',
-       '../../librpc/ndr/ndr_xattr.c ../../librpc/gen_ndr/ndr_xattr.c',
-       public_deps='LIBNDR NDR_SECURITY'
+       source='gen_ndr/ndr_winsif.c',
+       public_deps='ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_OPENDB',
-       'gen_ndr/ndr_opendb.c',
-       public_deps='LIBNDR'
+       source='gen_ndr/ndr_opendb.c',
+       public_deps='ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_NOTIFY',
-       'gen_ndr/ndr_notify.c',
-       public_deps='LIBNDR'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_SCHANNEL',
-       '../../librpc/ndr/ndr_schannel.c ../../librpc/gen_ndr/ndr_schannel.c',
-       public_deps='LIBNDR NDR_NBT'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_NBT',
-       '../../librpc/gen_ndr/ndr_nbt.c',
-       public_deps='LIBNDR NDR_NBT_BUF NDR_SECURITY NDR_STANDARD LIBCLI_NDR_NETLOGON',
-       public_headers='../../librpc/gen_ndr/nbt.h'
+       source='gen_ndr/ndr_s4_notify.c',
+       public_deps='ndr NDR_SERVER_ID4'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_NTP_SIGND',
-       'gen_ndr/ndr_ntp_signd.c',
-       public_deps='LIBNDR'
+       source='gen_ndr/ndr_ntp_signd.c',
+       public_deps='ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_WINSREPL',
-       'gen_ndr/ndr_winsrepl.c',
-       public_deps='LIBNDR NDR_NBT'
+       source='gen_ndr/ndr_winsrepl.c',
+       public_deps='ndr NDR_NBT'
        )
 
 
 bld.SAMBA_SUBSYSTEM('NDR_WINBIND',
-       'gen_ndr/ndr_winbind.c',
-       public_deps='LIBNDR NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_NTLMSSP',
-       '../../librpc/ndr/ndr_ntlmssp.c ../../librpc/gen_ndr/ndr_ntlmssp.c',
-       public_deps='LIBNDR NDR_STANDARD'
-       )
-
-
-bld.SAMBA_LIBRARY('NDR_STANDARD',
-       '../../librpc/gen_ndr/ndr_echo.c ../../librpc/gen_ndr/ndr_lsa.c ../../librpc/gen_ndr/ndr_samr.c ../../librpc/ndr/ndr_netlogon.c ../../librpc/gen_ndr/ndr_netlogon.c ../../libcli/ndr_netlogon.c ../../librpc/gen_ndr/ndr_dfs.c ../../librpc/gen_ndr/ndr_atsvc.c ../../librpc/gen_ndr/ndr_wkssvc.c ../../librpc/gen_ndr/ndr_srvsvc.c ../../librpc/ndr/ndr_svcctl.c ../../librpc/gen_ndr/ndr_svcctl.c ../../librpc/gen_ndr/ndr_winreg.c ../../librpc/gen_ndr/ndr_initshutdown.c ../../librpc/gen_ndr/ndr_eventlog.c ../../librpc/gen_ndr/ndr_ntsvcs.c',
-       vnum='0.0.1',
-       # PC_FILES='../librpc/ndr_standard.pc',
-       deps='NDR_SECURITY',
-       public_deps='LIBNDR',
-       public_headers='../../librpc/gen_ndr/samr.h ../../librpc/gen_ndr/ndr_samr.h ../rpc_server/lsa/lsa.h ../torture/rpc/netlogon.h ../../librpc/gen_ndr/atsvc.h ../../librpc/gen_ndr/ndr_atsvc.h ../../librpc/ndr/ndr_svcctl.h ../../librpc/gen_ndr/ndr_svcctl.h ../../librpc/gen_ndr/svcctl.h'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_TABLE',
-       '../../librpc/ndr/ndr_table.c gen_ndr/tables.c',
-       public_deps='NDR_STANDARD NDR_AUDIOSRV NDR_DSBACKUP NDR_EFS NDR_DRSUAPI NDR_POLICYAGENT NDR_UNIXINFO NDR_SPOOLSS NDR_EPMAPPER NDR_DBGIDL NDR_DSSETUP NDR_MSGSVC NDR_WINSIF NDR_MGMT NDR_PROTECTED_STORAGE NDR_OXIDRESOLVER NDR_REMACT NDR_WZCSVC NDR_BROWSER NDR_W32TIME NDR_SCERPC NDR_TRKWKS NDR_KEYSVC NDR_KRB5PAC NDR_XATTR NDR_SCHANNEL NDR_ROT NDR_DRSBLOBS NDR_NBT NDR_WINSREPL NDR_SECURITY NDR_DNSSERVER NDR_WINSTATION NDR_IRPC NDR_OPENDB NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI NDR_FRSTRANS NDR_NFS4ACL NDR_NTP_SIGND NDR_DCOM NDR_WMI NDR_NAMED_PIPE_AUTH NDR_NTLMSSP NDR_DFSBLOBS'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_XATTR',
-       '../../librpc/gen_ndr/ndr_xattr_c.c',
-       public_deps='NDR_XATTR dcerpc'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_ROT',
-       '../../librpc/gen_ndr/ndr_rot_c.c',
-       public_deps='NDR_ROT dcerpc'
+       source='gen_ndr/ndr_winbind.c',
+       public_deps='NDR_IDMAP ndr ndr-standard'
        )
 
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_AUDIOSRV',
-       '../../librpc/gen_ndr/ndr_audiosrv_c.c',
-       public_deps='NDR_AUDIOSRV dcerpc'
+# create a grouping library to consolidate our samba4 specific NDR code
+bld.SAMBA_LIBRARY('ndr-samba4',
+       source=[],
+       deps='NDR_WINBIND NDR_IRPC NDR_NFS4ACL NDR_OPENDB NDR_NOTIFY ndr-table',
+       private_library=True,
+       grouping_library=True
        )
 
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_ECHO',
-       '../../librpc/gen_ndr/ndr_echo_c.c',
-       public_deps='dcerpc NDR_STANDARD'
+# a grouping library for RPC_NDR subsystems that may be used by more than one target
+bld.SAMBA_LIBRARY('dcerpc-samba4',
+       source=[],
+       deps='RPC_NDR_WINBIND',
+       private_library=True,
+       grouping_library=True
        )
 
 
-bld.SAMBA_SUBSYSTEM('RPC_NDR_DSBACKUP',
-       '../../librpc/gen_ndr/ndr_dsbackup_c.c',
-       public_deps='dcerpc NDR_DSBACKUP'
-       )
+bld.SAMBA_PIDL_TABLES('GEN_NDR_TABLES', 'gen_ndr/tables.c')
 
+if bld.env.enable_s3build:
+    s3_ndr = "NDR_WBINT"
+else:
+    s3_ndr = ""
 
-bld.SAMBA_SUBSYSTEM('RPC_NDR_EFS',
-       '../../librpc/gen_ndr/ndr_efs_c.c',
-       public_deps='dcerpc NDR_EFS'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_LSA',
-       '../../librpc/gen_ndr/ndr_lsa_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_DFS',
-       '../../librpc/gen_ndr/ndr_dfs_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_FRSAPI',
-       '../../librpc/gen_ndr/ndr_frsapi_c.c',
-       public_deps='dcerpc NDR_FRSAPI'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_DRSUAPI',
-       '../../librpc/gen_ndr/ndr_drsuapi_c.c',
-       public_deps='dcerpc NDR_DRSUAPI'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_POLICYAGENT',
-       '../../librpc/gen_ndr/ndr_policyagent_c.c',
-       public_deps='dcerpc NDR_POLICYAGENT'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_UNIXINFO',
-       '../../librpc/gen_ndr/ndr_unixinfo_c.c',
-       public_deps='dcerpc NDR_UNIXINFO'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_BROWSER',
-       '../../librpc/gen_ndr/ndr_browser_c.c',
-       public_deps='dcerpc NDR_BROWSER'
-       )
+bld.SAMBA_SUBSYSTEM('ndr-table',
+       source='../../librpc/ndr/ndr_table.c gen_ndr/tables.c',
+        public_deps='''ndr-standard NDR_AUDIOSRV NDR_DSBACKUP NDR_EFS
+        NDR_DRSUAPI NDR_POLICYAGENT NDR_UNIXINFO NDR_SPOOLSS NDR_EPMAPPER
+        NDR_DBGIDL NDR_DSSETUP NDR_MSGSVC NDR_WINSIF NDR_MGMT
+        NDR_OXIDRESOLVER NDR_REMACT NDR_WZCSVC
+        NDR_BROWSER NDR_W32TIME NDR_SCERPC NDR_TRKWKS NDR_KEYSVC ndr-krb5pac
+        NDR_XATTR NDR_SCHANNEL NDR_ROT NDR_DRSBLOBS NDR_NBT NDR_WINSREPL
+        NDR_SECURITY NDR_DNSSERVER NDR_WINSTATION NDR_IRPC NDR_OPENDB
+        NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI
+        NDR_FRSTRANS NDR_NFS4ACL NDR_NTP_SIGND NDR_DCOM NDR_WMI
+        NDR_NAMED_PIPE_AUTH NDR_NTLMSSP NDR_DFSBLOBS NDR_DNSP
+        NDR_NTPRINTING NDR_DNS NDR_BACKUPKEY NDR_PREG ''' + s3_ndr,
+        depends_on='GEN_NDR_TABLES'
+        )
 
 
 bld.SAMBA_SUBSYSTEM('RPC_NDR_IRPC',
-       'gen_ndr/ndr_irpc_c.c',
+       source='gen_ndr/ndr_irpc_c.c',
        public_deps='dcerpc NDR_IRPC'
        )
 
-
-bld.SAMBA_LIBRARY('dcerpc_samr',
-       '../../librpc/gen_ndr/ndr_samr_c.c',
-       # PC_FILES='dcerpc_samr.pc',
-       vnum='0.0.1',
-       public_deps='dcerpc NDR_STANDARD',
-       public_headers='../../librpc/gen_ndr/ndr_samr_c.h'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_SPOOLSS',
-       '../../librpc/gen_ndr/ndr_spoolss_c.c',
-       public_deps='dcerpc NDR_SPOOLSS'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_WKSSVC',
-       '../../librpc/gen_ndr/ndr_wkssvc_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_SRVSVC',
-       '../../librpc/gen_ndr/ndr_srvsvc_c.c',
-       public_deps='dcerpc NDR_SRVSVC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_SVCCTL',
-       '../../librpc/gen_ndr/ndr_svcctl_c.c',
-       public_deps='dcerpc NDR_STANDARD',
-       public_headers='../../librpc/gen_ndr/ndr_svcctl_c.h'
+bld.SAMBA_SUBSYSTEM('RPC_NDR_WINBIND',
+       source='gen_ndr/ndr_winbind_c.c',
+       public_deps='dcerpc NDR_WINBIND'
        )
 
 
-bld.SAMBA_LIBRARY('dcerpc_atsvc',
-       '../../librpc/gen_ndr/ndr_atsvc_c.c',
-       # PC_FILES='dcerpc_atsvc.pc',
+bld.SAMBA_LIBRARY('dcerpc-samr',
+       source='',
+       pc_files='dcerpc_samr.pc',
        vnum='0.0.1',
-       public_deps='dcerpc NDR_STANDARD',
-       public_headers='../../librpc/gen_ndr/ndr_atsvc_c.h'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_EVENTLOG',
-       '../../librpc/gen_ndr/ndr_eventlog_c.c',
-       public_deps='dcerpc NDR_STANDARD'
+       public_deps='dcerpc ndr-standard RPC_NDR_SAMR',
+       public_headers='../../librpc/gen_ndr/ndr_samr_c.h',
+       header_path='gen_ndr'
        )
 
 
-bld.SAMBA_SUBSYSTEM('RPC_NDR_EPMAPPER',
-       '../../librpc/gen_ndr/ndr_epmapper_c.c',
-       public_deps='NDR_EPMAPPER'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_DBGIDL',
-       '../../librpc/gen_ndr/ndr_dbgidl_c.c',
-       public_deps='dcerpc NDR_DBGIDL'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_DSSETUP',
-       '../../librpc/gen_ndr/ndr_dssetup_c.c',
-       public_deps='dcerpc NDR_DSSETUP'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_MSGSVC',
-       '../../librpc/gen_ndr/ndr_msgsvc_c.c',
-       public_deps='dcerpc NDR_MSGSVC'
+bld.SAMBA_LIBRARY('dcerpc-atsvc',
+       source='',
+       pc_files='dcerpc_atsvc.pc',
+       vnum='0.0.1',
+       public_deps='dcerpc ndr-standard RPC_NDR_ATSVC',
+       public_headers='../../librpc/gen_ndr/ndr_atsvc_c.h',
+       header_path='gen_ndr'
        )
 
 
 bld.SAMBA_SUBSYSTEM('RPC_NDR_WINSIF',
-       'gen_ndr/ndr_winsif_c.c',
+       source='gen_ndr/ndr_winsif_c.c',
        public_deps='dcerpc NDR_WINSIF'
        )
 
 
-bld.SAMBA_SUBSYSTEM('RPC_NDR_WINREG',
-       '../../librpc/gen_ndr/ndr_winreg_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_INITSHUTDOWN',
-       '../../librpc/gen_ndr/ndr_initshutdown_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_MGMT',
-       '../../librpc/gen_ndr/ndr_mgmt_c.c',
-       deps='NDR_MGMT'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_PROTECTED_STORAGE',
-       '../../librpc/gen_ndr/ndr_protected_storage_c.c',
-       public_deps='dcerpc NDR_PROTECTED_STORAGE'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_OXIDRESOLVER',
-       '../../librpc/gen_ndr/ndr_oxidresolver_c.c',
-       public_deps='dcerpc NDR_OXIDRESOLVER'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_REMACT',
-       '../../librpc/gen_ndr/ndr_remact_c.c',
-       public_deps='dcerpc NDR_REMACT'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_WZCSVC',
-       '../../librpc/gen_ndr/ndr_wzcsvc_c.c',
-       public_deps='dcerpc NDR_WZCSVC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_W32TIME',
-       '../../librpc/gen_ndr/ndr_w32time_c.c',
-       public_deps='dcerpc NDR_W32TIME'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_SCERPC',
-       '../../librpc/gen_ndr/ndr_scerpc_c.c',
-       public_deps='dcerpc NDR_SCERPC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_NTSVCS',
-       '../../librpc/gen_ndr/ndr_ntsvcs_c.c',
-       public_deps='dcerpc NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_NETLOGON',
-       '../../librpc/gen_ndr/ndr_netlogon_c.c',
-       public_deps='NDR_STANDARD'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_TRKWKS',
-       '../../librpc/gen_ndr/ndr_trkwks_c.c',
-       public_deps='dcerpc NDR_TRKWKS'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('RPC_NDR_KEYSVC',
-       '../../librpc/gen_ndr/ndr_keysvc_c.c',
-       public_deps='dcerpc NDR_KEYSVC'
-       )
-
-
-bld.SAMBA_SUBSYSTEM('NDR_DCERPC',
-       '../../librpc/gen_ndr/ndr_dcerpc.c',
-       public_deps='LIBNDR',
-       public_headers='rpc/dcerpc.h ../../librpc/gen_ndr/ndr_dcerpc.h'
-       )
-
-
 bld.SAMBA_LIBRARY('dcerpc',
-       'rpc/dcerpc.c rpc/dcerpc_auth.c rpc/dcerpc_schannel.c rpc/dcerpc_util.c rpc/dcerpc_smb.c rpc/dcerpc_smb2.c rpc/dcerpc_sock.c rpc/dcerpc_connect.c rpc/dcerpc_secondary.c ../../librpc/rpc/binding.c ../../librpc/rpc/dcerpc_error.c',
-       # PC_FILES='dcerpc.pc',
-       deps='samba_socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 LIBNDR NDR_DCERPC RPC_NDR_EPMAPPER NDR_SCHANNEL RPC_NDR_NETLOGON RPC_NDR_MGMT gensec LIBCLI_AUTH LIBCLI_RAW LP_RESOLVE',
+       source='''rpc/dcerpc.c rpc/dcerpc_auth.c rpc/dcerpc_schannel.c
+       rpc/dcerpc_util.c rpc/dcerpc_smb.c rpc/dcerpc_smb2.c rpc/dcerpc_sock.c
+       rpc/dcerpc_connect.c rpc/dcerpc_secondary.c''',
+       pc_files='dcerpc.pc',
+       deps='samba_socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 ndr NDR_DCERPC RPC_NDR_EPMAPPER NDR_SCHANNEL RPC_NDR_NETLOGON RPC_NDR_MGMT gensec LIBCLI_AUTH LIBCLI_RAW LP_RESOLVE UTIL_TEVENT rpccommon',
        autoproto='rpc/dcerpc_proto.h',
-       public_deps='CREDENTIALS',
-       public_headers='../../librpc/gen_ndr/mgmt.h ../../librpc/gen_ndr/ndr_mgmt.h ../../librpc/gen_ndr/ndr_mgmt_c.h ../../librpc/gen_ndr/epmapper.h ../../librpc/gen_ndr/ndr_epmapper.h ../../librpc/gen_ndr/ndr_epmapper_c.h',
+       public_deps='credentials tevent talloc',
+       public_headers='''rpc/dcerpc.h ../../librpc/gen_ndr/mgmt.h
+       ../../librpc/gen_ndr/ndr_mgmt.h ../../librpc/gen_ndr/ndr_mgmt_c.h
+       ../../librpc/gen_ndr/epmapper.h ../../librpc/gen_ndr/ndr_epmapper.h
+       ../../librpc/gen_ndr/ndr_epmapper_c.h ../../librpc/rpc/rpc_common.h''',
+       # It's very important to keep this form of construction
+       # it force the sambawaf extension to put everything that match the first element
+       # (*gen_ndr*) into the dir named by the second element (gen_ndr).
+       # If we just put header_path = 'gen_ndr' then all the public_headers will go
+       # in 'gen_ndr' and for dcerpc.h (at least) it will cause a problem as
+       # we have already a dcerpc.h installed by librpc/wscript_build
+       # and one will overright the other which is not what we expect.
+       header_path=[ ('*gen_ndr*', 'gen_ndr') ],
        vnum='0.0.1'
        )
 
+bld.SAMBA_SUBSYSTEM('pyrpc_util',
+       source='rpc/pyrpc_util.c',
+       public_deps='pytalloc-util pyparam_util dcerpc',
+       pyext=True,
+       )
+
 
 bld.SAMBA_PYTHON('python_dcerpc',
-       'rpc/pyrpc.c',
-       public_deps='LIBCLI_SMB LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG pycredentials pyparam_util',
+       source='rpc/pyrpc.c',
+       public_deps='LIBCLI_SMB samba-util samba-hostconfig dcerpc-samr RPC_NDR_LSA DYNCONFIG pyrpc_util',
        realname='samba/dcerpc/base.so'
        )
 
+bld.SAMBA_PYTHON('python_srvsvc',
+    source='../../librpc/gen_ndr/py_srvsvc.c',
+    deps='RPC_NDR_SRVSVC pytalloc-util pyrpc_util',
+    realname='samba/dcerpc/srvsvc.so'
+    )
 
 bld.SAMBA_PYTHON('python_echo',
-       '../../librpc/gen_ndr/py_echo.c',
-       deps='RPC_NDR_ECHO PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_echo.c',
+       deps='RPC_NDR_ECHO pytalloc-util pyrpc_util',
        realname='samba/dcerpc/echo.so'
        )
 
+bld.SAMBA_PYTHON('python_auth',
+       source='../../librpc/gen_ndr/py_auth.c',
+       deps='NDR_AUTH pytalloc-util pyrpc_util',
+       realname='samba/dcerpc/auth.so'
+       )
+
+bld.SAMBA_PYTHON('python_krb5pac',
+       source='../../librpc/gen_ndr/py_krb5pac.c',
+       deps='ndr-krb5pac pytalloc-util pyrpc_util',
+       realname='samba/dcerpc/krb5pac.so'
+       )
 
 bld.SAMBA_PYTHON('python_winreg',
-       '../../librpc/gen_ndr/py_winreg.c',
-       deps='RPC_NDR_WINREG PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_winreg.c',
+       deps='RPC_NDR_WINREG pytalloc-util pyrpc_util',
        realname='samba/dcerpc/winreg.so'
        )
 
 
 bld.SAMBA_PYTHON('python_dcerpc_misc',
-       'ndr/py_misc.c',
-       deps='PYTALLOC python_dcerpc NDR_MISC NDR_KRB5PAC',
+       source='../../librpc/gen_ndr/py_misc.c',
+       deps='pytalloc-util pyrpc_util ndr-krb5pac',
        realname='samba/dcerpc/misc.so'
        )
 
 
 bld.SAMBA_PYTHON('python_initshutdown',
-       '../../librpc/gen_ndr/py_initshutdown.c',
-       deps='RPC_NDR_INITSHUTDOWN PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_initshutdown.c',
+       deps='RPC_NDR_INITSHUTDOWN pytalloc-util pyrpc_util',
        realname='samba/dcerpc/initshutdown.so'
        )
 
 
 bld.SAMBA_PYTHON('python_epmapper',
-       '../../librpc/gen_ndr/py_epmapper.c',
-       deps='dcerpc PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_epmapper.c',
+       deps='dcerpc pytalloc-util pyrpc_util',
        realname='samba/dcerpc/epmapper.so'
        )
 
 
 bld.SAMBA_PYTHON('python_mgmt',
-       '../../librpc/gen_ndr/py_mgmt.c',
-       deps='PYTALLOC param pycredentials dcerpc python_dcerpc',
+       source='../../librpc/gen_ndr/py_mgmt.c',
+       deps='pytalloc-util dcerpc pyrpc_util',
        realname='samba/dcerpc/mgmt.so'
        )
 
 
 bld.SAMBA_PYTHON('python_atsvc',
-       '../../librpc/gen_ndr/py_atsvc.c',
-       deps='dcerpc_atsvc PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_atsvc.c',
+       deps='dcerpc-atsvc pytalloc-util pyrpc_util',
        realname='samba/dcerpc/atsvc.so'
        )
 
 
 bld.SAMBA_PYTHON('python_dcerpc_nbt',
-       '../../librpc/gen_ndr/py_nbt.c',
-       deps='NDR_NBT PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_nbt.c',
+       deps='NDR_NBT RPC_NDR_NBT pytalloc-util pyrpc_util',
        realname='samba/dcerpc/nbt.so'
        )
 
 
 bld.SAMBA_PYTHON('python_samr',
-       '../../librpc/gen_ndr/py_samr.c',
-       deps='dcerpc_samr PYTALLOC pycredentials pyparam_util python_dcerpc',
+       source='../../librpc/gen_ndr/py_samr.c',
+       deps='dcerpc-samr pytalloc-util pyrpc_util',
        realname='samba/dcerpc/samr.so'
        )
 
 
 bld.SAMBA_PYTHON('python_svcctl',
-       '../../librpc/gen_ndr/py_svcctl.c',
-       deps='RPC_NDR_SVCCTL PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_svcctl.c',
+       deps='RPC_NDR_SVCCTL pytalloc-util pyrpc_util',
        realname='samba/dcerpc/svcctl.so'
        )
 
 
 bld.SAMBA_PYTHON('python_lsa',
-       '../../librpc/gen_ndr/py_lsa.c',
-       deps='RPC_NDR_LSA PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_lsa.c',
+       deps='RPC_NDR_LSA pytalloc-util pyrpc_util',
        realname='samba/dcerpc/lsa.so'
        )
 
 
 bld.SAMBA_PYTHON('python_wkssvc',
-       '../../librpc/gen_ndr/py_wkssvc.c',
-       deps='RPC_NDR_WKSSVC PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_wkssvc.c',
+       deps='RPC_NDR_WKSSVC pytalloc-util pyrpc_util',
        realname='samba/dcerpc/wkssvc.so'
        )
 
 
 bld.SAMBA_PYTHON('python_dfs',
-       '../../librpc/gen_ndr/py_dfs.c',
-       deps='RPC_NDR_DFS PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_dfs.c',
+       deps='RPC_NDR_DFS pytalloc-util pyrpc_util',
        realname='samba/dcerpc/dfs.so'
        )
 
 
 bld.SAMBA_PYTHON('python_unixinfo',
-       '../../librpc/gen_ndr/py_unixinfo.c',
-       deps='RPC_NDR_UNIXINFO PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_unixinfo.c',
+       deps='RPC_NDR_UNIXINFO pytalloc-util pyrpc_util',
        realname='samba/dcerpc/unixinfo.so'
        )
 
 
 bld.SAMBA_PYTHON('python_irpc',
-       'gen_ndr/py_irpc.c',
-       deps='RPC_NDR_IRPC PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='gen_ndr/py_irpc.c',
+       deps='RPC_NDR_IRPC pytalloc-util pyrpc_util',
        realname='samba/dcerpc/irpc.so'
        )
 
+bld.SAMBA_PYTHON('python_winbind',
+       source='gen_ndr/py_winbind.c',
+       deps='RPC_NDR_WINBIND pytalloc-util pyrpc_util python_netlogon',
+       realname='samba/dcerpc/winbind.so'
+       )
+
+bld.SAMBA_PYTHON('python_idmap',
+       source='../../librpc/gen_ndr/py_idmap.c',
+       deps='NDR_IDMAP pytalloc-util pyrpc_util',
+       realname='samba/dcerpc/idmap.so'
+       )
+
 
 bld.SAMBA_PYTHON('python_drsuapi',
-       '../../librpc/gen_ndr/py_drsuapi.c',
-       deps='RPC_NDR_DRSUAPI PYTALLOC pyparam_util pycredentials python_dcerpc',
+       source='../../librpc/gen_ndr/py_drsuapi.c',
+       deps='RPC_NDR_DRSUAPI pytalloc-util pyrpc_util',
        realname='samba/dcerpc/drsuapi.so'
        )
 
-
 bld.SAMBA_PYTHON('python_dcerpc_security',
-       'ndr/py_security.c',
-       deps='PYTALLOC python_dcerpc_misc python_dcerpc NDR_SECURITY',
+       source='../../librpc/gen_ndr/py_security.c',
+       deps='pytalloc-util pyrpc_util NDR_SECURITY',
        realname='samba/dcerpc/security.so'
        )
 
+bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
+       source='../../librpc/gen_ndr/py_drsblobs.c',
+       deps='pytalloc-util pyrpc_util NDR_SECURITY RPC_NDR_DRSBLOBS',
+       realname='samba/dcerpc/drsblobs.so'
+       )
+
+bld.SAMBA_PYTHON('python_dcerpc_dnsp',
+       source='../../librpc/gen_ndr/py_dnsp.c',
+       deps='pytalloc-util pyrpc_util NDR_SECURITY RPC_NDR_DNSP',
+       realname='samba/dcerpc/dnsp.so'
+       )
+
 
 bld.SAMBA_PYTHON('python_dcerpc_xattr',
-       'ndr/py_xattr.c',
-       deps='PYTALLOC python_dcerpc_misc python_dcerpc python_dcerpc_security NDR_XATTR RPC_NDR_XATTR',
+       source='../../librpc/gen_ndr/py_xattr.c',
+       deps='pytalloc-util pyrpc_util RPC_NDR_XATTR',
        realname='samba/dcerpc/xattr.so'
        )
 
+bld.SAMBA_PYTHON('python_netlogon',
+       source='../../librpc/gen_ndr/py_netlogon.c',
+       deps='RPC_NDR_NETLOGON pytalloc-util pyrpc_util',
+       realname='samba/dcerpc/netlogon.so'
+       )
 
-S4_IDL=bld.SUBDIR('idl',
-                      '''irpc.idl nfs4acl.idl notify.idl ntp_signd.idl opendb.idl sasl_helpers.idl server_id.idl winbind.idl winsif.idl winsrepl.idl winstation.idl''');
+bld.SAMBA_SCRIPT('python_dcerpc_init',
+                 pattern='rpc/dcerpc.py',
+                 installdir='python/samba/dcerpc',
+                 installname='__init__.py')
 
-bld.SAMBA_PIDL_LIST('gen_ndr', S4_IDL,
-                    options="--includedir=../../librpc/idl")
+bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/dcerpc', 'rpc/dcerpc.py', destname='__init__.py')