# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortGroup active_variants 1.1
PortGroup gobject_introspection 1.0
github.setup lathiat avahi 0.7 v
description Avahi is an Implementation of the DNS Service Discovery and Multicast DNS \
specifications for Zeroconf Networking.
long_description ${description} It uses D-Bus for communication between user applications and a \
system daemon. The daemon is used to coordinate application efforts in caching \
replies, necessary to minimize the traffic imposed on networks.
homepage http://avahi.org/
github.tarball_from releases
checksums rmd160 40a58c780a01ae03a234cd52735ba8d63c93b867 \
sha256 57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804
patchfiles patch-avahi-daemon-Makefile.in.diff \
patch-avahi-dnsconfd-Makefile.in.diff \
patch-avahi-utils-Makefile.in.diff \
patch-initscript-darwin-org.freedesktop.avahi-daemon.plist.in.diff \
patch-initscript-darwin-org.freedesktop.avahi-dnsconfd.plist.in.diff
# ensure MacPorts machine-id from dbus is found
# see https://trac.macports.org/ticket/53894 for O_CLOEXEC
patchfiles-append patch-avahi_daemon.diff
# this preprocessor macro causes a lot of things to be undefined inside netinet/in.h system header.
reinplace "s/-D_XOPEN_SOURCE=500//" ${worksrcpath}/configure
# use correct location of dbus from patch-avahi_daemon.diff
reinplace "s|__MACPORTS_PREFIX__|${prefix}|g" ${worksrcpath}/avahi-daemon/main.c
depends_build port:pkgconfig \
gobject_introspection yes
if {![variant_isset underscore]} {
add_users ${avahi_user} group=${avahi_group} realname=Avahi\ Service
# "Priviliged [sic] access group for Avahi clients"
# macOS has no equivalent group
# see https://wiki.ubuntu.com/Security/Privileges#Connect_to_wireless_and_ethernet_networks
# see https://wiki.debian.org/SystemGroups
set avahi_priv_group admin
configure.args --disable-autoipd \
--enable-compat-libdns_sd \
--with-avahi-priv-access-group=${avahi_priv_group} \
--with-avahi-user=${avahi_user} \
--with-avahi-group=${avahi_group}
# __APPLE_USE_RFC_2292 should be removed once avhi is updated to support RFC 3542
configure.cppflags-append -L${prefix}/lib -D__APPLE_USE_RFC_2292