# Description: Helper daemon to browse the network for remote CUPS queues and IPP network printers
# URL: https://github.com/OpenPrinting/cups-browsed
# Maintainer: Juergen Daubert, jue at crux dot nu
# Depends on: glib libcupsfilters libppd
# Optional: avahi

name=cups-browsed
version=2.0.0
release=1
source=(https://github.com/OpenPrinting/$name/releases/download/$version/$name-$version.tar.xz
	disabled_avahi.patch cups-browsed)

build() {
	cd $name-$version

	patch -p1 -i $SRC/disabled_avahi.patch

	prt-get isinst avahi || PKGMK_CUPSBROWSED+=' --disable-avahi'

	./configure $PKGMK_CUPSBROWSED \
		--prefix=/usr \
		--sysconfdir=/etc \
		--runstatedir=/run \
		--with-cups-rundir=/run/cups \
		--without-rcdir

	make
	make DESTDIR=$PKG install

	install -D -m 0755 $SRC/cups-browsed $PKG/etc/rc.d/cups-browsed

	rm -r $PKG/usr/share/doc
}
