diff options
-rw-r--r-- | meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb | 75 |
1 files changed, 58 insertions, 17 deletions
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb index 43d48490a8..4bf1dd8954 100644 --- a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb | |||
@@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | |||
7 | file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504 \ | 7 | file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504 \ |
8 | " | 8 | " |
9 | 9 | ||
10 | DEPENDS += "gettext-native" | ||
11 | |||
10 | #at least versions 2.69 and prior are moved to the archive folder on the server | 12 | #at least versions 2.69 and prior are moved to the archive folder on the server |
11 | SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz \ | 13 | SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz \ |
12 | file://lua.patch \ | 14 | file://lua.patch \ |
@@ -23,34 +25,62 @@ inherit pkgconfig update-rc.d systemd | |||
23 | INITSCRIPT_NAME = "dnsmasq" | 25 | INITSCRIPT_NAME = "dnsmasq" |
24 | INITSCRIPT_PARAMS = "defaults" | 26 | INITSCRIPT_PARAMS = "defaults" |
25 | 27 | ||
26 | PACKAGECONFIG ?= "" | 28 | # dnsmasq defaults |
27 | PACKAGECONFIG[dbus] = ",,dbus" | 29 | PACKAGECONFIG ?= "auth dhcp dhcp6 dumpfile inotify ipset loop script tftp" |
28 | PACKAGECONFIG[idn] = ",,libidn" | 30 | |
29 | PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack" | 31 | PACKAGECONFIG[auth] = "-DHAVE_AUTH,-DNO_AUTH" |
30 | PACKAGECONFIG[lua] = ",,lua" | 32 | PACKAGECONFIG[broken-rtc] = "-DHAVE_BROKEN_RTC," |
33 | PACKAGECONFIG[conntrack] = "-DHAVE_CONNTRACK,,libnetfilter-conntrack" | ||
34 | PACKAGECONFIG[dbus] = "-DHAVE_DBUS,,dbus" | ||
35 | PACKAGECONFIG[dhcp] = "-DHAVE_DHCP,-DNO_DHCP" | ||
36 | PACKAGECONFIG[dhcp6] = "-DHAVE_DHCP6,-DNO_DHCP6" | ||
37 | PACKAGECONFIG[dnssec] = "-DHAVE_DNSSEC,,nettle" | ||
38 | PACKAGECONFIG[dumpfile] = "-DHAVE_DUMPFILE,-DNO_DUMPFILE" | ||
39 | PACKAGECONFIG[idn] = "-DHAVE_LIBIDN,,libidn,,,idn2" | ||
40 | PACKAGECONFIG[idn2] = "-DHAVE_LIBIDN2,,libidn2,,,idn" | ||
41 | PACKAGECONFIG[inotify] = "-DHAVE_INOTIFY,-DNO_INOTIFY" | ||
42 | PACKAGECONFIG[ipset] = "-DHAVE_IPSET,-DNO_IPSET" | ||
43 | PACKAGECONFIG[loop] = "-DHAVE_LOOP,-DNO_LOOP" | ||
44 | PACKAGECONFIG[lua] = "-DHAVE_LUASCRIPT -DHAVE_SCRIPT,,lua" | ||
45 | PACKAGECONFIG[nftset] = "-DHAVE_NFTSET,,nftables" | ||
46 | PACKAGECONFIG[no-gmp] = "-DNO_GMP," | ||
47 | PACKAGECONFIG[no-id] = "-DNO_ID," | ||
31 | PACKAGECONFIG[resolvconf] = ",,,resolvconf" | 48 | PACKAGECONFIG[resolvconf] = ",,,resolvconf" |
49 | PACKAGECONFIG[script] = "-DHAVE_SCRIPT,-DNO_SCRIPT" | ||
50 | PACKAGECONFIG[tftp] = "-DHAVE_TFTP,-DNO_TFTP" | ||
51 | PACKAGECONFIG[ubus] = "-DHAVE_UBUS,,ubus" | ||
52 | |||
53 | DNSMASQ_LEASEFILE ?= "${localstatedir}/lib/misc/dnsmasq.leases" | ||
54 | DNSMASQ_CONFFILE ?= "${sysconfdir}/dnsmasq.conf" | ||
55 | DNSMASQ_RESOLVFILE ?= "${sysconfdir}/resolv.conf" | ||
56 | |||
57 | COPTS = "${PACKAGECONFIG_CONFARGS} \ | ||
58 | -DLEASEFILE=\"${DNSMASQ_LEASEFILE}\" \ | ||
59 | -DCONFFILE=\"${DNSMASQ_CONFFILE}\" \ | ||
60 | -DRESOLVFILE=\"${DNSMASQ_RESOLVFILE}\" \ | ||
61 | -DLOCALEDIR=\"${localedir}\"" | ||
62 | |||
32 | EXTRA_OEMAKE = "\ | 63 | EXTRA_OEMAKE = "\ |
33 | 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \ | 64 | 'COPTS=${COPTS}' \ |
34 | ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \ | ||
35 | ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \ | ||
36 | ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \ | ||
37 | 'CFLAGS=${CFLAGS}' \ | 65 | 'CFLAGS=${CFLAGS}' \ |
38 | 'LDFLAGS=${LDFLAGS}' \ | 66 | 'LDFLAGS=${LDFLAGS}' \ |
39 | " | 67 | " |
40 | 68 | ||
41 | SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}" | 69 | SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}" |
42 | 70 | ||
43 | do_compile:append() { | 71 | do_compile () { |
44 | # build dhcp_release | 72 | oe_runmake all-i18n |
45 | cd ${S}/contrib/lease-tools | 73 | if ${@bb.utils.contains_any('PACKAGECONFIG', ['dhcp', 'dhcp6'], 'true', 'false', d)}; then |
46 | oe_runmake | 74 | # build dhcp_release |
75 | oe_runmake -C ${S}/contrib/lease-tools | ||
76 | fi | ||
47 | } | 77 | } |
48 | 78 | ||
49 | do_install () { | 79 | do_install () { |
50 | oe_runmake "PREFIX=${D}${prefix}" \ | 80 | oe_runmake "PREFIX=${D}${prefix}" \ |
51 | "BINDIR=${D}${bindir}" \ | 81 | "BINDIR=${D}${bindir}" \ |
52 | "MANDIR=${D}${mandir}" \ | 82 | "MANDIR=${D}${mandir}" \ |
53 | install | 83 | install-i18n |
54 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d | 84 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d |
55 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ | 85 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ |
56 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq | 86 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq |
@@ -62,15 +92,26 @@ do_install () { | |||
62 | else | 92 | else |
63 | install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service | 93 | install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service |
64 | fi | 94 | fi |
65 | install -d ${D}${sysconfdir}/systemd/resolved.conf.d/ | ||
66 | install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/ | ||
67 | 95 | ||
68 | install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir} | 96 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then |
97 | install -d ${D}${sysconfdir}/systemd/resolved.conf.d/ | ||
98 | install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/ | ||
99 | fi | ||
100 | |||
101 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dhcp', d)}" ]; then | ||
102 | install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir} | ||
103 | install -m 0755 ${S}/contrib/lease-tools/dhcp_lease_time ${D}${bindir} | ||
104 | fi | ||
105 | |||
106 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dhcp6', d)}" ]; then | ||
107 | install -m 0755 ${S}/contrib/lease-tools/dhcp_release6 ${D}${bindir} | ||
108 | fi | ||
69 | 109 | ||
70 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then | 110 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then |
71 | install -d ${D}${sysconfdir}/dbus-1/system.d | 111 | install -d ${D}${sysconfdir}/dbus-1/system.d |
72 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ | 112 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ |
73 | fi | 113 | fi |
114 | |||
74 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then | 115 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then |
75 | install -d ${D}${sysconfdir}/resolvconf/update.d/ | 116 | install -d ${D}${sysconfdir}/resolvconf/update.d/ |
76 | install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq | 117 | install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq |