blob: b178180ec80f6f9e71f28cef0d528033e8431621 [file] [log] [blame]
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07001SECTION = "console/network"
2SUMMARY = "Internet Software Consortium DHCP Relay Agent"
3DESCRIPTION = "A DHCP relay agent passes DHCP requests from one \
4LAN to another, so that a DHCP server is not needed on every LAN."
5
6HOMEPAGE = "http://www.isc.org/"
7
8LICENSE = "ISC"
9LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=004a4db50a1e20972e924a8618747c01"
10
11DEPENDS = "openssl libcap zlib"
12
13SRC_URI = "https://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
14 file://default-relay \
15 file://init-relay \
16 file://dhcrelay.service \
17 file://0001-Makefile.am-only-build-dhcrelay.patch \
18 "
19
20SRC_URI[md5sum] = "2afdaf8498dc1edaf3012efdd589b3e1"
21SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521"
22
23UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
24UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
25
26S = "${WORKDIR}/dhcp-${PV}"
27
28inherit autotools-brokensep systemd
29
30SYSTEMD_SERVICE_${PN} = "dhcrelay.service"
31SYSTEMD_AUTO_ENABLE_${PN} = "disable"
32
33CFLAGS += "-D_GNU_SOURCE -fcommon"
34LDFLAGS_append = " -pthread"
35
36EXTRA_OECONF = "--enable-paranoia \
37 --disable-static \
38 --enable-libtool \
39 --with-randomdev=/dev/random \
40 "
41EXTRA_OEMAKE += "LIBTOOL='${S}/${HOST_SYS}-libtool'"
42
43# Enable shared libs per dhcp README
44do_configure_prepend () {
45 cp configure.ac+lt configure.ac
46}
47do_compile_prepend() {
48 rm -rf ${S}/bind/bind-9.11.14/
49 tar xf ${S}/bind/bind.tar.gz -C ${S}/bind
50 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/bind/bind-9.11.14/
51 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/bind/bind-9.11.14/
52 cp -fpR ${S}/m4/*.m4 ${S}/bind/bind-9.11.14/libtool.m4/
53 rm -rf ${S}/bind/bind-9.11.14/libtool
54 install -m 0755 ${S}/${HOST_SYS}-libtool ${S}/bind/bind-9.11.14/
55}
56
57do_install_append () {
58 install -d ${D}${sysconfdir}/default
59 install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
60
61 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
62 install -d ${D}${systemd_unitdir}/system
63 install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
64 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
65 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
66 else
67 install -d ${D}${sysconfdir}/init.d
68 install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
69 fi
70}
71
72PARALLEL_MAKE = ""