From c02aea192507f3206daef4a60527d05b485b3221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 14 Mar 2008 13:40:32 +0000 Subject: [PATCH] ISC DHCP: Add a proper wrapper for `dhclient-script' so that it finds `hostname' and friends; add a patch so that "make install" doesn't try to "mkdir /var/run"; add `meta' attribute. svn path=/nixpkgs/trunk/; revision=11123 --- pkgs/tools/networking/dhcp/default.nix | 23 +++++++++++++++---- .../networking/dhcp/no-mkdir-var-run.patch | 22 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 ++- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 pkgs/tools/networking/dhcp/no-mkdir-var-run.patch diff --git a/pkgs/tools/networking/dhcp/default.nix b/pkgs/tools/networking/dhcp/default.nix index 09e24e3a8b70..7777c1d56621 100644 --- a/pkgs/tools/networking/dhcp/default.nix +++ b/pkgs/tools/networking/dhcp/default.nix @@ -1,4 +1,5 @@ -{stdenv, fetchurl, groff, nettools, coreutils, iputils, gnused, bash}: +{ stdenv, fetchurl, groff, nettools, coreutils, iputils, gnused, + bash, makeWrapper }: stdenv.mkDerivation { name = "dhcp-3.0.6"; @@ -7,7 +8,21 @@ stdenv.mkDerivation { url = http://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz; sha256 = "0k8gy3ab9kzs4qcc9apgnxi982lhggha41fkw9w1bmvmz7mv0xwz"; }; - buildInputs = [groff]; - inherit nettools coreutils iputils gnused bash; - patches = [./resolv-without-domain.patch]; + buildInputs = [ groff nettools makeWrapper ]; +# inherit nettools coreutils iputils gnused bash; + patches = [ ./resolv-without-domain.patch ./no-mkdir-var-run.patch ]; + + postInstall = '' + wrapProgram "$out/sbin/dhclient-script" --prefix PATH : \ + "${nettools}/bin:${nettools}/sbin" + ''; + + meta = { + description = ''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.''; + homepage = http://www.isc.org/products/DHCP/; + license = "http://www.isc.org/sw/dhcp/dhcp-copyright.php"; + }; } diff --git a/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch b/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch new file mode 100644 index 000000000000..e8c5dc9f639a --- /dev/null +++ b/pkgs/tools/networking/dhcp/no-mkdir-var-run.patch @@ -0,0 +1,22 @@ +--- 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0722a2228dcc..f3c63624c012 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -502,7 +502,8 @@ rec { }; dhcp = import ../tools/networking/dhcp { - inherit fetchurl stdenv groff nettools coreutils iputils gnused bash; + inherit fetchurl stdenv groff nettools coreutils iputils gnused + bash makeWrapper; }; diffutils = useFromStdenv "diffutils"