diff --git a/pkgs/tools/networking/dhcp/builder.sh b/pkgs/tools/networking/dhcp/builder.sh deleted file mode 100644 index 19c3d6087361..000000000000 --- a/pkgs/tools/networking/dhcp/builder.sh +++ /dev/null @@ -1,24 +0,0 @@ -source $stdenv/setup - -# Hack to prevent dhclient from overriding the PATH specified with -# '-e' on the command-line. -makeFlagsArray=(CLIENT_PATH='\"FAKE_PATH=/nothing\"' \ - USERBINDIR=$out/bin BINDIR=$out/sbin CLIENTBINDIR=$out/sbin \ - ADMMANDIR=$out/share/man/man8 FFMANDIR=$out/share/man/man5 \ - LIBMANDIR=$out/share/man/man3 USRMANDIR=$out/share/man/man1 \ - LIBDIR=$out/lib INCDIR=$out/include VARDB=$OUT/var/run \ -) - -configurePhase() { - # Patch the header that contains absolute paths to the tools. - sed -i "includes/dhcpd.h" \ - -"es|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g" - - ./configure -} - -preBuild() { - substituteInPlace client/scripts/linux --replace /bin/bash $shell -} - -genericBuild diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix index 063dc15532bd..94e59ad8b161 100644 --- a/pkgs/tools/networking/dhcp/default.nix +++ b/pkgs/tools/networking/dhcp/default.nix @@ -1,22 +1,28 @@ -{ stdenv, fetchurl, groff, nettools, coreutils, iputils, gnused, - bash, makeWrapper }: +{ stdenv, fetchurl, nettools, iputils, iproute, makeWrapper }: -stdenv.mkDerivation { - name = "dhcp-3.0.6"; - builder = ./builder.sh; +stdenv.mkDerivation rec { + name = "dhcp-4.1.0p1"; + src = fetchurl { - url = http://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz; - sha256 = "0k8gy3ab9kzs4qcc9apgnxi982lhggha41fkw9w1bmvmz7mv0xwz"; + url = "http://ftp.isc.org/isc/dhcp/${name}.tar.gz"; + sha256 = "0il966bcls7nfd93qfqrgvd2apkm0kv7pk35lnl1nvbm7fyrik7z"; }; - buildInputs = [ groff nettools coreutils makeWrapper ]; + # 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"; - patches = [ ./resolv-without-domain.patch ./no-mkdir-var-run.patch ]; + buildInputs = [makeWrapper]; - postInstall = '' - wrapProgram "$out/sbin/dhclient-script" --prefix PATH : \ - "${nettools}/bin:${nettools}/sbin:${coreutils}/bin:${gnused}/bin" - ''; + 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 : \ + "${nettools}/bin:${nettools}/sbin:${iputils}/bin" + ''; meta = { description = "Dynamic Host Configuration Protocol (DHCP) tools"; diff --git a/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch b/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch deleted file mode 100644 index e8c5dc9f639a..000000000000 --- a/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- dhcp-3.0.6/client/Makefile.dist 2008-03-14 14:36:04.000000000 +0100 -+++ dhcp-3.0.6/client/Makefile.dist 2008-03-14 14:36:06.000000000 +0100 -@@ -38,7 +38,7 @@ CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUD - all: $(PROG) $(CATMANPAGES) - - install: all -- for dir in $(CLIENTBINDIR) $(ETC) $(FFMANDIR) $(ADMMANDIR) $(VARDB); \ -+ for dir in $(CLIENTBINDIR) $(ETC) $(FFMANDIR) $(ADMMANDIR); \ - do \ - foo=""; \ - for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ ---- dhcp-3.0.6/server/Makefile.dist 2008-03-14 14:37:05.000000000 +0100 -+++ dhcp-3.0.6/server/Makefile.dist 2008-03-14 14:37:13.000000000 +0100 -@@ -38,7 +38,7 @@ CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUD - all: $(PROG) $(CATMANPAGES) - - install: all -- for dir in $(BINDIR) $(ADMMANDIR) $(FFMANDIR) $(VARDB); do \ -+ for dir in $(BINDIR) $(ADMMANDIR) $(FFMANDIR); do \ - foo=""; \ - for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ - foo=$${foo}/$$bar; \ diff --git a/pkgs/tools/networking/dhcp/resolv-without-domain.patch b/pkgs/tools/networking/dhcp/resolv-without-domain.patch deleted file mode 100644 index 262c441f930a..000000000000 --- a/pkgs/tools/networking/dhcp/resolv-without-domain.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -rc dhcp-3.0.5-orig/client/scripts/linux dhcp-3.0.5/client/scripts/linux -*** dhcp-3.0.5-orig/client/scripts/linux Fri Nov 15 02:09:09 2002 ---- dhcp-3.0.5/client/scripts/linux Tue Feb 20 15:02:34 2007 -*************** -*** 23,31 **** - # of the $1 in its args. - - make_resolv_conf() { -! if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then -! echo search $new_domain_name >/etc/resolv.conf - chmod 644 /etc/resolv.conf - for nameserver in $new_domain_name_servers; do - echo nameserver $nameserver >>/etc/resolv.conf - done ---- 23,34 ---- - # of the $1 in its args. - - make_resolv_conf() { -! if [ x"$new_domain_name_servers" != x ]; then -! echo -n >/etc/resolv.conf - chmod 644 /etc/resolv.conf -+ if [ "x$new_domain_name" != x ]; then -+ echo search $new_domain_name >>/etc/resolv.conf -+ fi - for nameserver in $new_domain_name_servers; do - echo nameserver $nameserver >>/etc/resolv.conf - done diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c4413557b146..2c3936c02576 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -604,8 +604,7 @@ let }; dhcp = import ../tools/networking/dhcp { - inherit fetchurl stdenv groff nettools coreutils iputils gnused - bash makeWrapper; + inherit fetchurl stdenv nettools iputils iproute makeWrapper; }; dhcpcd = import ../tools/networking/dhcpcd {