post_install() {
  getent group avahi &>/dev/null || groupadd -r -g 84 avahi >/dev/null
  getent passwd avahi &>/dev/null || useradd -r -u 84 -g avahi -d / -s /bin/false -c avahi avahi >/dev/null

  cat <<EOF
==> The following daemons may be added to DAEMONS in /etc/rc.conf:
==> avahi-daemon: the mdns responder, you probably want this.
==>               dbus needs to be running when you start it.
==> avahi-dnsconfd: daemon used for peer-to-peer automatic dns
==>                 configuration on dhcp-less networks.

==> To use some of the client applications you will have to install python.
==> In addition, pygtk is required for the graphical ones and
==> twisted for avahi-bookmarks.
EOF
}

post_remove() {
  getent passwd avahi &>/dev/null && userdel avahi >/dev/null
  getent group avahi &>/dev/null && groupdel avahi >/dev/null
}

( cd usr/include ; rm -rf howl )
( cd usr/include ; ln -sf avahi-compat-howl howl )
( cd usr/include ; rm -rf dns_sd.h )
( cd usr/include ; ln -sf avahi-compat-libdns_sd/dns_sd.h dns_sd.h )
( cd usr/share/man/man1 ; rm -rf avahi-publish-address.1.gz )
( cd usr/share/man/man1 ; ln -sf avahi-publish.1.gz avahi-publish-address.1.gz )
( cd usr/share/man/man1 ; rm -rf avahi-resolve-address.1.gz )
( cd usr/share/man/man1 ; ln -sf avahi-resolve.1.gz avahi-resolve-address.1.gz )
( cd usr/share/man/man1 ; rm -rf avahi-resolve-host-name.1.gz )
( cd usr/share/man/man1 ; ln -sf avahi-resolve.1.gz avahi-resolve-host-name.1.gz )
( cd usr/share/man/man1 ; rm -rf bvnc.1.gz )
( cd usr/share/man/man1 ; ln -sf bssh.1.gz bvnc.1.gz )
( cd usr/share/man/man1 ; rm -rf avahi-publish-service.1.gz )
( cd usr/share/man/man1 ; ln -sf avahi-publish.1.gz avahi-publish-service.1.gz )
( cd usr/share/man/man1 ; rm -rf avahi-browse-domains.1.gz )
( cd usr/share/man/man1 ; ln -sf avahi-browse.1.gz avahi-browse-domains.1.gz )
( cd usr/bin ; rm -rf avahi-resolve-address )
( cd usr/bin ; ln -sf avahi-resolve avahi-resolve-address )
( cd usr/bin ; rm -rf bvnc )
( cd usr/bin ; ln -sf bssh bvnc )
( cd usr/bin ; rm -rf avahi-publish-service )
( cd usr/bin ; ln -sf avahi-publish avahi-publish-service )
( cd usr/bin ; rm -rf bshell )
( cd usr/bin ; ln -sf bssh bshell )
( cd usr/bin ; rm -rf avahi-browse-domains )
( cd usr/bin ; ln -sf avahi-browse avahi-browse-domains )
( cd usr/bin ; rm -rf avahi-publish-address )
( cd usr/bin ; ln -sf avahi-publish avahi-publish-address )
( cd usr/bin ; rm -rf avahi-resolve-host-name )
( cd usr/bin ; ln -sf avahi-resolve avahi-resolve-host-name )
( cd usr/lib ; rm -rf libavahi-common.so )
( cd usr/lib ; ln -sf libavahi-common.so.3.5.3 libavahi-common.so )
( cd usr/lib ; rm -rf libavahi-ui.so )
( cd usr/lib ; ln -sf libavahi-ui.so.0.1.4 libavahi-ui.so )
( cd usr/lib ; rm -rf libhowl.so )
( cd usr/lib ; ln -sf libhowl.so.0.0.0 libhowl.so )
( cd usr/lib ; rm -rf libavahi-qt4.so )
( cd usr/lib ; ln -sf libavahi-qt4.so.1.0.2 libavahi-qt4.so )
( cd usr/lib ; rm -rf libavahi-core.so.7 )
( cd usr/lib ; ln -sf libavahi-core.so.7.0.2 libavahi-core.so.7 )
( cd usr/lib ; rm -rf libhowl.so.0 )
( cd usr/lib ; ln -sf libhowl.so.0.0.0 libhowl.so.0 )
( cd usr/lib ; rm -rf libavahi-common.so.3 )
( cd usr/lib ; ln -sf libavahi-common.so.3.5.3 libavahi-common.so.3 )
( cd usr/lib ; rm -rf libdns_sd.so.1 )
( cd usr/lib ; ln -sf libdns_sd.so.1.0.0 libdns_sd.so.1 )
( cd usr/lib ; rm -rf libavahi-ui.so.0 )
( cd usr/lib ; ln -sf libavahi-ui.so.0.1.4 libavahi-ui.so.0 )
( cd usr/lib ; rm -rf libavahi-client.so.3 )
( cd usr/lib ; ln -sf libavahi-client.so.3.2.9 libavahi-client.so.3 )
( cd usr/lib ; rm -rf libavahi-client.so )
( cd usr/lib ; ln -sf libavahi-client.so.3.2.9 libavahi-client.so )
( cd usr/lib/pkgconfig ; rm -rf howl.pc )
( cd usr/lib/pkgconfig ; ln -sf avahi-compat-howl.pc howl.pc )
( cd usr/lib ; rm -rf libavahi-qt3.so )
( cd usr/lib ; ln -sf libavahi-qt3.so.1.0.2 libavahi-qt3.so )
( cd usr/lib ; rm -rf libavahi-gobject.so )
( cd usr/lib ; ln -sf libavahi-gobject.so.0.0.4 libavahi-gobject.so )
( cd usr/lib ; rm -rf libavahi-core.so )
( cd usr/lib ; ln -sf libavahi-core.so.7.0.2 libavahi-core.so )
( cd usr/lib ; rm -rf libavahi-glib.so.1 )
( cd usr/lib ; ln -sf libavahi-glib.so.1.0.2 libavahi-glib.so.1 )
( cd usr/lib ; rm -rf libavahi-qt4.so.1 )
( cd usr/lib ; ln -sf libavahi-qt4.so.1.0.2 libavahi-qt4.so.1 )
( cd usr/lib ; rm -rf libavahi-glib.so )
( cd usr/lib ; ln -sf libavahi-glib.so.1.0.2 libavahi-glib.so )
( cd usr/lib ; rm -rf libavahi-gobject.so.0 )
( cd usr/lib ; ln -sf libavahi-gobject.so.0.0.4 libavahi-gobject.so.0 )
( cd usr/lib ; rm -rf libdns_sd.so )
( cd usr/lib ; ln -sf libdns_sd.so.1.0.0 libdns_sd.so )
( cd usr/lib ; rm -rf libavahi-qt3.so.1 )
( cd usr/lib ; ln -sf libavahi-qt3.so.1.0.2 libavahi-qt3.so.1 )
