William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 1 | SECTION = "console/network" |
| 2 | SUMMARY = "Internet Software Consortium DHCP Relay Agent" |
| 3 | DESCRIPTION = "A DHCP relay agent passes DHCP requests from one \ |
| 4 | LAN to another, so that a DHCP server is not needed on every LAN." |
| 5 | |
| 6 | HOMEPAGE = "http://www.isc.org/" |
| 7 | |
| 8 | LICENSE = "ISC" |
| 9 | LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=004a4db50a1e20972e924a8618747c01" |
| 10 | |
| 11 | DEPENDS = "openssl libcap zlib" |
| 12 | |
| 13 | SRC_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 | |
| 20 | SRC_URI[md5sum] = "2afdaf8498dc1edaf3012efdd589b3e1" |
| 21 | SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" |
| 22 | |
| 23 | UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/" |
| 24 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/" |
| 25 | |
| 26 | S = "${WORKDIR}/dhcp-${PV}" |
| 27 | |
| 28 | inherit autotools-brokensep systemd |
| 29 | |
| 30 | SYSTEMD_SERVICE_${PN} = "dhcrelay.service" |
| 31 | SYSTEMD_AUTO_ENABLE_${PN} = "disable" |
| 32 | |
| 33 | CFLAGS += "-D_GNU_SOURCE -fcommon" |
| 34 | LDFLAGS_append = " -pthread" |
| 35 | |
| 36 | EXTRA_OECONF = "--enable-paranoia \ |
| 37 | --disable-static \ |
| 38 | --enable-libtool \ |
| 39 | --with-randomdev=/dev/random \ |
| 40 | " |
| 41 | EXTRA_OEMAKE += "LIBTOOL='${S}/${HOST_SYS}-libtool'" |
| 42 | |
| 43 | # Enable shared libs per dhcp README |
| 44 | do_configure_prepend () { |
| 45 | cp configure.ac+lt configure.ac |
| 46 | } |
| 47 | do_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 | |
| 57 | do_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 | |
| 72 | PARALLEL_MAKE = "" |