Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
index 0ab3436..0e89a9b 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
@@ -13,16 +13,17 @@
 therefore get killed.
 
 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
 ---
  packaging/systemd/nmb.service | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/packaging/systemd/nmb.service b/packaging/systemd/nmb.service
-index 992c0cd..555c9ab 100644
+index 71c93d6..f3d2fc2 100644
 --- a/packaging/systemd/nmb.service
 +++ b/packaging/systemd/nmb.service
 @@ -10,6 +10,7 @@ EnvironmentFile=-/etc/sysconfig/samba
- ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
+ ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS
  ExecReload=/usr/bin/kill -HUP $MAINPID
  LimitCORE=infinity
 +TimeoutStartSec=0
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
index c37cfcd..8ca7a52 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
@@ -1,13 +1,24 @@
-Don't check xsltproc manpages
+From 2214c2d1e455a38c891d17e421b438e3f7c495d8 Mon Sep 17 00:00:00 2001
+From: Bian Naimeng <biannm@cn.fujitsu.com>
+Date: Mon, 18 Apr 2016 17:00:53 -0400
+Subject: [PATCH] Don't check xsltproc manpages
 
+Upstream-Status: Pending
+ 
 Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
 
-Index: samba-4.4.2/lib/ldb/wscript
-===================================================================
---- samba-4.4.2.orig/lib/ldb/wscript
-+++ samba-4.4.2/lib/ldb/wscript
-@@ -65,7 +65,7 @@ def configure(conf):
-                 conf.define('USING_SYSTEM_LDB', 1)
+---
+ lib/ldb/wscript    | 2 +-
+ lib/talloc/wscript | 2 +-
+ lib/tdb/wscript    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/ldb/wscript b/lib/ldb/wscript
+index 5ea5231..d94086b 100644
+--- a/lib/ldb/wscript
++++ b/lib/ldb/wscript
+@@ -98,7 +98,7 @@ def configure(conf):
+         conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
  
      if conf.env.standalone_ldb:
 -        conf.CHECK_XSLTPROC_MANPAGES()
@@ -15,24 +26,24 @@
  
          # we need this for the ldap backend
          if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
-Index: samba-4.4.2/lib/talloc/wscript
-===================================================================
---- samba-4.4.2.orig/lib/talloc/wscript
-+++ samba-4.4.2/lib/talloc/wscript
-@@ -56,7 +56,7 @@ def configure(conf):
-     if conf.env.standalone_talloc:
-         conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
+diff --git a/lib/talloc/wscript b/lib/talloc/wscript
+index df7e6be..b3305cf 100644
+--- a/lib/talloc/wscript
++++ b/lib/talloc/wscript
+@@ -49,7 +49,7 @@ def configure(conf):
+         conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+         conf.env.TALLOC_VERSION = VERSION
  
 -    conf.CHECK_XSLTPROC_MANPAGES()
 +    #conf.CHECK_XSLTPROC_MANPAGES()
  
-     if not conf.env.disable_python:
-         # also disable if we don't have the python libs installed
-Index: samba-4.4.2/lib/tdb/wscript
-===================================================================
---- samba-4.4.2.orig/lib/tdb/wscript
-+++ samba-4.4.2/lib/tdb/wscript
-@@ -92,7 +92,7 @@ def configure(conf):
+     conf.CHECK_HEADERS('sys/auxv.h')
+     conf.CHECK_FUNCS('getauxval')
+diff --git a/lib/tdb/wscript b/lib/tdb/wscript
+index 4782550..6bb3fa1 100644
+--- a/lib/tdb/wscript
++++ b/lib/tdb/wscript
+@@ -89,7 +89,7 @@ def configure(conf):
          not conf.env.disable_tdb_mutex_locking):
          conf.define('USE_TDB_MUTEX_LOCKING', 1)
  
@@ -41,3 +52,6 @@
  
      if not conf.env.disable_python:
          # also disable if we don't have the python libs installed
+-- 
+2.14.3
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
index 025ac27..6a7f8fa 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
@@ -6,6 +6,7 @@
 Upstream-Status: Pending
 
 Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
 ---
  lib/replace/wscript | 4 +++-
  source3/wscript     | 5 ++++-
@@ -16,9 +17,9 @@
 index f0040b1..aca73af 100644
 --- a/lib/replace/wscript
 +++ b/lib/replace/wscript
