main/dhcp: create dhcrelay subpackage with init.d script

fixes #281
This commit is contained in:
Natanael Copa 2010-02-16 17:33:21 +00:00
parent 88047fba6a
commit 669e19155d
3 changed files with 61 additions and 2 deletions

View File

@ -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"

13
main/dhcp/dhcrelay.confd Normal file
View File

@ -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=""

33
main/dhcp/dhcrelay.initd Normal file
View File

@ -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 $?
}