app=avahi
version=0.8
build=1sml
homepage="https://www.avahi.org/"
download="http://avahi.org/download/avahi-0.8.tar.gz"
desc="Implementation of service discovery aka zeroconf"
requires="glib dbus expat gdbm libcap libdaemon libevent"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  ./configure \
    --prefix="" \
    --sbindir=/bin \
    --sysconfdir=/etc \
    --with-distro=slackware \
    --disable-static \
    --enable-glib \
    --enable-gtk3 \
    --disable-gobject \
    --disable-qt5 \
    --disable-python \
    --disable-pygobject \
    --disable-python-dbus \
    --disable-mono \
    --disable-monodoc \
    --disable-manpages \
    --disable-xmltoman \
    --disable-tests \
    --disable-doxygen-doc \
    --disable-nls \
    --with-autoipd-user=avahi \
    --with-autoipd-group=avahi \
    --enable-compat-libdns_sd

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make || true
  cd avahi-ui && make LDFLAGS="-L../avahi-glib" LIBS="-lavahi-glib" && cd ..
  make install DESTDIR=$pkg 

  cp LICENSE $pkgdocs/

  mkfinalpkg
}

sha512sums="
c6ba76feb6e92f70289f94b3bf12e5f5c66c11628ce0aeb3cadfb72c13a5d1a9bd56d71bdf3072627a76cd103b9b056d9131aa49ffe11fa334c24ab3b596c7de  avahi-0.8.tar.gz
"
