diff dns/avahi/avahi.sh @ 931:20743b1b6f74

dns/avahi: initial import, closes #1211
author David Demelier <markand@malikania.fr>
date Thu, 29 Aug 2019 21:30:00 +0200
parents
children ddab65a5b3f5
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dns/avahi/avahi.sh	Thu Aug 29 21:30:00 2019 +0200
@@ -0,0 +1,133 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+# TODO: add MONO option.
+
+PKGNAME=avahi
+PKGVERSION=0.7
+PKGREVISION=1
+PKGLICENSE="LGPLv21"
+PKGSUMMARY="DNS-SD over mDNS implementation"
+PKGDOWNLOAD="http://avahi.org/download/$PKGNAME-$PKGVERSION.tar.gz"
+PKGUIDS="avahi:107 avahi-autoipd:108"
+PKGGIDS="avahi:107 avahi-autoipd:108"
+PKGDEPENDS="expat libdaemon"
+PKGOPTIONS="DBUS GLIB GOBJECT GTK INTROSPECTION NLS"
+PKGPROTECT="etc/avahi/avahi-autoipd.action
+            etc/avahi/avahi-daemon.conf
+            etc/avahi/avahi-dnfconfd.action
+            etc/avahi/hosts
+            etc/rc.d/avahi"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=clang}
+: ${CFLAGS:=-O2}
+: ${CXX:=clang++}
+: ${CXXFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${LIBS:=}
+: ${DBUS:=yes}
+: ${GLIB:=yes}
+: ${GOBJECT:=yes}       # Note: requires GLIB.
+: ${GTK:=yes}
+: ${INTROSPECTION:=yes}
+: ${NLS:=yes}
+
+if [ "$DBUS" = "yes" ]; then
+	PKGDEPENDS="dbus $PKGDEPENDS"
+	with_dbus="--enable-dbus"
+else
+	with_dbus="--disable-dbus"
+fi
+
+if [ "$GLIB" = "yes" ]; then
+	PKGDEPENDS="glib $PKGDEPENDS"
+	with_glib="--enable-glib"
+else
+	with_glib="--disable-glib"
+fi
+
+if [ "$GOBJECT" = "yes" ]; then
+	with_gobject="--enable-gobject"
+else
+	with_gobject="--disable-gobject"
+fi
+
+if [ "$GTK" = "yes" ]; then
+	PKGDEPENDS="gtk $PKGDEPENDS"
+	with_gtk="--enable-gtk3"
+else
+	with_gtk="--disable-gtk3"
+fi
+
+if [ "$INTROSPECTION" = "yes" ]; then
+	PKGDEPENDS="gobject-introspection:build $PKGDEPENDS"
+	with_introspection="--enable-introspection"
+else
+	with_introspection="--disable-introspection"
+fi
+
+if [ "$NLS" = "yes" ]; then
+	PKGDEPENDS="gettext $PKGDEPENDS"
+	with_nls="--enable-nls"
+else
+	with_nls="--disable-nls"
+fi
+
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvf $PKGNAME-$PKGVERSION.tar.gz
+	cd $PKGNAME-$PKGVERSION
+
+	# --disable-python: does not support Python 3 yet.
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	CXX="$CXX" \
+	CXXFLAGS="$CXXFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix= \
+		--sbindir=/bin \
+		--disable-gtk \
+		--disable-qt3 \
+		--disable-qt4  \
+		--disable-mono \
+		--disable-monodoc \
+		--disable-python \
+		--with-xml=expat \
+		--with-distro="none" \
+		--without-systemdsystemunitdir \
+		$with_dbus \
+		$with_glib \
+		$with_gobject \
+		$with_gtk \
+		$with_introspection \
+		$with_nls
+	make
+	make install DESTDIR=$DESTDIR
+	rmdir $DESTDIR/run
+	find $DESTDIR -type f -name "*.la" -delete
+	install -Dm644 ../avahi $DESTDIR/etc/rc.d/avahi
+
+	cd ..
+	rm -rf $PKGNAME-$PKGVERSION
+}