I prepared a patchset which can reduce dependencies a bit by making it possible to disable (in my world disabled by default – so to enable) sambas »built-in« ActiveDirectory-DomainController (ADDC). It's a simple matter of the configure argument "--without-ad-dc". Now libsasl2, libgcrypt and libgnutls are no mandatory LIB_DEPENDS. I also made NSUPDATE really optional, not one-out-of-3-choice (OPTION_RADIO vs. OPTION_SINGLE). Additionally I changed OPTIONS_DEFAULT from ${OPTIONS_DEFINE} (all) to that I really used in the past 10 years of samba deployment. This is highly personal experience, but I'd like to see the ADDC option disabled by default – in many cases that prevents fellows from digging into samba41, but samba36 has some serious unfixed bugs, which prevent stable usage even for most basic/essential CIFS usage! (and I was told by a samba developer that only security fixes will make it into any samba36 update, not even most serious bugfixes, known and fixed in samba4[1] long ago and confirmed to be serious…) And last, I changed ADS_DESC to make clear, member support for ActiveDirectory is meant (not DomainController, which one can think since that's the main feature when talking about samba4[1]) Thanks, -Harry
Created attachment 144198 [details] net_samba41-add-ADDC-option.patch
Over to maintainer.
Created attachment 148256 [details] Updated net_samba41-add-ADDC-option.patch matching 4.1.11 Some minor option changes happened since my first patch, so here's a replacing patch, matching samba 4.1.11 as in current ports tree.
I understand your pain, but, unfortunately, if the libs do present in the system - they'll be linked with. So, to deal with that fact I had to put explicit dependencies. You are welcome to provide patch that fixes that in the samba code. Here are couple of examples: ./libgensec.so: libsamba-util.so.0 => not found (0) libcom_err-samba4.so.0 => not found (0) libsamba-modules.so => not found (0) libgssapi-samba4.so.2 => not found (0) libtevent-util.so.0 => not found (0) libsamba-credentials.so.0 => not found (0) libndr-samba.so => not found (0) libasn1util.so => not found (0) liberrors.so => not found (0) libsamdb.so.0 => not found (0) libsamba-hostconfig.so.0 => not found (0) libauthkrb5.so => not found (0) libsamba-sockets.so => not found (0) libndr.so.0 => not found (0) libcliauth.so => not found (0) libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x801622000) libmd.so.6 => /lib/libmd.so.6 (0x80182e000) --> libsasl2.so.3 => /usr/local/lib/libsasl2.so.3 (0x801a3e000) libthr.so.3 => /lib/libthr.so.3 (0x801c59000) libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x801e7e000) libc.so.7 => /lib/libc.so.7 (0x80081e000) ./libauthkrb5.so: liberrors.so => not found (0) libndr.so.0 => not found (0) libgssapi-samba4.so.2 => not found (0) libauth_sam_reply.so => not found (0) libtevent-util.so.0 => not found (0) libkrb5samba.so => not found (0) libndr-krb5pac.so.0 => not found (0) libsamba-hostconfig.so.0 => not found (0) libsamba-sockets.so => not found (0) libsamba-util.so.0 => not found (0) libkrb5-samba4.so.26 => not found (0) libcom_err-samba4.so.0 => not found (0) libthr.so.3 => /lib/libthr.so.3 (0x801616000) libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x80183b000) --> libgcrypt.so.20 => /usr/local/lib/libgcrypt.so.20 (0x801a47000) --> libgnutls.so.28 => /usr/local/lib/libgnutls.so.28 (0x801d1e000) libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x802029000) libc.so.7 => /lib/libc.so.7 (0x80081e000) ./vfs/zfsacl.so: libsamba-util.so.0 => not found (0) libsmbd_base.so => not found (0) liberrors.so => not found (0) libsmbregistry.so => not found (0) libsamba-security.so => not found (0) libsmbconf.so.0 => not found (0) libpdb.so.0 => not found (0) libsmbd_shim.so => not found (0) libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x801607000) libthr.so.3 => /lib/libthr.so.3 (0x801813000) libsunacl.so.1 => /usr/local/lib/libsunacl.so.1 (0x801a38000) libc.so.7 => /lib/libc.so.7 (0x80081e000) Those are the libs that were build with --without-ad-dc flag. While current ports infrastructure doesn't guaranty isolation of the build environment we have to use broadest dependencies.
To be clear, I'll apply certain parts of your patch, so you'll be able to compile samba without ADDC, but don't expect that extra dependencies will be dropped.
A commit references this bug: Author: timur Date: Mon Oct 20 13:13:10 UTC 2014 New revision: 371268 URL: https://svnweb.freebsd.org/changeset/ports/371268 Log: Upgrade net/samba41 to 4.1.13 version PR: 191439 193416 193734 194046 Changes: head/net/samba41/Makefile head/net/samba41/distinfo head/net/samba41/pkg-plist
Thanks you for incorporating the applicable suggestions! As soon as I'll have to deal with samba again, I'll check if the dependency pitfall (linking if found inside samba build infrastructure) can be addressed. Most important, your recent commit seems to also address https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193734. Can you please change the state of the bug report? Thanks a lot, -Harry
Committed, thanks!