summaryrefslogtreecommitdiff
path: root/repo/dhcp/dhcp.xibuild
blob: 9ebe2927f809be0ab1bfa6b13154bc59344be358 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh

MAKEDEPS="bash iproute2 libldap"
DEPS="musl libldap"

PKG_VER=4.4.3b1
SOURCE=https://ftp.isc.org/isc/dhcp/$PKG_VER/dhcp-$PKG_VER.tar.gz

ADDITIONAL="
01-dhclient-script-fix-bare-ip.patch
02-dhclient-script-remove-bashisms.patch
03-fix-unwind-import.patch
dhcpd.confd
dhcpd.initd
"

DESC="A DHCP server, client and relay"

package () {
    apply_patches
    
    sed -i '/o.*dhcp_type/d' server/mdb.c &&
    sed -r '/u.*(local|remote)_port/d'    \
        -i client/dhclient.c              \
           relay/dhcrelay.c
}


build () {
    # fix ipv6

    export CFLAGS="$CFLAGS -D_GNU_SOURCE \
    -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'"

	./configure \
		--prefix=/usr \
		--sysconfdir=/etc/dhcp \
		--localstatedir=/var \
		--with-srv-conf-file=/etc/dhcp/dhcpd.conf \
		--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
		--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
		--with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
		--with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \
		--with-srv-pid-file=/run/dhcp/dhcpd.pid \
		--with-srv6-pid-file=/run/dhcp/dhcpd6.pid \
		--with-cli-pid-file=/run/dhcp/dhclient.pid \
		--with-cli6-pid-file=/run/dhcp/dhclient6.pid \
		--with-relay-pid-file=/run/dhcp/dhcrelay.pid \
		--with-relay6-pid-file=/run/dhcp/dhcrelay6.pid \
		--with-libbind=no \
		--enable-dhcpv4o6 \
		--enable-paranoia \
		--enable-log-pid \

    make -j1 -C bind && make
}

package () {
    make DESTDIR=$PKG_DEST install

    install -d $PKG_DEST/var/lib/dhcp
	install -d $PKG_DEST/run/dhcp


	install -m755 -D dhcpd.initd $PKG_DEST/etc/init.d/dhcpd
	install -m644 -D dhcpd.confd $PKG_DEST/etc/conf.d/dhcpd

}