anchor.diff:  	install -d ${D}${sysconfdir}/tmpfiles.d
   	echo "d ${localstatedir}/log/samba 0755 root root -" \
               > ${D}${sysconfdir}/tmpfiles.d/99-${BPN}.conf
  -    elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
  +    elif ${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'true', 'false', d)}; then
   	install -d ${D}${sysconfdir}/init.d
   	install -m 0755 packaging/LSB/samba.sh ${D}${sysconfdir}/init.d
  +	update-rc.d -r ${D} samba.sh start 20 3 5 .
  +	update-rc.d -r ${D} samba.sh start 20 0 1 6 .
  +    elif ${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'true', 'false', d)}; then
  +	install -d ${D}${sysconfdir}/init.d
  +	install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba.sh
   	update-rc.d -r ${D} samba.sh start 20 3 5 .
   	update-rc.d -r ${D} samba.sh start 20 0 1 6 .
       fi
  
positive.code: SRC_URI[md5sum] = "232016d7581a1ba11e991ec2674553c4"
  SRC_URI[sha256sum] = "033604674936bf5c77d7df299b0626052b84a41505a6a6afe902f6274fc29898"
  
  inherit systemd waf-samba
  
  DEPENDS += "readline virtual/libiconv zlib popt talloc libtdb libtevent libldb krb5 ctdb cups"
  RDEPENDS_${PN} += "openldap"
  
  PACKAGECONFIG = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
  PACKAGECONFIG += "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
  
  PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
  PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
  PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
  
  SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
  SAMBA4_PDB_MODULES="pdb_tdbsam,pdb_ldap,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"
  
  PERL_VERNDORLIB="${datadir}/perl5/vendor_perl/"
  
  EXTRA_OECONF += "--enable-fhs \
                   --with-piddir=${localstatedir}/run \
  
negative.code: do_install_append() {
      rmdir --ignore-fail-on-non-empty "${D}/${localstatedir}/run"
  
      if ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'true', 'false', d)}; then
          install -d ${D}${systemd_unitdir}/system
          for i in nmb smb winbind; do
              install -m 0644 packaging/systemd/$i.service ${D}${systemd_unitdir}/system
  