diff mbox series

[meta-networking,1/2] dnsmasq: Merge .inc into .bb

Message ID 20230117225747.8663-1-alex.kiernan@gmail.com
State Under Review
Headers show
Series [meta-networking,1/2] dnsmasq: Merge .inc into .bb | expand

Commit Message

Alex Kiernan Jan. 17, 2023, 10:57 p.m. UTC
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 .../recipes-support/dnsmasq/dnsmasq.inc       | 87 ------------------
 .../recipes-support/dnsmasq/dnsmasq_2.88.bb   | 90 ++++++++++++++++++-
 2 files changed, 86 insertions(+), 91 deletions(-)
 delete mode 100644 meta-networking/recipes-support/dnsmasq/dnsmasq.inc
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq.inc b/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
deleted file mode 100644
index a8ff21a125c9..000000000000
--- a/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
+++ /dev/null
@@ -1,87 +0,0 @@ 
-SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server"
-HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html"
-SECTION = "net"
-# GPLv3 was added in version 2.41 as license option
-LICENSE = "GPL-2.0-only | GPL-3.0-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504 \
-                    "
-
-#at least versions 2.69 and prior are moved to the archive folder on the server
-SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \
-           file://init \
-           file://dnsmasq.conf \
-           file://dnsmasq-resolvconf.service \
-           file://dnsmasq-noresolvconf.service \
-           file://dnsmasq-resolved.conf \
-"
-
-inherit pkgconfig update-rc.d systemd
-
-INITSCRIPT_NAME = "dnsmasq"
-INITSCRIPT_PARAMS = "defaults"
-
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[dbus] = ",,dbus"
-PACKAGECONFIG[idn] = ",,libidn"
-PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack"
-PACKAGECONFIG[lua] = ",,lua"
-PACKAGECONFIG[resolvconf] = ",,,resolvconf"
-EXTRA_OEMAKE = "\
-    'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \
-           ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \
-    'CFLAGS=${CFLAGS}' \
-    'LDFLAGS=${LDFLAGS}' \
-"
-
-SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}"
-
-do_compile:append() {
-    # build dhcp_release
-    cd ${S}/contrib/lease-tools
-    oe_runmake
-}
-
-do_install () {
-    oe_runmake "PREFIX=${D}${prefix}" \
-               "BINDIR=${D}${bindir}" \
-               "MANDIR=${D}${mandir}" \
-               install
-    install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d
-    install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/
-    install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq
-
-    install -d ${D}${systemd_unitdir}/system
-
-    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
-        install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
-    else
-        install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
-    fi
-    install -d ${D}${sysconfdir}/systemd/resolved.conf.d/
-    install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/
-
-    install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
-
-    if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then
-        install -d ${D}${sysconfdir}/dbus-1/system.d
-        install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
-    fi
-    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
-        install -d ${D}${sysconfdir}/resolvconf/update.d/
-        install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq
-
-        install -d ${D}${sysconfdir}/default/volatiles
-        install -m 0644 ${WORKDIR}/99_dnsmasq ${D}${sysconfdir}/default/volatiles
-        install -m 0755 ${WORKDIR}/dnsmasq-resolvconf-helper ${D}${bindir}
-    fi
-}
-
-CONFFILES:${PN} = "${sysconfdir}/dnsmasq.conf"
-
-RPROVIDES:${PN} += "${PN}-systemd"
-RREPLACES:${PN} += "${PN}-systemd"
-RCONFLICTS:${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE:${PN} = "dnsmasq.service"
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
index 52ee9aa96eb6..43d48490a866 100644
--- a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
+++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.88.bb
@@ -1,7 +1,89 @@ 
-require dnsmasq.inc
+SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server"
+HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html"
+SECTION = "net"
+# GPLv3 was added in version 2.41 as license option
+LICENSE = "GPL-2.0-only | GPL-3.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504 \
+                    "
 
-SRC_URI[dnsmasq-2.88.sha256sum] = "da9d26aa3f3fc15f3b58b94edbb9ddf744cbce487194ea480bd8e7381b3ca028"
-SRC_URI += "\
-    file://lua.patch \
+#at least versions 2.69 and prior are moved to the archive folder on the server
+SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz \
+           file://lua.patch \
+           file://init \
+           file://dnsmasq.conf \
+           file://dnsmasq-resolvconf.service \
+           file://dnsmasq-noresolvconf.service \
+           file://dnsmasq-resolved.conf \
 "
+SRC_URI[sha256sum] = "da9d26aa3f3fc15f3b58b94edbb9ddf744cbce487194ea480bd8e7381b3ca028"
 
+inherit pkgconfig update-rc.d systemd
+
+INITSCRIPT_NAME = "dnsmasq"
+INITSCRIPT_PARAMS = "defaults"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[dbus] = ",,dbus"
+PACKAGECONFIG[idn] = ",,libidn"
+PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack"
+PACKAGECONFIG[lua] = ",,lua"
+PACKAGECONFIG[resolvconf] = ",,,resolvconf"
+EXTRA_OEMAKE = "\
+    'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \
+           ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \
+           ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \
+           ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \
+    'CFLAGS=${CFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}"
+
+do_compile:append() {
+    # build dhcp_release
+    cd ${S}/contrib/lease-tools
+    oe_runmake
+}
+
+do_install () {
+    oe_runmake "PREFIX=${D}${prefix}" \
+               "BINDIR=${D}${bindir}" \
+               "MANDIR=${D}${mandir}" \
+               install
+    install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d
+    install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/
+    install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq
+
+    install -d ${D}${systemd_unitdir}/system
+
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
+        install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
+    else
+        install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
+    fi
+    install -d ${D}${sysconfdir}/systemd/resolved.conf.d/
+    install -m 0644 ${WORKDIR}/dnsmasq-resolved.conf ${D}${sysconfdir}/systemd/resolved.conf.d/
+
+    install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
+
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then
+        install -d ${D}${sysconfdir}/dbus-1/system.d
+        install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
+    fi
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
+        install -d ${D}${sysconfdir}/resolvconf/update.d/
+        install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq
+
+        install -d ${D}${sysconfdir}/default/volatiles
+        install -m 0644 ${WORKDIR}/99_dnsmasq ${D}${sysconfdir}/default/volatiles
+        install -m 0755 ${WORKDIR}/dnsmasq-resolvconf-helper ${D}${bindir}
+    fi
+}
+
+CONFFILES:${PN} = "${sysconfdir}/dnsmasq.conf"
+
+RPROVIDES:${PN} += "${PN}-systemd"
+RREPLACES:${PN} += "${PN}-systemd"
+RCONFLICTS:${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE:${PN} = "dnsmasq.service"