# 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 libppd
# Optional: avahi

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

build() {
    cd $name-$version

    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
}
