summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-06-24 16:58:38 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-08-13 15:08:08 -0500
commit05976a2b5a3d048fbcad1191f57800113788d700 (patch)
treeb74286d30bcbbe9854fc35770844920ec4ced236 /pkgs
parent6c2763c3bf2ca6be4c71fd12ec99925599352591 (diff)
downloadnixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar.gz
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar.bz2
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar.lz
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar.xz
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.tar.zst
nixlib-05976a2b5a3d048fbcad1191f57800113788d700.zip
dhcpd: Update 4.1-ESV-R6 -> 4.3.0
Additionally add the ability to run as a non-root user / group by including
paranoia patches in the build.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/dhcp/default.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix
index 2dac54577b8b..1a00c335684e 100644
--- a/pkgs/tools/networking/dhcp/default.nix
+++ b/pkgs/tools/networking/dhcp/default.nix
@@ -1,11 +1,12 @@
-{ stdenv, fetchurl, nettools, iputils, iproute, makeWrapper, coreutils, gnused }:
+{ stdenv, fetchurl, perl, file, nettools, iputils, iproute, makeWrapper, coreutils, gnused }:
 
 stdenv.mkDerivation rec {
-  name = "dhcp-4.1-ESV-R6";
+  name = "dhcp-${version}";
+  version = "4.3.0";
   
   src = fetchurl {
-    url = http://ftp.isc.org/isc/dhcp/4.1-ESV-R6/dhcp-4.1-ESV-R6.tar.gz;
-    sha256 = "17md1vml07szl9dx4875gfg4sgnb3z73glpbq1si7p82mfhnddny";
+    url = "http://ftp.isc.org/isc/dhcp/${version}/${name}.tar.gz";
+    sha256 = "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7";
   };
 
   patches =
@@ -23,13 +24,15 @@ stdenv.mkDerivation rec {
   # 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";
+  #
+  # Also adds the ability to run dhcpd as a non-root user / group
+  NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE -DPARANOIA";
 
   # It would automatically add -Werror, which disables build in gcc 4.4
   # due to an uninitialized variable.
   CFLAGS = "-g -O2 -Wall";
 
-  buildInputs = [ makeWrapper ];
+  buildInputs = [ perl makeWrapper ];
 
   postInstall =
     ''
@@ -42,6 +45,7 @@ stdenv.mkDerivation rec {
 
   preConfigure =
     ''
+      substituteInPlace configure --replace "/usr/bin/file" "${file}/bin/file"
       sed -i "includes/dhcpd.h" \
 	-"es|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g"
     '';