diff --git a/pkgs/os-specific/linux/tcp-wrapper/builder.sh b/pkgs/os-specific/linux/tcp-wrapper/builder.sh new file mode 100644 index 000000000000..0f2b62185565 --- /dev/null +++ b/pkgs/os-specific/linux/tcp-wrapper/builder.sh @@ -0,0 +1,34 @@ +source "$stdenv/setup" || exit 1 + +# Unpack +unpackPhase && \ +cd "$sourceRoot/upstream/tarballs" && \ +tar xzvf * && \ +cd tcp_wrappers_7.6 && \ + \ +# Patch +substituteInPlace "Makefile" --replace \ + "REAL_DAEMON_DIR=/usr/sbin" "REAL_DAEMON_DIR=$out/sbin" \ + --replace "/tmp" '$$TMPDIR' && \ +substituteInPlace "scaffold.c" --replace \ + 'extern char *malloc();' " " && \ +substituteInPlace "environ.c" --replace \ + 'extern char *malloc();' " " && \ + \ +# The `linux' target doesn't work on Linux... +echo building... && \ +make REAL_DAEMON_DIR="$out/sbin" freebsd && \ + \ +# Install +ensureDir "$out/sbin" && \ +cp safe_finger tcpd tcpdchk tcpdmatch try-from "$out/sbin" && \ + \ +ensureDir "$out/lib" && \ +cp lib*.a "$out/lib" && \ + \ +ensureDir "$out/man" && \ +for i in 3 5 8; \ +do \ + ensureDir "$out/man/man$i" && \ + cp *.$i "$out/man/man$i" ; \ +done \ diff --git a/pkgs/os-specific/linux/tcp-wrapper/default.nix b/pkgs/os-specific/linux/tcp-wrapper/default.nix index 9c952bcabf83..d5984e649a5e 100644 --- a/pkgs/os-specific/linux/tcp-wrapper/default.nix +++ b/pkgs/os-specific/linux/tcp-wrapper/default.nix @@ -1,26 +1,14 @@ -args: with args; +{ fetchurl, stdenv }: + stdenv.mkDerivation { name = "tcp-wrappers-7.6"; src = fetchurl { - url = http://ftp.debian.org/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.dbs.orig.tar.gz; + url = mirror://debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.dbs.orig.tar.gz; sha256 = "0k68ziinx6biwar5lcb9jvv0rp6b3vmj6861n75bvrz4w1piwkdp"; }; - # we need to set REAL_DAEMON_DIR somehow. I'm getting compilation errors - # I've managed to compile tcpd manually using - # make CFLAGS='-DSYS_ERRLIST_DEFINED=1 -Dvsyslog=1' tcpd - # see Makefile target all for details - - postUnpack="cd upstream/tarballs; tar xfz *; cd tcp_wrappers_7.6; - sed -i -e 's=#REAL_DAEMON_DIR=/usr/sbin=REAL_DAEMON_DIR=/usr/sbin=' Makefile - "; - - buildPhase=" - make CFLAGS='-DSYS_ERRLIST_DEFINED=1 -Dvsyslog=1' tcpd - " - - buildInputs = [kernelHeaders gnused]; + builder = ./builder.sh; # meta = ... } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b75825b839a..19adb2111355 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4372,12 +4372,10 @@ rec { withoutInitTools = true; }; - /* - # needed for nfs utils - tcp_wrapper = import ../os-specific/linux/tcp-wrapper { - inherit fetchurl stdenv kernelHeaders gnused; + # FIXME: `tcp-wrapper' is actually not OS-specific. + tcpWrapper = import ../os-specific/linux/tcp-wrapper { + inherit fetchurl stdenv; }; - */ udev = import ../os-specific/linux/udev { inherit fetchurl stdenv;