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 \ |
| 15 | " |
| 16 | |
| 17 | inherit pkgconfig update-rc.d systemd |
| 18 | |
| 19 | INITSCRIPT_NAME = "dnsmasq" |
| 20 | INITSCRIPT_PARAMS = "defaults" |
| 21 | |
| 22 | PACKAGECONFIG ?= "" |
| 23 | PACKAGECONFIG[dbus] = ",,dbus" |
| 24 | PACKAGECONFIG[idn] = ",,libidn" |
| 25 | PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack" |
| 26 | PACKAGECONFIG[lua] = ",,lua" |
| 27 | PACKAGECONFIG[resolvconf] = ",,,resolvconf" |
| 28 | EXTRA_OEMAKE = "\ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 29 | 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \ |
| 30 | ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \ |
| 31 | ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \ |
| 32 | ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 33 | 'CFLAGS=${CFLAGS}' \ |
| 34 | 'LDFLAGS=${LDFLAGS}' \ |
| 35 | " |
| 36 | |
| 37 | SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}" |
| 38 | |
| 39 | do_compile_append() { |
| 40 | # build dhcp_release |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 41 | cd ${S}/contrib/lease-tools |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 42 | oe_runmake |
| 43 | } |
| 44 | |
| 45 | do_install () { |
| 46 | oe_runmake "PREFIX=${D}${prefix}" \ |
| 47 | "BINDIR=${D}${bindir}" \ |
| 48 | "MANDIR=${D}${mandir}" \ |
| 49 | install |
| 50 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d |
| 51 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ |
| 52 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq |
| 53 | |
| 54 | install -d ${D}${systemd_unitdir}/system |
| 55 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 56 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 57 | install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service |
| 58 | else |
| 59 | install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service |
| 60 | fi |
| 61 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 62 | install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir} |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 63 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 64 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 65 | install -d ${D}${sysconfdir}/dbus-1/system.d |
| 66 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ |
| 67 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 68 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 69 | install -d ${D}${sysconfdir}/resolvconf/update.d/ |
| 70 | install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq |
| 71 | |
| 72 | install -d ${D}${sysconfdir}/default/volatiles |
| 73 | install -m 0644 ${WORKDIR}/99_dnsmasq ${D}${sysconfdir}/default/volatiles |
| 74 | install -m 0755 ${WORKDIR}/dnsmasq-resolvconf-helper ${D}${bindir} |
| 75 | fi |
| 76 | } |
| 77 | |
| 78 | CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf" |
| 79 | |
| 80 | RPROVIDES_${PN} += "${PN}-systemd" |
| 81 | RREPLACES_${PN} += "${PN}-systemd" |
| 82 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 83 | SYSTEMD_SERVICE_${PN} = "dnsmasq.service" |