]> git.meshlink.io Git - catta/commitdiff
* Added FreeBSD rc.d scripts with the permission of its authors.
authorSebastien Estienne <sebastien.estienne@gmail.com>
Sat, 19 Nov 2005 19:49:24 +0000 (19:49 +0000)
committerSebastien Estienne <sebastien.estienne@gmail.com>
Sat, 19 Nov 2005 19:49:24 +0000 (19:49 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1017 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

configure.ac
initscript/Makefile.am
initscript/freebsd/Makefile.am [new file with mode: 0644]
initscript/freebsd/avahi-daemon.sh.in [new file with mode: 0644]
initscript/freebsd/avahi-dnsconfd.sh.in [new file with mode: 0644]

index b26ddd65241e8a9c99fc8695594cc83f737c5e04..7c4f8691431432ae4fdf6e4ba4b5e7b911592c4f 100644 (file)
@@ -129,9 +129,9 @@ fi
 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
 
 case $with_distro in
-    debian|gentoo|archlinux|suse|fedora|darwin|none)
+    debian|gentoo|archlinux|suse|fedora|darwin|freebsd|none)
      ;;
-    netbsd|freebsd)
+    netbsd)
      AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
      ;;
     linux)
@@ -715,6 +715,7 @@ initscript/archlinux/Makefile
 initscript/suse/Makefile
 initscript/fedora/Makefile
 initscript/darwin/Makefile
+initscript/freebsd/Makefile
 avahi-dnsconfd/Makefile
 avahi-utils/Makefile
 avahi-python/Makefile
index 9c4cba0204be7aed33b99ec344c1d16ab0a5e110..5511fe7de12370ce140f21ab3cdf9e6f02a634cf 100644 (file)
@@ -42,3 +42,7 @@ endif
 if TARGET_DARWIN
 SUBDIRS += darwin
 endif
+
+if TARGET_FREEBSD
+SUBDIRS += freebsd
+endif
diff --git a/initscript/freebsd/Makefile.am b/initscript/freebsd/Makefile.am
new file mode 100644 (file)
index 0000000..0ee75d5
--- /dev/null
@@ -0,0 +1,43 @@
+# $Id$
+
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+initddir = $(sysconfdir)/rc.d
+
+EXTRA_DIST = \
+       avahi-daemon.sh.in \
+       avahi-dnsconfd.sh.in
+
+initd_SCRIPTS = \
+       avahi-daemon.sh \
+       avahi-dnsconfd.sh
+
+CLEANFILES = \
+       avahi-daemon.sh \
+       avahi-dnsconfd.sh
+
+avahi-daemon.sh: avahi-daemon.sh.in
+       sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+       chmod +x $@
+
+avahi-dnsconfd.sh: avahi-dnsconfd.sh.in
+       sed \
+       -e 's,@sbindir\@,$(sbindir),g' \
+       -e 's,@sysconfdir\@,$(sysconfdir),g' \
+       $< > $@
+       chmod +x $@
diff --git a/initscript/freebsd/avahi-daemon.sh.in b/initscript/freebsd/avahi-daemon.sh.in
new file mode 100644 (file)
index 0000000..f3da39f
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD: /repoman/r/pcvs/ports/net/avahi/files/avahi-daemon.sh,v 1.2 2005/11/19 05:55:56 marcus Exp $
+#
+# PROVIDE: avahi_daemon
+# REQUIRE: DAEMON dbus
+# KEYWORD: FreeBSD
+#
+# Avahi's mDNSResponder, a Zeroconf (Bonjour) service advertisement daemon.
+#
+
+avahi_daemon_enable=${avahi_daemon_enable-"NO"}
+avahi_daemon_flags=${avahi_daemon_flags-"-D"}
+
+. /etc/rc.subr
+
+name=avahi_daemon
+rcvar=`set_rcvar`
+
+start_cmd=avahi_daemon_start
+stop_cmd=avahi_daemon_stop
+
+avahi_daemon_bin=@sbindir@/avahi-daemon
+
+avahi_daemon_start() {
+    checkyesno avahi_daemon_enable && echo "Starting avahi-daemon." && \
+       ${avahi_daemon_bin} ${avahi_daemon_flags}
+}
+
+avahi_daemon_stop() {
+    checkyesno avahi_daemon_enable && echo "Stopping avahi-daemon." && \
+       ${avahi_daemon_bin} -k
+}
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/initscript/freebsd/avahi-dnsconfd.sh.in b/initscript/freebsd/avahi-dnsconfd.sh.in
new file mode 100644 (file)
index 0000000..ed01f06
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD: /repoman/r/pcvs/ports/net/avahi/files/avahi-dnsconfd.sh,v 1.4 2005/11/19 06:36:09 ahze Exp $
+#
+# PROVIDE: avahi_dnsconfd
+# REQUIRE: DAEMON dbus avahi_daemon
+# KEYWORD: FreeBSD
+#
+# avahi-dnsconfd connects to a running avahi-daemon and runs  the script
+# @sysconfdir@/avahi/dnsconf.action for each unicast DNS server that
+# is announced on the local LAN. This is useful for configuring unicast
+# DNS servers in a DHCP-like fashion with mDNS.
+#
+
+avahi_dnsconfd_enable=${avahi_dnsconfd_enable-"NO"}
+avahi_dnsconfd_flags=${avahi_dnsconfd_flags-"-D"}
+
+. /etc/rc.subr
+
+name=avahi_dnsconfd
+rcvar=`set_rcvar`
+
+start_cmd=avahi_dnsconfd_start
+stop_cmd=avahi_dnsconfd_stop
+
+avahi_dnsconfd_bin=@sbindir@/avahi-dnsconfd
+
+avahi_dnsconfd_start() {
+    checkyesno avahi_dnsconfd_enable && echo "Starting avahi-dnsconfd." && \
+       ${avahi_dnsconfd_bin} ${avahi_dnsconfd_flags}
+}
+
+avahi_dnsconfd_stop() {
+    checkyesno avahi_dnsconfd_enable && echo "Stopping avahi-dnsconfd." && \
+       ${avahi_dnsconfd_bin} -k
+}
+
+load_rc_config ${name}
+run_rc_command "$1"