Add `tcp-wrapper'.

svn path=/nixpkgs/trunk/; revision=11136
This commit is contained in:
Ludovic Courtès 2008-03-15 22:41:31 +00:00
parent 8a72053717
commit ac2f2f6cc5
3 changed files with 41 additions and 21 deletions

View File

@ -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 \

View File

@ -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 = ...
}

View File

@ -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;