From 38949606488d00a74e7615ed995f24c9ad12e0ca Mon Sep 17 00:00:00 2001 From: marcus Date: Sat, 19 Nov 2005 04:34:52 +0000 Subject: Add avahi, another mDNS, Zeroconf, Bonjour, Redezvous, etc. implementation ...but with a twist. Avahi is a D-BUS based mDNS solution from Freedesktop.org. Avahi provides Service discovery on a local network -- this means that you can plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to or find files being shared. This kind of technology is already found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') and is very convenient. WWW: http://www.freedesktop.org/Software/Avahi A lot of the ground work for this port was provided by ahze. --- net/Makefile | 1 + net/avahi/Makefile | 59 ++++++++++++++++++++++++++++++ net/avahi/distinfo | 3 ++ net/avahi/files/avahi-daemon.sh | 36 +++++++++++++++++++ net/avahi/files/avahi-dnsconfd.sh | 39 ++++++++++++++++++++ net/avahi/pkg-descr | 7 ++++ net/avahi/pkg-install | 36 +++++++++++++++++++ net/avahi/pkg-plist | 76 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 257 insertions(+) create mode 100644 net/avahi/Makefile create mode 100644 net/avahi/distinfo create mode 100644 net/avahi/files/avahi-daemon.sh create mode 100644 net/avahi/files/avahi-dnsconfd.sh create mode 100644 net/avahi/pkg-descr create mode 100644 net/avahi/pkg-install create mode 100644 net/avahi/pkg-plist (limited to 'net') diff --git a/net/Makefile b/net/Makefile index 8ee2fe0..43876f5 100644 --- a/net/Makefile +++ b/net/Makefile @@ -33,6 +33,7 @@ SUBDIR += asterisk SUBDIR += asterisk-oh323 SUBDIR += atmsupport + SUBDIR += avahi SUBDIR += azureus SUBDIR += b2bua SUBDIR += balance diff --git a/net/avahi/Makefile b/net/avahi/Makefile new file mode 100644 index 0000000..04b9928 --- /dev/null +++ b/net/avahi/Makefile @@ -0,0 +1,59 @@ +# New ports collection makefile for: avahi +# Date created: 18 November 2005 +# Whom: Joe Marcus Clarke +# +# $FreeBSD$ +# + +PORTNAME= avahi +PORTVERSION= 0.6 +CATEGORIES= net dns +MASTER_SITES= http://www.freedesktop.org/~lennart/ + +MAINTAINER= gnome@FreeBSD.org +COMMENT= Service discovery on a local network + +LIB_DEPENDS= expat.5:${PORTSDIR}/textproc/expat2 \ + daemon.2:${PORTSDIR}/devel/libdaemon \ + dbus-1.1:${PORTSDIR}/devel/dbus \ + gdbm.3:${PORTSDIR}/databases/gdbm + +USE_GNOME= gnomehack ltverhack glib20 +USE_GMAKE= yes +USE_AUTOTOOLS= libtool:15 +INSTALLS_SHLIB= yes +CONFIGURE_ARGS= --with-distro=freebsd \ + --disable-gtk \ + --disable-qt3 \ + --disable-qt4 \ + --disable-python \ + --disable-mono \ + --disable-monodoc \ + --disable-doxygen-doc \ + --disable-doxygen-dot +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib" + +USE_RC_SUBR= yes +FILES_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} + +MAN1= avahi-browse-domains.1 avahi-browse.1 avahi-publish-address.1 \ + avahi-publish-service.1 avahi-publish.1 avahi-resolve-address.1 \ + avahi-resolve-host-name.1 avahi-resolve.1 +MAN5= avahi-daemon.conf.5 avahi.service.5 +MAN8= avahi-daemon.8 avahi-dnsconfd.8 avahi-dnsconfd.action.8 + +post-configure: + @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/avahi-daemon.sh > ${WRKDIR}/avahi-daemon.sh + @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/avahi-dnsconfd.sh > ${WRKDIR}/avahi-dnsconfd.sh + +post-install: +.if !defined(PACKAGE_BUILDING) + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif + ${INSTALL_SCRIPT} ${WRKDIR}/avahi-daemon.sh ${PREFIX}/etc/rc.d + ${INSTALL_SCRIPT} ${WRKDIR}/avahi-dnsconfd.sh ${PREFIX}/etc/rc.d + +.include diff --git a/net/avahi/distinfo b/net/avahi/distinfo new file mode 100644 index 0000000..350b0e9 --- /dev/null +++ b/net/avahi/distinfo @@ -0,0 +1,3 @@ +MD5 (avahi-0.6.tar.gz) = 297c87077f5a0462f5cdb656351702e8 +SHA256 (avahi-0.6.tar.gz) = 455807d3f574d9d81f0d78c97a4102c827b69359767aae9da96e2aa1a67b4357 +SIZE (avahi-0.6.tar.gz) = 844657 diff --git a/net/avahi/files/avahi-daemon.sh b/net/avahi/files/avahi-daemon.sh new file mode 100644 index 0000000..1d1f9b9 --- /dev/null +++ b/net/avahi/files/avahi-daemon.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: avahi_daemon +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Avahi's mDNSResponder, a Zeroconf (Bonjour) service advertisement daemon. +# + +avahi_daemon_enable=${avahi_daemon_enable-"NO"} +avahi_daemon_flags=${avahi_daemon_flags-"-D"} + +. %%RC_SUBR%% + +name=avahi_daemon +rcvar=`set_rcvar` + +start_cmd=avahi_daemon_start +stop_cmd=avahi_daemon_stop + +avahi_daemon_bin=%%PREFIX%%/sbin/avahi-daemon + +avahi_daemon_start() { + checkyesno avahi_daemon_enable && echo "Starting avahi-daemon." && \ + ${avahi_daemon_bin} ${avahi_daemon_flags} +} + +avahi_daemon_stop() { + checkyesno avahi_daemon_enable && echo "Stopping avahi-daemon." && \ + ${avahi_daemon_bin} -k +} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/net/avahi/files/avahi-dnsconfd.sh b/net/avahi/files/avahi-dnsconfd.sh new file mode 100644 index 0000000..d194235 --- /dev/null +++ b/net/avahi/files/avahi-dnsconfd.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: avahi_dnsconfd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# avahi-dnsconfd connects to a running avahi-daemon and runs the script +# %%PREFIX%%/etc/avahi/dnsconf.action for each unicast DNS server that +# is announced on the local LAN. This is useful for configuring unicast +# DNS servers in a DHCP-like fashion with mDNS. +# + +avahi_dnsconfd_enable=${avahi_dnsconfd_enable-"NO"} +avahi_dnsconfd_flags=${avahi_dnsconfd_flags-"-D"} + +. %%RC_SUBR%% + +name=avahi_dnsconfd +rcvar=`set_rcvar` + +start_cmd=avahi_dnsconfd_start +stop_cmd=avahi_dnsconfd_stop + +avahi_dnsconfd_bin=%%PREFIX%%/sbin/avahi-daemon + +avahi_dnsconfd_start() { + checkyesno avahi_dnsconfd_enable && echo "Starting avahi-dnsconfd." && \ + ${avahi_dnsconfd_bin} ${avahi_dnsconfd_flags} +} + +avahi_dnsconfd_stop() { + checkyesno avahi_dnsconfd_enable && echo "Stopping avahi-dnsconfd." && \ + ${avahi_dnsconfd_bin} -k +} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/net/avahi/pkg-descr b/net/avahi/pkg-descr new file mode 100644 index 0000000..c2797d6 --- /dev/null +++ b/net/avahi/pkg-descr @@ -0,0 +1,7 @@ +Service discovery on a local network -- this means that you can plug your +laptop or computer into a network and instantly be able to view other people +who you can chat with, find printers to print to or find files being shared. +This kind of technology is already found in MacOS X (branded 'Rendezvous', +'Bonjour' and sometimes 'ZeroConf') and is very convenient. + +WWW: http://www.freedesktop.org/Software/Avahi diff --git a/net/avahi/pkg-install b/net/avahi/pkg-install new file mode 100644 index 0000000..9bbd14b --- /dev/null +++ b/net/avahi/pkg-install @@ -0,0 +1,36 @@ +#!/bin/sh + +case $2 in +POST-INSTALL) + USER=avahi + GROUP=${USER} + UID=558 + GID=${UID} + PW=/usr/sbin/pw + + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/nonexistent" -s /sbin/nologin -c "Avahi Daemon User" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + exit 0 + ;; +esac diff --git a/net/avahi/pkg-plist b/net/avahi/pkg-plist new file mode 100644 index 0000000..ffe46d1 --- /dev/null +++ b/net/avahi/pkg-plist @@ -0,0 +1,76 @@ +bin/avahi-browse +bin/avahi-browse-domains +bin/avahi-publish +bin/avahi-publish-address +bin/avahi-publish-service +bin/avahi-resolve +bin/avahi-resolve-address +bin/avahi-resolve-host-name +etc/avahi/avahi-daemon.conf +etc/avahi/avahi-dnsconfd.action +etc/avahi/services/ssh.service +etc/dbus-1/system.d/avahi-dbus.conf +etc/rc.d/avahi-daemon.sh +etc/rc.d/avahi-dnsconfd.sh +include/avahi-client/client.h +include/avahi-client/lookup.h +include/avahi-client/publish.h +include/avahi-common/address.h +include/avahi-common/alternative.h +include/avahi-common/cdecl.h +include/avahi-common/defs.h +include/avahi-common/domain.h +include/avahi-common/error.h +include/avahi-common/gccmacro.h +include/avahi-common/llist.h +include/avahi-common/malloc.h +include/avahi-common/rlist.h +include/avahi-common/simple-watch.h +include/avahi-common/strlst.h +include/avahi-common/timeval.h +include/avahi-common/watch.h +include/avahi-core/core.h +include/avahi-core/log.h +include/avahi-core/lookup.h +include/avahi-core/publish.h +include/avahi-core/rr.h +include/avahi-glib/glib-malloc.h +include/avahi-glib/glib-watch.h +lib/libavahi-client.a +lib/libavahi-client.so +lib/libavahi-client.so.3 +lib/libavahi-common.a +lib/libavahi-common.so +lib/libavahi-common.so.3 +lib/libavahi-core.a +lib/libavahi-core.so +lib/libavahi-core.so.3 +lib/libavahi-glib.a +lib/libavahi-glib.so +lib/libavahi-glib.so.1 +libdata/pkgconfig/avahi-client.pc +libdata/pkgconfig/avahi-compat-howl.pc +libdata/pkgconfig/avahi-compat-libdns_sd.pc +libdata/pkgconfig/avahi-core.pc +libdata/pkgconfig/avahi-glib.pc +sbin/avahi-daemon +sbin/avahi-dnsconfd +%%DATADIR%%/avahi-service.dtd +%%DATADIR%%/introspection/AddressResolver.introspect +%%DATADIR%%/introspection/DomainBrowser.introspect +%%DATADIR%%/introspection/EntryGroup.introspect +%%DATADIR%%/introspection/HostNameResolver.introspect +%%DATADIR%%/introspection/RecordBrowser.introspect +%%DATADIR%%/introspection/Server.introspect +%%DATADIR%%/introspection/ServiceBrowser.introspect +%%DATADIR%%/introspection/ServiceResolver.introspect +%%DATADIR%%/introspection/ServiceTypeBrowser.introspect +%%DATADIR%%/service-types +@dirrm %%DATADIR%%/introspection +@dirrm %%DATADIR%% +@dirrm include/avahi-glib +@dirrm include/avahi-core +@dirrm include/avahi-common +@dirrm include/avahi-client +@dirrm etc/avahi/services +@dirrm etc/avahi -- cgit v1.1