diff --git a/srcpkgs/dhclient b/srcpkgs/dhclient new file mode 120000 index 00000000000..2f2406769e8 --- /dev/null +++ b/srcpkgs/dhclient @@ -0,0 +1 @@ +dhcp \ No newline at end of file diff --git a/srcpkgs/dhcp-devel b/srcpkgs/dhcp-devel new file mode 120000 index 00000000000..2f2406769e8 --- /dev/null +++ b/srcpkgs/dhcp-devel @@ -0,0 +1 @@ +dhcp \ No newline at end of file diff --git a/srcpkgs/dhcp/files/dhclient/run b/srcpkgs/dhcp/files/dhclient/run new file mode 100755 index 00000000000..5cb45f19cf5 --- /dev/null +++ b/srcpkgs/dhcp/files/dhclient/run @@ -0,0 +1,3 @@ +#!/bin/sh +[ -r conf ] && . ./conf +exec dhclient ${OPTS:=-d} diff --git a/srcpkgs/dhcp/files/dhcpd4/run b/srcpkgs/dhcp/files/dhcpd4/run new file mode 100755 index 00000000000..62d8760de5e --- /dev/null +++ b/srcpkgs/dhcp/files/dhcpd4/run @@ -0,0 +1,3 @@ +#!/bin/sh +[ -r conf ] && . ./conf +exec dhcpd ${OPTS:=-4 -q -pf /run/dhcpd4.pid} diff --git a/srcpkgs/dhcp/files/dhcpd6/run b/srcpkgs/dhcp/files/dhcpd6/run new file mode 100755 index 00000000000..93a7ec169e1 --- /dev/null +++ b/srcpkgs/dhcp/files/dhcpd6/run @@ -0,0 +1,3 @@ +#!/bin/sh +[ -r conf ] && . ./conf +exec dhcpd ${OPTS:=-6 -q -pf /run/dhcpd6.pid} diff --git a/srcpkgs/dhcp/patches/001_nonfatal_no_ipv6.patch b/srcpkgs/dhcp/patches/001_nonfatal_no_ipv6.patch new file mode 100644 index 00000000000..66d716170bf --- /dev/null +++ b/srcpkgs/dhcp/patches/001_nonfatal_no_ipv6.patch @@ -0,0 +1,48 @@ +Submitted By: Ken Moffat +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 diff --git a/srcpkgs/dhcp/patches/002_debashify.patch b/srcpkgs/dhcp/patches/002_debashify.patch new file mode 100644 index 00000000000..9cc9bf31daf --- /dev/null +++ b/srcpkgs/dhcp/patches/002_debashify.patch @@ -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 (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 + diff --git a/srcpkgs/dhcp/template b/srcpkgs/dhcp/template new file mode 100644 index 00000000000..07d7ec1f313 --- /dev/null +++ b/srcpkgs/dhcp/template @@ -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 " +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 + } +}