-@@ -101,7 +101,9 @@ struct foo bar = { .y = 'X', .x = 1 };
- 
-     conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
+@@ -101,7 +101,9 @@ def configure(conf):
+     conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
+     conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
  
 -    conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
 +    if not Options.options.disable_valgrind:
@@ -26,12 +27,12 @@
 +
      conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
      conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
-     conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h malloc.h')
+     conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
 diff --git a/source3/wscript b/source3/wscript
 index bac3dd5..a5c51ea 100644
 --- a/source3/wscript
 +++ b/source3/wscript
-@@ -1016,7 +1016,10 @@ syscall(SYS_setgroups32, 0, NULL);
+@@ -1070,7 +1070,10 @@ syscall(SYS_setgroups32, 0, NULL);
              Logs.warn("--with-dnsupdate=yes but gssapi support not sufficient")
          else:
              conf.DEFINE('WITH_DNS_UPDATES', 1)
@@ -44,12 +45,12 @@
          if conf.CONFIG_SET('HAVE_VALGRIND_H') or conf.CONFIG_SET('HAVE_VALGRIND_VALGRIND_H'):
              conf.DEFINE('VALGRIND', '1')
 diff --git a/wscript b/wscript
-index 7679c0f..681ac17 100644
+index 542a60c..22e6116 100644
 --- a/wscript
 +++ b/wscript
