From 74c988959aa36fb9716a08530e1dc9c82f6ec588 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 2 Feb 2011 16:05:18 +0000 Subject: [PATCH] * Updated iputils (though perhaps we should just use GNU inetutils). svn path=/nixpkgs/trunk/; revision=25765 --- pkgs/os-specific/linux/iputils/builder.sh | 18 ----------- pkgs/os-specific/linux/iputils/default.nix | 30 ++++++++++++++----- pkgs/os-specific/linux/iputils/open-max.patch | 30 ------------------- pkgs/os-specific/linux/sysfsutils/default.nix | 14 +++++---- pkgs/top-level/all-packages.nix | 7 +---- 5 files changed, 31 insertions(+), 68 deletions(-) delete mode 100644 pkgs/os-specific/linux/iputils/builder.sh delete mode 100644 pkgs/os-specific/linux/iputils/open-max.patch diff --git a/pkgs/os-specific/linux/iputils/builder.sh b/pkgs/os-specific/linux/iputils/builder.sh deleted file mode 100644 index b5219c3fefc7..000000000000 --- a/pkgs/os-specific/linux/iputils/builder.sh +++ /dev/null @@ -1,18 +0,0 @@ -source $stdenv/setup - -makeFlags="KERNEL_INCLUDE=$kernelHeaders/include LIBC_INCLUDE=$glibc/include" - -preConfigure="sed -e 's@check-kernel @@' -i Makefile" - -installPhase=" -mkdir -pv $out/bin $out/sbin -install -c arping $out/sbin/ -install -c ping $out/bin/ -install -c ping6 $out/sbin/ -install -c rdisc $out/sbin/ -install -c tracepath $out/sbin/ -install -c tracepath6 $out/sbin/ -install -c traceroute6 $out/sbin/ -"; - -genericBuild diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 81433a313b9e..a50aefaec97d 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -1,15 +1,29 @@ -{stdenv, fetchurl, linuxHeaders, glibc}: +{ stdenv, fetchurl, libsysfs, openssl }: -assert stdenv.isLinux && stdenv.system != "powerpc-linux"; +assert stdenv ? glibc; stdenv.mkDerivation { - name = "iputils-20020927"; - builder = ./builder.sh; + name = "iputils-20101006"; + src = fetchurl { - url = ftp://ftp.nl.debian.org/debian/pool/main/i/iputils/iputils_20020927.orig.tar.gz; - md5 = "b5493f7a2997130a4f86c486c9993b86"; + url = http://www.skbuff.net/iputils/iputils-s20101006.tar.bz2; + sha256 = "1rvfvdnmzlmgy9a6xv5v4n785zmn10v2l7yaq83rdfgbh1ng8fpx"; }; - inherit linuxHeaders glibc; - patches = [ ./open-max.patch ]; + buildInputs = [ libsysfs openssl ]; + + # Urgh, it uses Make's `-l' dependency "feature". + makeFlags = "VPATH=${libsysfs}/lib:${stdenv.glibc}/lib:${openssl}/lib"; + + installPhase = + '' + mkdir -p $out/sbin + cp -p arping ping ping6 rdisc tracepath tracepath6 traceroute6 $out/sbin/ + ''; + + meta = { + homepage = http://www.skbuff.net/iputils/; + description = "A set of small useful utilities for Linux networking"; + platforms = stdenv.lib.platforms.linux; + }; } diff --git a/pkgs/os-specific/linux/iputils/open-max.patch b/pkgs/os-specific/linux/iputils/open-max.patch deleted file mode 100644 index 26bb95bd9d88..000000000000 --- a/pkgs/os-specific/linux/iputils/open-max.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- iputils-s20070202/rdisc.c.open-max 2007-08-07 11:34:03.000000000 +0200 -+++ iputils-s20070202/rdisc.c 2007-08-07 11:41:30.000000000 +0200 -@@ -240,14 +240,25 @@ - { - int t; - pid_t pid; -- -+ long open_max; -+ - if (trace) - return; - -+ if ((open_max = sysconf(_SC_OPEN_MAX)) == -1) { -+ if (errno == 0) { -+ (void) fprintf(stderr, "OPEN_MAX is not supported\n"); -+ } -+ else { -+ (void) fprintf(stderr, "sysconf() error\n"); -+ } -+ exit(1); -+ } -+ - if ((pid=fork()) != 0) - exit(0); - -- for (t = 0; t < OPEN_MAX; t++) -+ for (t = 0; t < open_max; t++) - if (t != s) - close(t); - diff --git a/pkgs/os-specific/linux/sysfsutils/default.nix b/pkgs/os-specific/linux/sysfsutils/default.nix index 0bb87eff3323..cecb65f50a2f 100644 --- a/pkgs/os-specific/linux/sysfsutils/default.nix +++ b/pkgs/os-specific/linux/sysfsutils/default.nix @@ -1,4 +1,5 @@ -{stdenv, fetchurl}: +{ stdenv, fetchurl }: + stdenv.mkDerivation rec { name = "sysfsutils-2.1.0"; @@ -9,11 +10,12 @@ stdenv.mkDerivation rec { meta = { homepage = http://linux-diag.sourceforge.net/Sysfsutils.html; - longDescription = " - These are a set of utilites built upon sysfs, a new virtual - filesystem in Linux kernel versions 2.5+ that exposes a system's - device tree. - "; + longDescription = + '' + These are a set of utilites built upon sysfs, a new virtual + filesystem in Linux kernel versions 2.5+ that exposes a system's + device tree. + ''; license = "GPL-v2 / LGPL-v2.1"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f4a0bf45f85e..adf0997896db 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4738,12 +4738,7 @@ let iproute = callPackage ../os-specific/linux/iproute { }; - iputils = ( - import ../os-specific/linux/iputils { - inherit fetchurl stdenv; - glibc = stdenv.gcc.libc; - linuxHeaders = stdenv.gcc.libc.kernelHeaders; - }); + iputils = callPackage ../os-specific/linux/iputils { }; iptables = callPackage ../os-specific/linux/iptables { };