Skip to content

samba4: add default dnssd variant #28345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions net/samba4/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name samba4
# With sbsat due to /opt/local/bin/gentest
conflicts samba3 sbsat
version 4.22.1
revision 2
revision 3
checksums rmd160 3bcb48341983d2a7bf1ee6848697970b142d701a \
sha256 6a1f89f1ab25916e255f1c2c3a4a88235a854af2eca40bb9d9bba7545b684a0a \
size 42866082
Expand Down Expand Up @@ -77,22 +77,31 @@ patchfiles-append patch-ldb-test.diff
# https://bugzilla.samba.org/show_bug.cgi?id=15850
patchfiles-append patch-util-crypt.diff

# https://cgit.freebsd.org/ports/commit/?id=2daf87ac19838c9a36f56fb51b0678d193921771
patchfiles-append patch-add-configure-option-dnssd.diff \
patch-fix-dnsbrowse.c-dnsregister.c.diff

configure.perl ${perl5.bin}
configure.python ${prefix}/bin/python${py_ver}
configure.env-append YAPP=${prefix}/bin/yapp-${perl5.major}
configure.args-append --enable-fhs \
--disable-avahi

variant avahi description {Use avahi} {
depends_lib-append \
port:avahi
configure.args-delete \
--disable-avahi
variant dnssd conflicts avahi description {Use DNS-SD for Bonjour/mDNS service registration} {
platform freebsd {
depends_lib-append lib:libdns_sd:mdnsresponder
}
configure.args-append --enable-dnssd
}

variant avahi conflicts dnssd description {Use Avahi for Bonjour/mDNS service registration} {
depends_lib-append port:avahi
configure.args-delete --disable-avahi
}

platform darwin {
configure.args-append \
--without-acl-support
default_variants-append +dnssd
configure.args-append --without-acl-support
}

platform freebsd {
Expand Down
65 changes: 65 additions & 0 deletions net/samba4/files/patch-add-configure-option-dnssd.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From b81d399aa6d9e2bdbb9db0efa8109c41aad4d025 Mon Sep 17 00:00:00 2001
From: "Timur I. Bakeyev" <timur@FreeBSD.org>
Date: Mon, 31 May 2021 02:49:20 +0200
Subject: [PATCH 18/28] Add configuration option that allows to choose
alternative mDNS implementation dns_sd library.

Signed-off-by: Timur I. Bakeyev <timur@FreeBSD.org>
---
source3/wscript | 12 ++++++++++++
source3/wscript_build | 2 ++
2 files changed, 14 insertions(+)

diff --git a/source3/wscript b/source3/wscript
index 2121b8b6510..6209472c6c8 100644
--- source3/wscript
+++ source3/wscript
@@ -70,6 +70,7 @@ def options(opt):
opt.samba_add_onoff_option('sendfile-support', default=None)
opt.samba_add_onoff_option('utmp')
opt.samba_add_onoff_option('avahi', with_name="enable", without_name="disable")
+ opt.samba_add_onoff_option('dnssd', with_name="enable", without_name="disable")
opt.samba_add_onoff_option('iconv')
opt.samba_add_onoff_option('acl-support')
opt.samba_add_onoff_option('syslog')
@@ -855,6 +856,17 @@ msg.msg_accrightslen = sizeof(fd);
conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')

+ if Options.options.with_dnssd:
+ conf.env.with_dnssd = True
+ if not conf.CHECK_HEADERS('dns_sd.h'):
+ conf.env.with_dnssd = False
+ if not conf.CHECK_FUNCS_IN('DNSServiceRegister', 'dns_sd'):
+ conf.env.with_dnssd = False
+ if conf.env.with_dnssd:
+ conf.DEFINE('WITH_DNSSD_SUPPORT', 1)
+ else:
+ conf.SET_TARGET_TYPE('dns_sd', 'EMPTY')
+
if Options.options.with_iconv:
conf.env.with_iconv = True
if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
diff --git a/source3/wscript_build b/source3/wscript_build
index 5cf965dc45d..edd7985e648 100644
--- source3/wscript_build
+++ source3/wscript_build
@@ -709,6 +709,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
samba3core
param_service
AVAHI
+ dns_sd
PROFILE
LOCKING
LIBADS_SERVER
@@ -1128,6 +1129,7 @@ bld.SAMBA3_BINARY('client/smbclient',
msrpc3
RPC_NDR_SRVSVC
cli_smb_common
+ dns_sd
archive
''')

--
2.37.1

Loading