2015-03-26 20:27:48 +01:00
|
|
|
{ stdenv, fetchurl, perl, file, nettools, iputils, iproute, makeWrapper
|
2016-09-28 03:39:11 +02:00
|
|
|
, coreutils, gnused, openldap ? null
|
2015-03-26 20:27:48 +01:00
|
|
|
}:
|
2005-08-21 18:11:25 +02:00
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2014-06-24 23:58:38 +02:00
|
|
|
name = "dhcp-${version}";
|
2018-04-08 03:39:32 +02:00
|
|
|
version = "4.4.1";
|
2016-09-28 03:39:11 +02:00
|
|
|
|
2005-08-21 18:11:25 +02:00
|
|
|
src = fetchurl {
|
2014-06-24 23:58:38 +02:00
|
|
|
url = "http://ftp.isc.org/isc/dhcp/${version}/${name}.tar.gz";
|
2018-04-08 03:39:32 +02:00
|
|
|
sha256 = "025nfqx4zwdgv4b3rkw26ihcj312vir08jk6yi57ndmb4a4m08ia";
|
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 =
|
2018-01-08 17:33:59 +01:00
|
|
|
[
|
2011-04-01 17:04:20 +02:00
|
|
|
# Make sure that the hostname gets set on reboot. Without this
|
|
|
|
# patch, the hostname doesn't get set properly if the old
|
|
|
|
# hostname (i.e. before reboot) is equal to the new hostname.
|
|
|
|
./set-hostname.patch
|
2009-09-29 18:14:33 +02:00
|
|
|
];
|
|
|
|
|
2016-09-28 03:39:11 +02:00
|
|
|
buildInputs = [ perl makeWrapper openldap ];
|
2015-03-26 20:27:48 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-failover"
|
|
|
|
"--enable-execute"
|
|
|
|
"--enable-tracing"
|
|
|
|
"--enable-delayed-ack"
|
|
|
|
"--enable-dhcpv6"
|
|
|
|
"--enable-paranoia"
|
|
|
|
"--enable-early-chroot"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
] ++ stdenv.lib.optionals (openldap != null) [ "--with-ldap" "--with-ldapcrypto" ];
|
|
|
|
|
2017-11-12 12:16:47 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=pointer-compare" ];
|
|
|
|
|
2015-03-26 20:27:48 +01:00
|
|
|
installFlags = [ "DESTDIR=\${out}" ];
|
2008-03-14 14:40:32 +01:00
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
postInstall =
|
|
|
|
''
|
2015-03-26 20:27:48 +01:00
|
|
|
mv $out/$out/* $out
|
|
|
|
DIR=$out/$out
|
|
|
|
while rmdir $DIR 2>/dev/null; do
|
|
|
|
DIR="$(dirname "$DIR")"
|
|
|
|
done
|
|
|
|
|
2009-07-24 01:57:11 +02:00
|
|
|
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 =
|
|
|
|
''
|
2014-06-24 23:58:38 +02:00
|
|
|
substituteInPlace configure --replace "/usr/bin/file" "${file}/bin/file"
|
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
|
|
|
|
2014-08-07 06:08:10 +02:00
|
|
|
meta = with stdenv.lib; {
|
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/;
|
2014-08-07 06:08:10 +02:00
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ wkennington ];
|
2008-03-14 14:40:32 +01:00
|
|
|
};
|
2005-08-21 18:11:25 +02:00
|
|
|
}
|