#!/bin/bash
#
# Copyright 2005 Paul Blazejowski <paulb@blazebox.homeip.net>
# Available under the terms of the GNU GPL.
#

NAME="avahi"
VERSION="0.6.31"
REVISION="1"

PKG_SOURCEURL='http://www.avahi.org/download/$NAME-$VERSION.tar.gz'

PKG_PATCH[0]='avahi-0.6.17-nonetdevneeded.diff'


. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

PKG_LOCALSTATEDIR=/var

cflags
cxxflags
prepare
applypatch 0 1
analyzesource
configure --disable-qt3 \
          --disable-qt4 \
		  --disable-gtk \
		  --enable-gtk3 \
          --disable-xmltoman \
          --enable-compat-howl \
          --disable-doxygen-doc \
          --with-distro=slackware \
          --enable-compat-libdns_sd \
          --disable-autoipd
make
makecheck
makeinstall install-strip

# We insert the symlinks for the rc.avahidaemon script 
sysvinitsetup $PKG_STAGEROOT$PKG_SYSCONFDIR/rc.d/rc.avahidaemon 345 95

# We insert the symlinks for the rc.avahidnsconfd script
sysvinitsetup $PKG_STAGEROOT$PKG_SYSCONFDIR/rc.d/rc.avahidnsconfd 345 96

tidydocumentation

# Copy avahi documentation files from docs into proper places
spewdo "cp -adR $PKG_SRCROOT/docs/* $PKG_STAGEROOT$PKG_DOCDIR/"

analyzebinaries

createroleaccount avahi 85 85

finalizepackage
packagize
cleanup
