# HG changeset patch # User David Demelier # Date 1567107000 -7200 # Node ID 20743b1b6f7439ad0ff197c7afde71f37d0f7d2b # Parent 7050a00e84e54b37912b3b405732bb7c5d40f109 dns/avahi: initial import, closes #1211 diff -r 7050a00e84e5 -r 20743b1b6f74 Docs/uids.md --- a/Docs/uids.md Thu Aug 29 21:15:00 2019 +0200 +++ b/Docs/uids.md Thu Aug 29 21:30:00 2019 +0200 @@ -8,12 +8,14 @@ The following UID/GID are defined: -| uid | gid | package(s) | -|----------------|--------------------|------------------| -| sshd (100) | sshd (100) | network/openssh | -| polkitd (101) | polkitd (101) | security/polkit | -| pulse (102) | pulse (102) | audio/pulseaudio | -| | pulse-rt (103) | audio/pulseaudio | -| | pulse-access (104) | audio/pulseaudio | -| wesnothd (105) | wesnothd (105) | games/wesnoth | -| mpd (106) | mpd (106) | audio/mpd | +| uid | gid | package(s) | +|---------------------|---------------------|------------------| +| sshd (100) | sshd (100) | network/openssh | +| polkitd (101) | polkitd (101) | security/polkit | +| pulse (102) | pulse (102) | audio/pulseaudio | +| | pulse-rt (103) | audio/pulseaudio | +| | pulse-access (104) | audio/pulseaudio | +| wesnothd (105) | wesnothd (105) | games/wesnoth | +| mpd (106) | mpd (106) | audio/mpd | +| avahi (107) | avahi (107) | dns/avahi | +| avahi-autoipd (108) | avahi-autoipd (108) | dns/avahi | diff -r 7050a00e84e5 -r 20743b1b6f74 dns/avahi/avahi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dns/avahi/avahi Thu Aug 29 21:30:00 2019 +0200 @@ -0,0 +1,75 @@ +#!/bin/busybox sh +# +# /etc/rc.d/avahi -- run control script for avahi +# +# Copyright (c) 2019 David Demelier +# +# 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. +# + +if [ -f /etc/rc.conf ]; then + . /etc/rc.conf +fi + +: ${AVAHI_CMD:=/bin/avahi-daemon} +: ${AVAHI_ARGS:=-D} +: ${AVAHI_PID:=/var/run/avahi-daemon/pid} + +avahi_start() +{ + echo "Starting avahi: $AVAHI_CMD $AVAHI_ARGS" + $AVAHI_CMD $AVAHI_ARGS +} + +avahi_status() +{ + if [ -s $AVAHI_PID ]; then + echo "avahi is running with pid: $(cat $AVAHI_PID)" + else + echo "avahi is not running" + fi +} + +avahi_stop() +{ + if [ -s $AVAHI_PID ]; then + echo "Stopping avahi." + kill -QUIT $(cat $AVAHI_PID) + rm -f $AVAHI_PID + fi +} + +avahi_restart() +{ + avahi_stop + sleep 3 + avahi_start +} + +case $1 in +start) + avahi_start + ;; +status) + avahi_status + ;; +stop) + avahi_stop + ;; +restart) + avahi_restart + ;; +*) + echo "usage: $(basename $0) restart|start|status|stop" + ;; +esac diff -r 7050a00e84e5 -r 20743b1b6f74 dns/avahi/avahi-post.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dns/avahi/avahi-post.sh Thu Aug 29 21:30:00 2019 +0200 @@ -0,0 +1,18 @@ +#!/bin/busybox sh +# +# Copyright (c) 2019 David Demelier +# +# 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. +# + +install -dm755 -o avahi -g avahi /var/run/avahi-daemon diff -r 7050a00e84e5 -r 20743b1b6f74 dns/avahi/avahi.sh --- /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 +# +# 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 +} diff -r 7050a00e84e5 -r 20743b1b6f74 dns/avahi/avahi.sha1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dns/avahi/avahi.sha1 Thu Aug 29 21:30:00 2019 +0200 @@ -0,0 +1,1 @@ +8a062878968c0f8e083046429647ad33b122542f avahi-0.7.tar.gz