New package: dhcp-4.2.3

This commit is contained in:
Enno Boland 2015-03-28 18:55:09 +01:00
parent b11f571b07
commit fbde12f5f6
8 changed files with 135 additions and 0 deletions

1
srcpkgs/dhclient Symbolic link
View File

@ -0,0 +1 @@
dhcp

1
srcpkgs/dhcp-devel Symbolic link
View File

@ -0,0 +1 @@
dhcp

View File

@ -0,0 +1,3 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec dhclient ${OPTS:=-d}

3
srcpkgs/dhcp/files/dhcpd4/run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec dhcpd ${OPTS:=-4 -q -pf /run/dhcpd4.pid}

3
srcpkgs/dhcp/files/dhcpd6/run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec dhcpd ${OPTS:=-6 -q -pf /run/dhcpd6.pid}

View File

@ -0,0 +1,48 @@
Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
Date: 2011-11-23
Initial Package Version: 4.2.2
Upstream Status: unknown
Origin: found at fedora
Description: Allow dhcp4 to work even if the kernel doesn't support ipv6.
Fixed up by hand to apply to 4.2.2 (to me, it looks identical to the 4.2.0
version, but patch failed in one hunk when I tried to apply that one).
--- common/discover.c.orig 2011-07-19 23:22:48.000000000 +0100
+++ common/discover.c 2011-09-06 01:28:15.000000000 +0100
@@ -455,7 +455,7 @@
}
#ifdef DHCPv6
- if (local_family == AF_INET6) {
+ if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
if (ifaces->fp6 == NULL) {
log_error("Error opening '/proc/net/if_inet6' to "
@@ -466,6 +466,8 @@
ifaces->fp = NULL;
return 0;
}
+ } else {
+ ifaces->fp6 = NULL;
}
#endif
@@ -733,7 +735,7 @@
return 1;
}
#ifdef DHCPv6
- if (!(*err)) {
+ if (!(*err) && ifaces->fp6) {
if (local_family == AF_INET6)
return next_iface6(info, err, ifaces);
}
@@ -752,7 +754,8 @@
ifaces->sock = -1;
#ifdef DHCPv6
if (local_family == AF_INET6) {
- fclose(ifaces->fp6);
+ if (ifaces->fp6)
+ fclose(ifaces->fp6);
ifaces->fp6 = NULL;
}
#endif

View File

@ -0,0 +1,30 @@
--- client/scripts/linux.orig 2015-03-28 18:39:02.213070516 +0100
+++ client/scripts/linux 2015-03-28 18:38:54.187071116 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# dhclient-script for Linux. Dan Halbert, March, 1997.
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
# No guarantees about this. I'm a novice at the details of Linux
@@ -49,11 +49,10 @@ make_resolv_conf() {
if [ "x${new_dhcp6_domain_search}" != x ] ; then
echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
fi
- shopt -s nocasematch
for nameserver in ${new_dhcp6_name_servers} ; do
# If the nameserver has a link-local address
# add a <zone_id> (interface name) to it.
- if [[ "$nameserver" =~ ^fe80:: ]]
+ if echo "$nameserver" | grep -i "^fe80::" > /dev/null
then
zone_id="%$interface"
else
@@ -61,7 +60,6 @@ make_resolv_conf() {
fi
echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
done
- shopt -u nocasematch
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi

46
srcpkgs/dhcp/template Normal file
View File

@ -0,0 +1,46 @@
# Template file for 'dhcp'
pkgname=dhcp
version=4.2.3
revision=1
build_style=gnu-configure
hostmakedepends="perl"
short_desc="Server from the Internet Software Consortium's implementation of DHCP"
maintainer="Enno Boland <eb@s01.de>"
license="ISC"
homepage="https://www.isc.org/software/dhcp"
distfiles="ftp://ftp.isc.org/isc/${pkgname}/${pkgname}-${version}/${pkgname}-${version}.tar.gz"
checksum=505c5754526ba92669bfd64daa8b529c6694c4528b45c3f35743c6fd4bd72897
configure_args="
--enable-paranoia
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases
--with-cli-lease-file=/var/lib/dhclient/dhclient.leases
--with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases"
conf_files="/etc/dhcpd.conf"
post_install() {
vsv dhcpd4
vsv dhcpd6
}
dhclient_package() {
short_desc="Client from the Internet Software Consortium's implementation of DHCP"
conf_files="/etc/dhclient.conf"
pkg_install() {
vmove etc/dhclient.conf
vmove usr/sbin/dhclient
vmove usr/share/man/man5/dhclient*
vmove usr/share/man/man8/dhclient*
vsv dhclient
}
}
dhcp-devel_package() {
depends="dhcp>=${version}_${revision} dhclient>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove usr/share/man/man3
}
}