summaryrefslogtreecommitdiffstats
path: root/main/dhcp
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-02-16 17:33:21 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-02-16 17:33:21 +0000
commit669e19155dc8d1649d48fa4a2ee8c972f2ff453d (patch)
tree0d9bb04a96a4355921b7906a93e20a3841946c85 /main/dhcp
parent88047fba6a5acc2eb88a55990fb06c6ac1d80001 (diff)
downloadaports-669e19155dc8d1649d48fa4a2ee8c972f2ff453d.tar.bz2
aports-669e19155dc8d1649d48fa4a2ee8c972f2ff453d.tar.xz
main/dhcp: create dhcrelay subpackage with init.d script
fixes #281
Diffstat (limited to 'main/dhcp')
-rw-r--r--main/dhcp/APKBUILD17
-rw-r--r--main/dhcp/dhcrelay.confd13
-rw-r--r--main/dhcp/dhcrelay.initd33
3 files changed, 61 insertions, 2 deletions
diff --git a/main/dhcp/APKBUILD b/main/dhcp/APKBUILD
index c2177e5a8..e78065233 100644
--- a/main/dhcp/APKBUILD
+++ b/main/dhcp/APKBUILD
@@ -2,17 +2,19 @@
pkgname=dhcp
pkgver=4.1.0_p1
_realver=4.1.0p1
-pkgrel=5
+pkgrel=6
pkgdesc="ISC Dynamic Host Configuration Protocol (DHCP)"
url="https://www.isc.org/"
license="GPL"
depends=
makedepends=
install="dhcp.pre-install dhcp.post-install dhcp.pre-upgrade dhcp.post-upgrade"
-subpackages="$pkgname-doc $pkgname-dev dhclient"
+subpackages="$pkgname-doc $pkgname-dev dhclient dhcrelay"
source="http://ftp.isc.org/isc/dhcp/$pkgname-$_realver.tar.gz
linux_ipv6_discover.patch
dhcp-3.0-fix-perms.patch
+ dhcrelay.initd
+ dhcrelay.confd
dhcpd.confd
dhcpd.initd"
@@ -58,8 +60,19 @@ dhclient() {
mv "$pkgdir"/etc/dhcp/dhclient.conf "$subpkgdir"/etc/dhcp/
}
+dhcrelay() {
+ pkgdesc="ISC dhcp relay server"
+ install -d "$pkgdir"/var/run/dhcp
+ install -d "$subpkgdir"/usr/sbin
+ mv "$pkgdir"/usr/sbin/dhcrelay "$subpkgdir"/usr/sbin/
+ install -m755 -D "$srcdir"/dhcrelay.initd "$pkgdir"/etc/init.d/dhcrelay
+ install -m644 -D "$srcdir"/dhcrelay.confd "$pkgdir"/etc/conf.d/dhcrelay
+}
+
md5sums="325ff8338c5a21f89d5304ac13ffebdf dhcp-4.1.0p1.tar.gz
37abf1fb047a353e91b022fafdabf39a linux_ipv6_discover.patch
a9eaf182dae3984670da52f20ae10fba dhcp-3.0-fix-perms.patch
+ce18f48dff6ef20c6efa2a052584b536 dhcrelay.initd
+db84514fe15fd7d81136afbaae738f55 dhcrelay.confd
df32707f5bbe5363306420b5dc6e6b40 dhcpd.confd
be2259371681bd4ab8a577b1b1a989ae dhcpd.initd"
diff --git a/main/dhcp/dhcrelay.confd b/main/dhcp/dhcrelay.confd
new file mode 100644
index 000000000..1102d3a41
--- /dev/null
+++ b/main/dhcp/dhcrelay.confd
@@ -0,0 +1,13 @@
+# /etc/conf.d/dhcrelay: config file for /etc/init.d/dhcrelay
+
+# Configure which interface or interfaces to for dhcrelay to listen on
+# and send to.
+# List all interfaces space separated. If this is not specified then
+# we use all interfaces.
+#IFACE=""
+
+# Insert any other options needed. See dhcrelay(8) for details.
+#DHCRELAY_OPTS=""
+
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+DHCRELAY_SERVERS=""
diff --git a/main/dhcp/dhcrelay.initd b/main/dhcp/dhcrelay.initd
new file mode 100644
index 000000000..dc55bf0f2
--- /dev/null
+++ b/main/dhcp/dhcrelay.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init,v 1.2 2007/03/22 15:36:59 uberlord Exp $
+
+depend() {
+ need net
+ use logger
+ after firewall
+}
+
+start() {
+ if [ -z "${DHCRELAY_SERVERS}" ]; then
+ eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/dhcrelay"
+ return 1
+ fi
+
+ local IFACES= i=
+ for i in ${IFACE} ; do
+ IFACES="${IFACES} -i ${i}"
+ done
+
+ ebegin "Starting dhcrelay"
+ start-stop-daemon --start --exec /usr/sbin/dhcrelay \
+ -- -q ${IFACES} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dhcrelay"
+ start-stop-daemon --stop --pidfile /var/run/dhcrelay.pid
+ eend $?
+}