summary refs log tree commit diff
path: root/pkgs/tools/networking/dhcp/builder.sh
blob: 645d932640654ffd82ff3e7fda4fb379279f59a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
source $stdenv/setup

# Hack to prevent dhclient from overriding the PATH specified with
# '-e' on the command-line.
makeFlagsArray=(CLIENT_PATH='\"FAKE_PATH=/nothing\"' \
    USERBINDIR=$out/bin BINDIR=$out/sbin CLIENTBINDIR=$out/sbin \
    ADMMANDIR=$out/share/man/man8 FFMANDIR=$out/share/man/man5 \
    LIBMANDIR=$out/share/man/man3 USRMANDIR=$out/share/man/man1 \
    LIBDIR=$out/lib INCDIR=$out/include VARDB=$OUT/var/run \
)

configurePhase=configurePhase
configurePhase() {
    # Patch the header that contains absolute paths to the tools.
    sed -i "includes/dhcpd.h" \
	-"es|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g"

    ./configure
}

preBuild=preBuild
preBuild() {
    substituteInPlace client/scripts/linux --replace /bin/bash $shell
}

genericBuild