#Packager: Raphael Groner <raphgro(at)web.de>

## Port of original SlackBuild from slackbuilds.org
## Patched to accomplish Salix' packaging rules
## Changelog:
## 0.1         Adopted from slackbuilds.org
## 0.2         --enable-qt4
## 2010-01-04  Only avahidaemon.conf considered by dotnew
## 2010-01-19  make -j4
## 2010-01-22  Switch to SLKBUILD, minor changes
##             Browsing of wide area disabled by default
##             Avoid problems with symlinks in usr/src

pkgname=avahi
pkgver=0.6.25
pkgrel=4rg
arch=i486
source=(\
	http://avahi.org/download/$pkgname-$pkgver.tar.gz
	README.SBo
	create-usergroup.sh
)
sourcetemplate=http://people.salixos.org/damnagehack/$pkgname/i486
url=http://avahi.org/
dotnew=(etc/avahi/avahi-daemon.conf)

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"avahi (DNS Service Discovery and Multicast DNS for Zeroconf Computing)"
"Avahi uses D-BUS for communication between user applications and a "
"system daemon to coordinate application efforts in caching replies, "
"necessary to minimize the traffic imposed on networks. "
"This technology is very convenient, known as Bonjour in Mac OS X."
"Mono support is NOT part of this package."
"An ""avahi"" user and group is required, for details see README.SBo. "
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure \
	  --prefix=/usr \
	  --libdir=/usr/lib${LIBDIRSUFFIX} \
	  --sysconfdir=/etc \
	  --localstatedir=/var \
	  --mandir=/usr/man \
	  --docdir=/usr/doc/$pkgname-$pkgver \
	  --disable-static \
	  --disable-monodoc \
	  --disable-autoipd \
	  --enable-python-dbus \
	  --enable-pygtk\
	  --enable-glib \
	  --enable-dbus \
	  --enable-python \
	  --enable-gtk \
	  --enable-qt4 \
	  --disable-qt3 \
	  --enable-core-docs \
	  --enable-compat-howl \
	  --enable-compat-libdns_sd \
	  --with-dbus-sys=/etc/dbus-1/system.d \
	  --with-avahi-user=avahi \
	  --with-avahi-group=avahi \
	  --with-avahi-priv-access-group=root \
	  --with-distro=slackware \
	  --program-prefix= \
	  --program-suffix= \
	  --build=$ARCH-slackware-linux \
	  --disable-mono

	make -j || return 1
	make install DESTDIR=$startdir/pkg
	
	## additional documentation
	mkdir -p $startdir/pkg/usr/doc/$pkgname-$pkgver
	cp ../README.SBo LICENSE ChangeLog docs/* \
		$PKG/usr/doc/$pkgname-$pkgver
	install -m644 ../create-usergroup.sh \
		$PKG/usr/doc/$pkgname-$pkgver	

	## disable browsing of wide area
	sed "s/browse-domains=/\#&/" \
		-i $startdir/pkg/etc/avahi/avahi-daemon.conf 
}