blob: 93364758e32544efd2082a98e46ff57342aeda40 [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
Andrew Geissler69721092021-07-23 12:57:00 -040013SRC_URI = "https://ftp.isc.org/isc/dhcp/4.4.2-P1/dhcp-4.4.2-P1.tar.gz \
14 https://ftp.isc.org/isc/bind9/9.11.32/bind-9.11.32.tar.gz;name=bind;downloadfilename=bind.tar.gz;unpack=0 \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070015 file://default-relay \
16 file://init-relay \
17 file://dhcrelay.service \
18 file://0001-Makefile.am-only-build-dhcrelay.patch \
Andrew Geissler69721092021-07-23 12:57:00 -040019 file://0002-bind-version-update-to-latest-version.patch \
20 file://0003-bind-Makefile.in-disable-backtrace.patch \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070021 "
22
Andrew Geissler69721092021-07-23 12:57:00 -040023SRC_URI[md5sum] = "3089a1ebd20a802ec0870ae337d43907"
24SRC_URI[sha256sum] = "b05e04337539545a8faa0d6ac518defc61a07e5aec66a857f455e7f218c85a1a"
25SRC_URI[bind.md5sum] = "0d029dd06ca60c6739c3189c999ef757"
26SRC_URI[bind.sha256sum] = "cbf8cb4b74dd1452d97c3a2a8c625ea346df8516b4b3508ef07443121a591342"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070027
28UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
29UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
30
Andrew Geissler69721092021-07-23 12:57:00 -040031S = "${WORKDIR}/dhcp-4.4.2-P1"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032
33inherit autotools-brokensep systemd
34
Patrick Williams213cb262021-08-07 19:21:33 -050035SYSTEMD_SERVICE:${PN} = "dhcrelay.service"
36SYSTEMD_AUTO_ENABLE:${PN} = "disable"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070037
38CFLAGS += "-D_GNU_SOURCE -fcommon"
Patrick Williams213cb262021-08-07 19:21:33 -050039LDFLAGS:append = " -pthread"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070040
41EXTRA_OECONF = "--enable-paranoia \
42 --disable-static \
43 --enable-libtool \
44 --with-randomdev=/dev/random \
45 "
46EXTRA_OEMAKE += "LIBTOOL='${S}/${HOST_SYS}-libtool'"
47
48# Enable shared libs per dhcp README
Patrick Williams213cb262021-08-07 19:21:33 -050049do_configure:prepend () {
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070050 cp configure.ac+lt configure.ac
Andrew Geissler69721092021-07-23 12:57:00 -040051 rm ${S}/bind/bind.tar.gz
52 mv ${WORKDIR}/bind.tar.gz ${S}/bind/
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070053}
Andrew Geissler69721092021-07-23 12:57:00 -040054
Patrick Williams213cb262021-08-07 19:21:33 -050055do_compile:prepend() {
Andrew Geissler69721092021-07-23 12:57:00 -040056 rm -rf ${S}/bind/bind-9.11.32/
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070057 tar xf ${S}/bind/bind.tar.gz -C ${S}/bind
Andrew Geissler69721092021-07-23 12:57:00 -040058 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/bind/bind-9.11.32/
59 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/bind/bind-9.11.32/
60 cp -fpR ${S}/m4/*.m4 ${S}/bind/bind-9.11.32/libtool.m4/
61 rm -rf ${S}/bind/bind-9.11.32/libtool
62 install -m 0755 ${S}/${HOST_SYS}-libtool ${S}/bind/bind-9.11.32/
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070063}
64
Patrick Williams213cb262021-08-07 19:21:33 -050065do_install:append () {
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070066 install -d ${D}${sysconfdir}/default
67 install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
68
69 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
70 install -d ${D}${systemd_unitdir}/system
71 install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
72 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
73 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
74 else
75 install -d ${D}${sysconfdir}/init.d
76 install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
77 fi
78}
79
80PARALLEL_MAKE = ""