# $Id$ PNAME="avahi" PVER="0.6.25" PBUILD="r2" PCATEGORIE="net-dns" STATE="unstable" DESCRIPTION="Avahi is a system which facilitates service discovery on a local network." HOMEPAGE="http://avahi.org/" DEPEND=">= dev-libs/libdaemon-0.14 >= dev-libs/expat-2 >= dev-libs/glib2-2.22 >= sys-apps/dbus-1.3 >= sys-libs/libcap-2.17" #>= x11-libs/qt #>= x11-libs/qt4 #>= x11-libs/gtk+-2.4.0 #>= gnome-base/libglade-2.4.0 SDEPEND=">= dev-util/intltool-0.40 >= dev-util/pkgconfig-0.23" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools mbuild SRC_URI=( http://avahi.org/download/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/avahi-daemon.rc mirror://${PNAME}/avahi-dnsconfd.rc mirror://${PNAME}/autoipd.sh mirror://${PNAME}/autoipd-openrc.sh ) UP2DATE="updatecmd ${HOMEPAGE}/download | grep ${PNAME}- | lasttarball gz" src_compile() { cd ${SRCDIR} mconfigure \ --localstatedir=/var \ --with-distro=none \ --enable-compat-libdns_sd \ --enable-compat-howl \ --enable-autoipd \ --with-autoipd-user=avahi \ --with-autoipd-group=avahi \ --disable-python-dbus \ --disable-pygtk \ --disable-monodoc \ --disable-doxygen-doc \ --disable-xmltoman \ --disable-gdbm \ --disable-mono \ --disable-python \ --enable-dbus \ --enable-glib \ --disable-gtk \ --disable-qt3 \ --disable-qt4 \ || die mmake || die } src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # for howl and mdnsresponder compat mlink avahi-compat-howl.pc /usr/$(mlibdir)/pkgconfig/howl.pc || die mlink avahi-compat-libdns_sd.pc /usr/$(mlibdir)/pkgconfig/libdns_sd.pc || die mlink avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h || die # autoipd scripts minstalldir /$(mlibdir)/rcscripts/net || die minstalldir /$(mlibdir)/rc/net || die minstallfile -s autoipd.sh /$(mlibdir)/rcscripts/net || die minstallfile -s autoipd-openrc.sh /$(mlibdir)/rc/net/autoipd.sh || die # init scripts minstallrc avahi-daemon.rc avahi-daemon || die minstallrc avahi-dnsconfd.rc avahi-dnsconfd || die minstalldocs ChangeLog LICENSE README } preinstall() { if [[ ! -z $(magequery -n mdnsresponder) ]] then echo -e ${COLRED} echo -e "Error: net-misc/mdnsresponder is installed!!" echo -e "mdnsresponder is now superseeded by avahi and deprecated in this distribution." echo -e "Please uninstall net-misc/mdnsresponder first!" echo -e ${COLDEFAULT} die "net-misc/mdnsresponder found!" fi # adding avahi user ${MLIBDIR}/mgroupadd -o "-g 303" netdev ${MLIBDIR}/mgroupadd -o "-g 304" avahi ${MLIBDIR}/museradd -o "-u 304 -g avahi -d /dev/null -s /bin/false" avahi } postinstall() { # reload dbus config here [[ -n $(pidof dbus-daemon) ]] && /etc/init.d/dbus reload mstartservice avahi-daemon mstartservice avahi-dnsconfd } postremove() { mstopservice avahi-daemon mstopservice avahi-dnsconfd }