summary refs log tree commit diff
path: root/pkgs/os-specific/linux/tcp-wrappers
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-05-14 21:05:58 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-05-14 21:05:58 +0300
commitb7437eb012b6ec57c9151e48c1a95e5f7d12245f (patch)
tree4f21321e41324cddad94e9e871ca3be5a2d7190c /pkgs/os-specific/linux/tcp-wrappers
parent34f451505163e4eb4ed0a68592e64c219fa24554 (diff)
downloadnixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar.gz
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar.bz2
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar.lz
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar.xz
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.tar.zst
nixpkgs-b7437eb012b6ec57c9151e48c1a95e5f7d12245f.zip
tcp_wrappers: Remove separate builder.sh and use standard stdenv phases
For instance, this means that the binaries get stripped properly
(previously this package retained a reference to glibc headers).
Diffstat (limited to 'pkgs/os-specific/linux/tcp-wrappers')
-rw-r--r--pkgs/os-specific/linux/tcp-wrappers/builder.sh39
-rw-r--r--pkgs/os-specific/linux/tcp-wrappers/default.nix37
2 files changed, 35 insertions, 41 deletions
diff --git a/pkgs/os-specific/linux/tcp-wrappers/builder.sh b/pkgs/os-specific/linux/tcp-wrappers/builder.sh
deleted file mode 100644
index 7ea574fcf23..00000000000
--- a/pkgs/os-specific/linux/tcp-wrappers/builder.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-source "$stdenv/setup" || exit 1
-
-# Unpack
-unpackPhase
-cd "$sourceRoot/upstream/tarballs"
-tar xzvf *
-cd tcp_wrappers_7.6
-
-# Patch
-patchPhase
-for patch in debian/patches/*
-do
-  echo "applying Debian patch \`$(basename $patch)'..."
-  patch --batch -p1 < $patch
-done
-
-substituteInPlace "Makefile" --replace				\
-   "REAL_DAEMON_DIR=/usr/sbin" "REAL_DAEMON_DIR=$out/sbin"	\
-   --replace "/tmp" '$$TMPDIR'
-
-echo "building..."
-make REAL_DAEMON_DIR="$out/sbin" linux
-
-# Install
-mkdir -p "$out/sbin"
-cp -v safe_finger tcpd tcpdchk tcpdmatch try-from "$out/sbin"
-
-mkdir -p "$out/lib"
-cp -v shared/lib*.so* "$out/lib"
-
-mkdir -p "$out/include"
-cp -v *.h "$out/include"
-
-mkdir -p "$out/man"
-for i in 3 5 8;
-do
-  mkdir -p "$out/man/man$i"
-  cp *.$i "$out/man/man$i" ;
-done
diff --git a/pkgs/os-specific/linux/tcp-wrappers/default.nix b/pkgs/os-specific/linux/tcp-wrappers/default.nix
index a3f79cd05a8..eb50fc0abce 100644
--- a/pkgs/os-specific/linux/tcp-wrappers/default.nix
+++ b/pkgs/os-specific/linux/tcp-wrappers/default.nix
@@ -15,7 +15,40 @@ stdenv.mkDerivation {
      })
   ];
 
-  builder = ./builder.sh;
+  prePatch = ''
+    cd upstream/tarballs
+    tar xzvf *
+    cd tcp_wrappers_7.6
+  '';
+
+  postPatch = ''
+    for patch in debian/patches/*; do
+      echo "applying Debian patch \`$(basename $patch)'..."
+      patch --batch -p1 < $patch
+    done
+  '';
+
+  buildPhase = ''
+    make REAL_DAEMON_DIR="$out/sbin" linux
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/sbin"
+    cp -v safe_finger tcpd tcpdchk tcpdmatch try-from "$out/sbin"
+
+    mkdir -p "$out/lib"
+    cp -v shared/lib*.so* "$out/lib"
+
+    mkdir -p "$out/include"
+    cp -v *.h "$out/include"
+
+    mkdir -p "$out/man"
+    for i in 3 5 8;
+    do
+      mkdir -p "$out/man/man$i"
+      cp *.$i "$out/man/man$i" ;
+    done
+  '';
 
   meta = {
     description = "TCP Wrappers, a network logger, also known as TCPD or LOG_TCP";
@@ -32,7 +65,7 @@ stdenv.mkDerivation {
     '';
 
     homepage = ftp://ftp.porcupine.org/pub/security/index.html;
-
     license = "BSD-style";
+    platforms = stdenv.lib.platforms.unix;
   };
 }