diff mbox series

[meta-networking,14/21] radvd: Fix build on musl

Message ID 20220830071413.3887189-14-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/21] gtk+: Fix function signature of create_menu() | expand

Commit Message

Khem Raj Aug. 30, 2022, 7:14 a.m. UTC
Backport a patch from upstream to fix musl builds
Merged inc file into bb file, makes it easy to use devtool

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ude.h-change-in-46883f8a1a02fe42040d.patch | 32 +++++++++
 .../recipes-daemons/radvd/radvd.inc           | 67 ------------------
 .../recipes-daemons/radvd/radvd_2.19.bb       | 69 ++++++++++++++++++-
 3 files changed, 99 insertions(+), 69 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/radvd/files/0001-Reverts-the-include.h-change-in-46883f8a1a02fe42040d.patch
 delete mode 100644 meta-networking/recipes-daemons/radvd/radvd.inc
diff mbox series

Patch

diff --git a/meta-networking/recipes-daemons/radvd/files/0001-Reverts-the-include.h-change-in-46883f8a1a02fe42040d.patch b/meta-networking/recipes-daemons/radvd/files/0001-Reverts-the-include.h-change-in-46883f8a1a02fe42040d.patch
new file mode 100644
index 0000000000..57338d4713
--- /dev/null
+++ b/meta-networking/recipes-daemons/radvd/files/0001-Reverts-the-include.h-change-in-46883f8a1a02fe42040d.patch
@@ -0,0 +1,32 @@ 
+From 15f439c555289f900eb33111b010bf1266f97edb Mon Sep 17 00:00:00 2001
+From: Jonathan Davies <jpds@protonmail.com>
+Date: Thu, 25 Nov 2021 15:29:18 +0000
+Subject: [PATCH] Reverts the include.h change in
+ 46883f8a1a02fe42040dd8e48aec0ed871545d4d
+
+Closes: #158
+
+Upstream-Status: Backport [https://github.com/radvd-project/radvd/commit/06689f8c06f44c7e87f7ff1d814428f88375b53f]
+Signed-off-by: Jonathan Davies <jpds@protonmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ includes.h | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/includes.h b/includes.h
+index ef30b10..c528c86 100644
+--- a/includes.h
++++ b/includes.h
+@@ -76,12 +76,7 @@
+ #include <sys/sysctl.h>
+ #endif
+ 
+-#if !defined(__GLIBC__) && defined(linux)
+-#include <linux/if.h>
+-#define IF_NAMESIZE IFNAMSIZ
+-#else
+ #include <net/if.h>
+-#endif
+ 
+ #ifdef HAVE_NET_IF_DL_H
+ #include <net/if_dl.h>
diff --git a/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-networking/recipes-daemons/radvd/radvd.inc
deleted file mode 100644
index 2afaa48411..0000000000
--- a/meta-networking/recipes-daemons/radvd/radvd.inc
+++ /dev/null
@@ -1,67 +0,0 @@ 
-SUMMARY = "IPv6 router advertisement daemon"
-DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \
-listens to router solicitations and sends router \
-advertisements as described in RFC 2461, Neighbor \
-Discovery for IP Version 6 (IPv6). With these \
-advertisements hosts can automatically configure their \
-addresses and some other parameters. They also can \
-choose a default router based on these advertisements."
-HOMEPAGE = "http://www.litech.org/radvd/"
-SECTION = "net"
-DEPENDS = "flex-native bison-native libdaemon "
-
-# License is BSD-Style (with advertising clause) but also has an additional 0th clause
-LICENSE = "radvd"
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db"
-
-SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
-           file://radvd.init \
-           file://radvd.service \
-           file://volatiles.03_radvd \
-           file://radvd.default \
-           file://radvd.conf"
-
-inherit autotools useradd pkgconfig systemd
-
-SYSTEMD_SERVICE:${PN} = "radvd.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-do_install:append () {
-    install -m 0755 -d ${D}${sysconfdir}/init.d \
-                       ${D}${sysconfdir}/default/volatiles \
-                       ${D}${docdir}/radvd
-    # Install init script and volatiles
-    install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
-    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
-    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
-    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
-    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
-
-    install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/03_radvd
-
-    # Install systemd service files
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
-    sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
-           -e 's#@SBINDIR@#${sbindir}#g' \
-           -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
-
-    # Install default environment file
-    install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
-
-    # Documentation
-    for i in radvd.conf.example README; do \
-        install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
-    done
-
-    install -m 0644 ${WORKDIR}/radvd.conf ${D}${sysconfdir}/radvd.conf
-}
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
-
-pkg_postinst:${PN} () {
-    if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
-        /etc/init.d/populate-volatile.sh update
-    fi
-}
diff --git a/meta-networking/recipes-daemons/radvd/radvd_2.19.bb b/meta-networking/recipes-daemons/radvd/radvd_2.19.bb
index 553987e3d0..f9f810abdd 100644
--- a/meta-networking/recipes-daemons/radvd/radvd_2.19.bb
+++ b/meta-networking/recipes-daemons/radvd/radvd_2.19.bb
@@ -1,5 +1,70 @@ 
+SUMMARY = "IPv6 router advertisement daemon"
+DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \
+listens to router solicitations and sends router \
+advertisements as described in RFC 2461, Neighbor \
+Discovery for IP Version 6 (IPv6). With these \
+advertisements hosts can automatically configure their \
+addresses and some other parameters. They also can \
+choose a default router based on these advertisements."
+HOMEPAGE = "http://www.litech.org/radvd/"
+SECTION = "net"
+DEPENDS = "flex-native bison-native libdaemon "
 
-require radvd.inc
+# License is BSD-Style (with advertising clause) but also has an additional 0th clause
+LICENSE = "radvd"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db"
 
-SRC_URI[md5sum] = "e9c425ac48ecb96ea5ea2912c78969f9"
+SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
+           file://radvd.init \
+           file://radvd.service \
+           file://volatiles.03_radvd \
+           file://radvd.default \
+           file://radvd.conf \
+           file://0001-Reverts-the-include.h-change-in-46883f8a1a02fe42040d.patch \
+           "
 SRC_URI[sha256sum] = "c36470706fec3a9e6bed394ffea08acaff5dac647848d26b96bb9b9c65d58da0"
+
+inherit autotools useradd pkgconfig systemd
+
+SYSTEMD_SERVICE:${PN} = "radvd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install:append () {
+    install -m 0755 -d ${D}${sysconfdir}/init.d \
+                       ${D}${sysconfdir}/default/volatiles \
+                       ${D}${docdir}/radvd
+    # Install init script and volatiles
+    install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
+    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
+    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
+    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
+    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
+
+    install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/03_radvd
+
+    # Install systemd service files
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
+    sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
+           -e 's#@SBINDIR@#${sbindir}#g' \
+           -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
+
+    # Install default environment file
+    install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
+
+    # Documentation
+    for i in radvd.conf.example README; do \
+        install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
+    done
+
+    install -m 0644 ${WORKDIR}/radvd.conf ${D}${sysconfdir}/radvd.conf
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
+
+pkg_postinst:${PN} () {
+    if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
+        /etc/init.d/populate-volatile.sh update
+    fi
+}