summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-06-07 00:10:54 +0000
committerMike Frysinger <vapier@gentoo.org>2005-06-07 00:10:54 +0000
commitefb61c5059c772ddeee2bd1bab0c023c01a51dcb (patch)
tree8e156db61290605cc2bcdef2feaf574a65e4ed0d /net-misc/udhcp
parentMarking ~amd64 per bug #95270 (diff)
downloadgentoo-2-efb61c5059c772ddeee2bd1bab0c023c01a51dcb.tar.gz
gentoo-2-efb61c5059c772ddeee2bd1bab0c023c01a51dcb.tar.bz2
gentoo-2-efb61c5059c772ddeee2bd1bab0c023c01a51dcb.zip
Add an init.d script #95130 by Samuel Penn.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-misc/udhcp')
-rw-r--r--net-misc/udhcp/ChangeLog8
-rwxr-xr-xnet-misc/udhcp/files/udhcp.rc35
-rw-r--r--net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild13
3 files changed, 49 insertions, 7 deletions
diff --git a/net-misc/udhcp/ChangeLog b/net-misc/udhcp/ChangeLog
index 20f1f754f8de..789c474b22eb 100644
--- a/net-misc/udhcp/ChangeLog
+++ b/net-misc/udhcp/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-misc/udhcp
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/ChangeLog,v 1.15 2004/12/17 04:27:29 vapier Exp $
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/ChangeLog,v 1.16 2005/06/07 00:10:54 vapier Exp $
+
+ 07 Jun 2005; Mike Frysinger <vapier@gentoo.org> +files/udhcp.rc,
+ udhcp-0.9.9_pre20041216.ebuild:
+ Add an init.d script #95130 by Samuel Penn.
*udhcp-0.9.9_pre20041216 (16 Dec 2004)
diff --git a/net-misc/udhcp/files/udhcp.rc b/net-misc/udhcp/files/udhcp.rc
new file mode 100755
index 000000000000..668b05a2e714
--- /dev/null
+++ b/net-misc/udhcp/files/udhcp.rc
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/files/udhcp.rc,v 1.1 2005/06/07 00:10:54 vapier Exp $
+
+depend() {
+ use net logger
+}
+
+checkconfig() {
+ if [[ ! -f /etc/udhcpd.conf ]] ; then
+ eerror "No /etc/udhcpd.conf file exists"
+ return 1
+ fi
+
+ if [[ ! -e /var/lib/misc/udhcpd.leases ]] ; then
+ ebegin "Creating udhcpd.leases"
+ touch /var/lib/misc/udhcpd.leases || return 1
+ eend $?
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting udhcpd"
+ udhcpd > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping udhcpd"
+ start-stop-daemon --stop --pidfile /var/run/udhcpd.pid
+ eend $?
+}
diff --git a/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild b/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild
index e312a009a7ce..2894839692f6 100644
--- a/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild
+++ b/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild,v 1.1 2004/12/17 04:27:29 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/udhcp-0.9.9_pre20041216.ebuild,v 1.2 2005/06/07 00:10:54 vapier Exp $
inherit eutils toolchain-funcs
@@ -24,13 +24,16 @@ pkg_setup() {
}
src_compile() {
- emake CROSS_COMPILE=${CHOST}- STRIP=true SYSLOG=1 || die
+ emake \
+ CROSS_COMPILE=${CHOST}- \
+ STRIP=true \
+ UDHCP_SYSLOG=1 \
+ || die
}
src_install() {
make STRIP=true install DESTDIR="${D}" || die
- dodir /sbin
- dosym /usr/sbin/udhcpc /sbin/udhcpc
+ newinitd "${FILESDIR}"/udhcp.rc udhcp
insinto /etc
doins samples/udhcpd.conf
dodoc AUTHORS ChangeLog README* TODO