Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server" |
| 2 | HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html" |
| 3 | SECTION = "net" |
| 4 | # GPLv3 was added in version 2.41 as license option |
| 5 | LICENSE = "GPLv2 | GPLv3" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ |
| 7 | file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504" |
| 8 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 9 | #at least versions 2.69 and prior are moved to the archive folder on the server |
| 10 | SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 11 | file://init \ |
| 12 | file://dnsmasq.conf \ |
| 13 | file://dnsmasq-resolvconf.service \ |
| 14 | file://dnsmasq-noresolvconf.service \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 15 | file://dnsmasq-resolved.conf \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 16 | " |
| 17 | |
| 18 | inherit pkgconfig update-rc.d systemd |
| 19 | |
| 20 | INITSCRIPT_NAME = "dnsmasq" |
| 21 | INITSCRIPT_PARAMS = "defaults" |
| 22 | |
| 23 | PACKAGECONFIG ?= "" |
| 24 | PACKAGECONFIG[dbus] = ",,dbus" |
| 25 | PACKAGECONFIG[idn] = ",,libidn" |
| 26 | PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack" |
| 27 | PACKAGECONFIG[lua] = ",,lua" |
| 28 | PACKAGECONFIG[resolvconf] = ",,,resolvconf" |
| 29 | EXTRA_OEMAKE = "\ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 30 | 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \ |
| 31 | ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \ |
| 32 | ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \ |
| 33 | ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 34 | 'CFLAGS=${CFLAGS}' \ |
| 35 | 'LDFLAGS=${LDFLAGS}' \ |
| 36 | " |
| 37 | |
| 38 | SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}" |
| 39 | |
| 40 | do_compile_append() { |
| 41 | # build dhcp_release |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 42 | cd ${S}/contrib/lease-tools |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 43 | oe_runmake |
| 44 | } |
| 45 | |
| 46 | do_install () { |
| 47 | oe_runmake "PREFIX=${D}${prefix}" \ |
| 48 | "BINDIR=${D}${bindir}" \ |
| 49 | "MANDIR=${D}${mandir}" \ |
| 50 | install |
| 51 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d |
| 52 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ |
| 53 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq |
| 54 | |
| 55 | install -d ${D}${systemd_unitdir}/system |
| 56 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 58 | install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service |
| 59 | else |
| 60 | install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service |
| 61 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 62 | install -d ${D}${sysconfdir}/systemd/resolved.conf.d/ |
| 63 | install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 64 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 65 | install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir} |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 66 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 67 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 68 | install -d ${D}${sysconfdir}/dbus-1/system.d |
| 69 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ |
| 70 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 71 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 72 | install -d ${D}${sysconfdir}/resolvconf/update.d/ |
| 73 | install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq |
| 74 | |
| 75 | install -d ${D}${sysconfdir}/default/volatiles |
| 76 | install -m 0644 ${WORKDIR}/99_dnsmasq ${D}${sysconfdir}/default/volatiles |
| 77 | install -m 0755 ${WORKDIR}/dnsmasq-resolvconf-helper ${D}${bindir} |
| 78 | fi |
| 79 | } |
| 80 | |
| 81 | CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf" |
| 82 | |
| 83 | RPROVIDES_${PN} += "${PN}-systemd" |
| 84 | RREPLACES_${PN} += "${PN}-systemd" |
| 85 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 86 | SYSTEMD_SERVICE_${PN} = "dnsmasq.service" |