]> git.meshlink.io Git - catta/commitdiff
add init script for LFS
authorWilliam Immendorf <will.immendorf@gmail.com>
Sun, 5 Apr 2009 18:38:00 +0000 (20:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 5 Apr 2009 18:38:58 +0000 (20:38 +0200)
configure.ac
initscript/Makefile.am
initscript/lfs/Makefile.am [new file with mode: 0644]
initscript/lfs/avahi.in [new file with mode: 0644]

index b6e44b3ea715c37383e4d36e9ca0949a2ef83c73..404f283201bcb9c1c5273a7a169529c4dbe3c8e4 100644 (file)
@@ -244,11 +244,12 @@ AC_TRY_COMPILE([#include <netinet/in.h>], [
 #
 # Detecting the linux distribution for specific things like init scripts.
 #
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of lfs, debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
 if test "z$with_distro" = "z"; then
     if test "$cross_compiling" = yes; then
         AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
     else
+        AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
         AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
         AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
         AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
@@ -264,7 +265,7 @@ fi
 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
 
 case $with_distro in
-    debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
+    lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
      ;;
     netbsd)
      AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
@@ -277,6 +278,7 @@ case $with_distro in
      ;;
 esac
 
+AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
@@ -1063,6 +1065,7 @@ initscript/gentoo/Makefile
 initscript/archlinux/Makefile
 initscript/suse/Makefile
 initscript/fedora/Makefile
+initscript/lfs/Makefile
 initscript/mandriva/Makefile
 initscript/darwin/Makefile
 initscript/freebsd/Makefile
index 7fcd15ffd4c0bcc454c3b9cf6edd42b1637ffcd7..d5fadda334ecdd04d37a6e7e51487601d18c604a 100644 (file)
 
 SUBDIRS = 
 
+if TARGET_LFS
+SUBDIRS += lfs
+endif
+
 if TARGET_DEBIAN
 SUBDIRS += debian
 endif
diff --git a/initscript/lfs/Makefile.am b/initscript/lfs/Makefile.am
new file mode 100644 (file)
index 0000000..d5e33f8
--- /dev/null
@@ -0,0 +1,29 @@
+# $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/init.d
+
+EXTRA_DIST = avahi.in
+
+initd_SCRIPTS = avahi
+
+CLEANFILES = avahi
+
+avahi: avahi.in
+       chmod +x $@
diff --git a/initscript/lfs/avahi.in b/initscript/lfs/avahi.in
new file mode 100644 (file)
index 0000000..ba3672a
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/avahi
+#
+# Description : Avahi daemon loader
+#
+# Authors     : William Immendorf - will.immendorf@gmail.com
+#
+# Version     : 00.00
+#
+# Notes       : Based off of the LFS 6.4 sysklogd script.
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+       start)
+               boot_mesg "Starting the Avahi daemon..."
+               loadproc avahi-daemon -D
+               ;;
+
+       stop)
+               boot_mesg "Stopping the Avahi daemon..."
+               avahi-daemon -k
+               evaluate_retval
+               ;;
+
+       reload)
+               boot_mesg "Reloading the Avahi daemon..."
+               reloadproc avahi-daemon -r
+               ;;
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+               ;;
+
+       status)
+               statusproc avahi-daemon
+               ;;
+       *)
+               echo "Usage: ${0} {start|stop|reload|restart|status}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/avahi