-@@ -72,6 +72,10 @@ def set_options(opt):
-                    help=("Disable systemd integration"),
-                    action='store_false', dest='enable_systemd')
+@@ -86,6 +86,10 @@ def set_options(opt):
+                   help=("Disable RELRO builds"),
+                   action="store_false", dest='enable_relro')
  
 +    opt.add_option('--without-valgrind',
 +                   help=("Disable use of the valgrind headers"),
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
new file mode 100644
index 0000000..0c7592f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
@@ -0,0 +1,19 @@
+samba: build dnsserver_common code
+
+Just 'install' does not seem to do it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/source4/dns_server/wscript_build
++++ b/source4/dns_server/wscript_build
+@@ -4,7 +4,7 @@ bld.SAMBA_LIBRARY('dnsserver_common',
+         source='dnsserver_common.c',
+         deps='samba-util samba-errors ldbsamba clidns',
+         private_library=True,
+-        install=bld.AD_DC_BUILD_IS_ENABLED()
++        enabled=bld.AD_DC_BUILD_IS_ENABLED()
+         )
+ 
+ bld.SAMBA_MODULE('service_dns',
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
new file mode 100644
index 0000000..5ae8c59
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
@@ -0,0 +1,25 @@
+samba: defeat iconv test
+
+A test was added when configuring samba which requires target code
+to be executed.  In general, this will not work, so we eliminate it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/lib/util/charset/wscript_configure
++++ b/lib/util/charset/wscript_configure
+@@ -17,6 +17,8 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'i
+     
+     conf.DEFINE('HAVE_NATIVE_ICONV', 1)
+ 
++"""
++[added for 4.7.0, but breaks cross-compilation]
+ conf.CHECK_CODE('''
+                 uint8_t inbuf[2] = { 0x30, 0xdf };
+                 uint8_t outbuf[4] = { 0 };
+@@ -36,3 +38,4 @@ conf.CHECK_CODE('''
+                 msg='Checking errno of iconv for illegal multibyte sequence',
+                 lib='iconv',
+                 headers='errno.h iconv.h')
++"""
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.2.7-pam.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch
similarity index 73%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.2.7-pam.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch
index 6b9ade9..0cbacb6 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.2.7-pam.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch
@@ -4,12 +4,11 @@
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
-
-Index: samba-4.4.5/source3/wscript
+Index: samba-4.7.0/source3/wscript
 ===================================================================
---- samba-4.4.5.orig/source3/wscript
-+++ samba-4.4.5/source3/wscript
-@@ -873,7 +873,7 @@ msg.msg_accrightslen = sizeof(fd);
+--- samba-4.7.0.orig/source3/wscript
++++ samba-4.7.0/source3/wscript
+@@ -875,7 +875,7 @@ msg.msg_accrightslen = sizeof(fd);
          if conf.env.with_iconv:
              conf.DEFINE('HAVE_ICONV', 1)
  
@@ -18,10 +17,10 @@
          use_pam=True
          conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
          if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
-@@ -945,6 +945,15 @@ int i; i = PAM_RADIO_TYPE;
-         if use_pam:
-             conf.DEFINE('WITH_PAM', 1)
-             conf.DEFINE('WITH_PAM_MODULES', 1)
+@@ -952,6 +952,17 @@ int i; i = PAM_RADIO_TYPE;
+                        "or headers not found. Use --without-pam to disable "
+                        "PAM support.");
+ 
 +    else:
 +        Logs.warn("PAM disabled")
 +        use_pam=False
@@ -31,6 +30,8 @@
 +        conf.undefine('PAM_RHOST')
 +        conf.undefine('PAM_TTY')
 +        conf.undefine('HAVE_PAM_PAM_APPL_H')
- 
++
++
      seteuid = False
  
+ #
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
new file mode 100644
index 0000000..77c8b36
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
@@ -0,0 +1,19 @@
+samba: correct log files location
+
+We use /var/log/samba.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/packaging/RHEL/setup/smb.conf
++++ b/packaging/RHEL/setup/smb.conf
+@@ -63,7 +63,7 @@
+ 
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+-   log file = /usr/local/samba/var/log.%m
++   log file = /var/log/samba/log.%m
+ 
+ # Put a capping on the size of the log files (in Kb).
+    max log size = 50
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb
similarity index 77%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb
index 2b227c9..a8517c5 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb
@@ -20,21 +20,28 @@
            file://0006-avoid-using-colon-in-the-checking-msg.patch \
            file://netdb_defines.patch \
            file://glibc_only.patch \
+           file://iconv-4.7.0.patch \
+           file://dnsserver-4.7.0.patch \
+           file://smb_conf-4.7.0.patch \
            file://volatiles.03_samba \
           "
 SRC_URI_append_libc-musl = " \
-           file://samba-4.2.7-pam.patch \
+           file://samba-pam.patch \
            file://samba-4.3.9-remove-getpwent_r.patch \
           "
 
-SRC_URI[md5sum] = "c6ee5c766016d59908c8fb672fbbd445"
-SRC_URI[sha256sum] = "9ef24393de08390f236cabccd6a420b5cea304e959cbf1a99ff317325db3ddfa"
+SRC_URI[md5sum] = "0253021a45c479cec1e135b004a0177a"
+SRC_URI[sha256sum] = "1eede30fc8ef6504e24602fb72b00baa0a7b73b59f16d25cb0771dc8c7c57d6e"
 
 inherit systemd waf-samba cpan-base perlnative update-rc.d
 # remove default added RDEPENDS on perl
 RDEPENDS_${PN}_remove = "perl"
 
-DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam"
+DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libbsd libaio libpam"
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "pam"
+
 DEPENDS_append_libc-musl = " libtirpc"
 CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
 LDFLAGS_append_libc-musl = " -ltirpc"
@@ -45,12 +52,20 @@
 INITSCRIPT_NAME = "samba"
 INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
 
-SYSTEMD_PACKAGES = "${PN}-base winbind"
+SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind"
 SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service"
+SYSTEMD_SERVICE_${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
 SYSTEMD_SERVICE_winbind = "winbind.service"
 
+# There are prerequisite settings to enable ad-dc, so disable the service by default.
+# Reference:
+# https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
+SYSTEMD_AUTO_ENABLE_${PN}-ad-dc = "disable"
+
+# Use krb5.  Build active domain controller.
+#
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
-                   acl cups ldap \
+                   acl ad-dc cups gnutls ldap mitkrb5 \
 "
 
 RDEPENDS_${PN}-base += "${LSB}"
@@ -68,13 +83,30 @@
 PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
 PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
 
+# Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS,
+# And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to:
+# http://samba.2283325.n4.nabble.com/samba-4-6-6-Unknown-dependency-kdc-in-service-kdc-objlist-td4722096.html
+# So the working combination is:
+# 1) ad-dc: enable, gnutls: enable, mitkrb5: disable
+# 2) ad-dc: disable, gnutls: enable/disable, mitkrb5: enable
+#
+# We are now at 4.7.0, so take the above with a grain of salt. We do not need to know where
+# krb5kdc is unless ad-dc is enabled, but we tell configure anyhow.
+#
+PACKAGECONFIG[ad-dc] = ",--without-ad-dc,,"
+PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
+PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
 
 SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
 SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
 SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
 SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
 
-SAMBA4_LIBS="heimdal,!zlib,!popt,!talloc,!pytalloc,!pytalloc-util,!tevent,!pytevent,!tdb,!pytdb,!ldb,!pyldb"
+# These libraries are supposed to replace others supplied by packages, but decorate the names of
+# .so files so there will not be a conflict.  This is not done consistantly, so be very careful
+# when adding to this list.
+#
+SAMBA4_LIBS="heimdal,cmocka,NONE"
 
 EXTRA_OECONF += "--enable-fhs \
                  --with-piddir=/run \
@@ -82,13 +114,10 @@
                  --with-modulesdir=${libdir}/samba \
                  --with-lockdir=${localstatedir}/lib/samba \
                  --with-cachedir=${localstatedir}/lib/samba \
-                 --disable-gnutls \
                  --disable-rpath-install \
                  --with-shared-modules=${SAMBA4_MODULES} \
                  --bundled-libraries=${SAMBA4_LIBS} \
-                 --with-system-mitkrb5 \
-                 --without-ad-dc \
-                 ${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
+                 ${@oe.utils.conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
                  --with-cluster-support \
                  --with-profiling-data \
                  --with-libiconv=${STAGING_DIR_HOST}${prefix} \
@@ -113,6 +142,10 @@
         -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
         -i ${D}${systemd_system_unitdir}/*.service
 
+    if [ "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'yes', 'no', d)}" = "no" ]; then
+        rm -f ${D}${systemd_system_unitdir}/samba.service
+    fi
+
     install -d ${D}${sysconfdir}/tmpfiles.d
     install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
     echo "d ${localstatedir}/log/samba 0755 root root -" \
@@ -133,7 +166,7 @@
 
     install -d ${D}${sysconfdir}/samba
     echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
-    install -m644 packaging/LSB/smb.conf ${D}${sysconfdir}/samba/smb.conf
+    install -m644 packaging/RHEL/setup/smb.conf ${D}${sysconfdir}/samba/smb.conf
     install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
 
     install -d ${D}${sysconfdir}/default
@@ -161,8 +194,8 @@
 PACKAGES =+ "${PN}-python ${PN}-pidl \
              ${PN}-dsdb-modules ${PN}-testsuite registry-tools \
              winbind \
-             ${PN}-common ${PN}-base ${PN}-ctdb-tests \
-             smbclient"
+             ${PN}-common ${PN}-base ${PN}-ad-dc ${PN}-ctdb-tests \
+             smbclient ${PN}-client ${PN}-server ${PN}-test"
 
 python samba_populate_packages() {
     def module_hook(file, pkg, pattern, format, basename):
@@ -196,9 +229,14 @@
                     ${localstatedir}/nmbd \
                     ${localstatedir}/spool/samba \
                     ${systemd_system_unitdir}/nmb.service \
-                    ${systemd_system_unitdir}/samba.service \
                     ${systemd_system_unitdir}/smb.service"
 
+FILES_${PN}-ad-dc = "${sbindir}/samba \
+                     ${systemd_system_unitdir}/samba.service \
+                     ${libdir}/krb5/plugins/kdb/samba.so \
+                    "
+RDEPENDS_${PN}-ad-dc = "krb5-kdc"
+
 FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
                           ${bindir}/ctdb_run_cluster_tests \
                           ${sysconfdir}/ctdb/nodes \
@@ -254,3 +292,27 @@
 
 RDEPENDS_${PN}-pidl_append = " perl"
 FILES_${PN}-pidl = "${bindir}/pidl ${datadir}/perl5/Parse"
+
+RDEPENDS_${PN}-client = "\
+    smbclient \
+    winbind \
+    registry-tools \
+    ${PN}-pidl \
+    " 
+
+ALLOW_EMPTY_${PN}-client = "1"
+
+RDEPENDS_${PN}-server = "\
+    ${PN} \
+    winbind \
+    registry-tools \
+    " 
+
+ALLOW_EMPTY_${PN}-server = "1"
+
+RDEPENDS_${PN}-test = "\
+    ${PN}-ctdb-tests \
+    ${PN}-testsuite \
+    "
+
+ALLOW_EMPTY_${PN}-test = "1"