2010-08-06 12:34:34 +02:00
|
|
|
{ stdenv, fetchurl, nettools, iputils, iproute, makeWrapper, coreutils, gnused }:
|
2005-08-21 18:11:25 +02:00
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2011-02-11 13:24:24 +01:00
|
|
|
name = "dhcp-4.1.2-P1";
|
2009-07-24 01:57:11 +02:00
|
|
|
|
2005-08-21 18:11:25 +02:00
|
|
|
src = fetchurl {
|
2009-07-24 01:57:11 +02:00
|
|
|
url = "http://ftp.isc.org/isc/dhcp/${name}.tar.gz";
|
2011-02-11 13:24:24 +01:00
|
|
|
sha256 = "1kcdsylyx0ai0wlmc6rc6b1qi2fsndqh1pvgvddd3i4hmbhi6vmz";
|
2005-08-21 18:11:25 +02:00
|
|
|
};
|
2008-05-09 00:08:58 +02:00
|
|
|
|
2009-09-29 18:14:33 +02:00
|
|
|
patches =
|
|
|
|
[ # Don't bring down interfaces, because wpa_supplicant doesn't
|
|
|
|
# recover when the wlan interface goes down. Instead just flush
|
|
|
|
# all addresses, routes and neighbours of the interface.
|
|
|
|
./flush-if.patch
|
|
|
|
];
|
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
# Fixes "socket.c:591: error: invalid application of 'sizeof' to
|
|
|
|
# incomplete type 'struct in6_pktinfo'". See
|
|
|
|
# http://www.mail-archive.com/blfs-book@linuxfromscratch.org/msg13013.html
|
|
|
|
NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE";
|
2008-05-09 00:08:58 +02:00
|
|
|
|
2009-12-23 09:55:32 +01:00
|
|
|
# It would automatically add -Werror, which disables build in gcc 4.4
|
|
|
|
# due to an uninitialized variable.
|
|
|
|
CFLAGS = "-g -O2 -Wall";
|
|
|
|
|
2011-02-11 13:24:24 +01:00
|
|
|
buildInputs = [ makeWrapper ];
|
2008-03-14 14:40:32 +01:00
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
cp client/scripts/linux $out/sbin/dhclient-script
|
|
|
|
substituteInPlace $out/sbin/dhclient-script \
|
|
|
|
--replace /sbin/ip ${iproute}/sbin/ip
|
|
|
|
wrapProgram "$out/sbin/dhclient-script" --prefix PATH : \
|
2010-08-06 12:34:34 +02:00
|
|
|
"${nettools}/bin:${nettools}/sbin:${iputils}/bin:${coreutils}/bin:${gnused}/bin"
|
2009-07-24 01:57:11 +02:00
|
|
|
'';
|
2008-03-14 14:40:32 +01:00
|
|
|
|
2009-09-29 18:14:33 +02:00
|
|
|
preConfigure =
|
|
|
|
''
|
2009-07-30 12:04:48 +02:00
|
|
|
sed -i "includes/dhcpd.h" \
|
|
|
|
-"es|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g"
|
2009-09-29 18:14:33 +02:00
|
|
|
'';
|
2009-07-30 12:04:48 +02:00
|
|
|
|
2008-03-14 14:40:32 +01:00
|
|
|
meta = {
|
2008-05-09 00:08:58 +02:00
|
|
|
description = "Dynamic Host Configuration Protocol (DHCP) tools";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
ISC's Dynamic Host Configuration Protocol (DHCP) distribution
|
|
|
|
provides a freely redistributable reference implementation of
|
|
|
|
all aspects of DHCP, through a suite of DHCP tools: server,
|
|
|
|
client, and relay agent.
|
|
|
|
'';
|
|
|
|
|
2008-03-14 14:40:32 +01:00
|
|
|
homepage = http://www.isc.org/products/DHCP/;
|
|
|
|
license = "http://www.isc.org/sw/dhcp/dhcp-copyright.php";
|
|
|
|
};
|
2005-08-21 18:11:25 +02:00
|
|
|
}
|