git.iko.soy/typeable/nixpkgs
on master help sign in
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).

commitb7437eb012b6ec57c9151e48c1a95e5f7d12245f authorTuomas Tynkkynen <tuomas@tuxera.com> dateSat 14 May 2016, 21:05 (11 years ago) parent34f4515
2 files changed+35−41
pkgs/os-specific/linux/tcp-wrappers/builder.sh−39 pkgs/os-specific/linux/tcp-wrappers/default.nix+35−2
pkgs/os-specific/linux/tcp-wrappers/builder.shdeleted−39
@@ -1,39 +0,0 @@
1−source "$stdenv/setup" || exit 1
2−
3−# Unpack
4−unpackPhase
5−cd "$sourceRoot/upstream/tarballs"
6−tar xzvf *
7−cd tcp_wrappers_7.6
8−
9−# Patch
10−patchPhase
11−for patch in debian/patches/*
12−do
13− echo "applying Debian patch \`$(basename $patch)'..."
14− patch --batch -p1 < $patch
15−done
16−
17−substituteInPlace "Makefile" --replace \
18− "REAL_DAEMON_DIR=/usr/sbin" "REAL_DAEMON_DIR=$out/sbin" \
19− --replace "/tmp" '$$TMPDIR'
20−
21−echo "building..."
22−make REAL_DAEMON_DIR="$out/sbin" linux
23−
24−# Install
25−mkdir -p "$out/sbin"
26−cp -v safe_finger tcpd tcpdchk tcpdmatch try-from "$out/sbin"
27−
28−mkdir -p "$out/lib"
29−cp -v shared/lib*.so* "$out/lib"
30−
31−mkdir -p "$out/include"
32−cp -v *.h "$out/include"
33−
34−mkdir -p "$out/man"
35−for i in 3 5 8;
36−do
37− mkdir -p "$out/man/man$i"
38− cp *.$i "$out/man/man$i" ;
39−done
pkgs/os-specific/linux/tcp-wrappers/default.nix+35−2
@@ -15,7 +15,40 @@ stdenv.mkDerivation {
1515 })
1616 ];
1717
18− builder = ./builder.sh;
18+ prePatch = ''
19+ cd upstream/tarballs
20+ tar xzvf *
21+ cd tcp_wrappers_7.6
22+ '';
23+
24+ postPatch = ''
25+ for patch in debian/patches/*; do
26+ echo "applying Debian patch \`$(basename $patch)'..."
27+ patch --batch -p1 < $patch
28+ done
29+ '';
30+
31+ buildPhase = ''
32+ make REAL_DAEMON_DIR="$out/sbin" linux
33+ '';
34+
35+ installPhase = ''
36+ mkdir -p "$out/sbin"
37+ cp -v safe_finger tcpd tcpdchk tcpdmatch try-from "$out/sbin"
38+
39+ mkdir -p "$out/lib"
40+ cp -v shared/lib*.so* "$out/lib"
41+
42+ mkdir -p "$out/include"
43+ cp -v *.h "$out/include"
44+
45+ mkdir -p "$out/man"
46+ for i in 3 5 8;
47+ do
48+ mkdir -p "$out/man/man$i"
49+ cp *.$i "$out/man/man$i" ;
50+ done
51+ '';
1952
2053 meta = {
2154 description = "TCP Wrappers, a network logger, also known as TCPD or LOG_TCP";
@@ -32,7 +65,7 @@ stdenv.mkDerivation {
3265 '';
3366
3467 homepage = ftp://ftp.porcupine.org/pub/security/index.html;
35−
3668 license = "BSD-style";
69+ platforms = stdenv.lib.platforms.unix;
3770 };
3871}