diff options
Diffstat (limited to 'meta-networking/recipes-protocols/freediameter')
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch | 97 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch | 92 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/files/freediameter.service | 2 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch | 72 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/files/run-ptest | 7 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/freediameter/freediameter_1.5.0.bb (renamed from meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb) | 50 |
6 files changed, 124 insertions, 196 deletions
diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch b/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch deleted file mode 100644 index d5e242ac21..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch +++ /dev/null @@ -1,97 +0,0 @@ -From d527a0b7b63e43263384540b5525714484bb089f Mon Sep 17 00:00:00 2001 -From: Mingli Yu <Mingli.Yu@windriver.com> -Date: Mon, 3 Sep 2018 14:40:56 +0800 -Subject: [PATCH] libfdcore/sctp.c: update the old sctp api check - -The initial sctp api check for freediameter as below: - === - commit d3c5e991cb532ea09684d69fb4d0d58e9bc39a0c - Author: Sebastien Decugis <sdecugis@freediameter.net> - Date: Mon Jun 3 12:05:37 2013 +0800 - - Add some compliancy to RFC6458. Not tested however as Ubuntu does not support this yet - - [snip] - +/* Use old draft-ietf-tsvwg-sctpsocket-17 API ? If not defined, RFC6458 API will be used */ - +/* #define OLD_SCTP_SOCKET_API */ - + - +/* Automatically fallback to old API if some of the new symbols are not defined */ - +#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) - +# define OLD_SCTP_SOCKET_API - +#endif - === - -SCTP_RECVRCVINFO is defined in <linux/sctp.h>, -but <linux/sctp.h> is't included in the source code -previouly. So defined(SCTP_RECVRCVINFO) can be 0 -and it make old sctp socket api definiton in effect -as below: - # define OLD_SCTP_SOCKET_API - -After lksctp-tools upgrade to 1.0.18, there is below -commit introduced: -=== -commit 3c8bd0d26b64611c690f33f5802c734b0642c1d8 -Author: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> -Date: Tue Apr 17 20:17:14 2018 -0300 - - sctp.h: make use kernel UAPI header - - and with that, remove tons of duplicated declarations. These were - lagging behind the kernel header, which is always the most updated one, - and as the library is intended to be run only on Linux, there is no - reason that we cannot re-use what is in there. - - That said, this patch drops all duplicated declarations and includes - linux/sctp.h to bring them into lksctp-tools. - - Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - - [snip] - #include <stdint.h> - #include <linux/types.h> - #include <sys/socket.h> -+#include <linux/sctp.h> - [snip] -=== - -And above logic make defined(SCTP_RECVRCVINFO) to -be 1 and the old sctp socket api macro as below -won't be defined. - # define OLD_SCTP_SOCKET_API - -And it encouters below build error: -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: error: 'SCTP_SEND_FAILED_EVENT' undeclared (first use in this function); did you mean 'SCTP_SEND_FAILED'? - case SCTP_SEND_FAILED_EVENT: - ^~~~~~~~~~~~~~~~~~~~~~ - SCTP_SEND_FAILED -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1262:9: note: each undeclared identifier is reported only once for each function it appears in -| /build/freediameter/1.2.1-r0/freeDiameter-1.2.1/libfdcore/sctp.c:1274:9: error: 'SCTP_NOTIFICATIONS_STOPPED_EVENT' undeclared (first use in this function); did you mean 'SCTP_AUTHENTICATION_EVENT'? - case SCTP_NOTIFICATIONS_STOPPED_EVENT: - -Update the old sctp socket api check to fix -the above build error. - -Upstream-Status: Pending - -Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> ---- - libfdcore/sctp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libfdcore/sctp.c b/libfdcore/sctp.c -index c80a497..83440c7 100644 ---- a/libfdcore/sctp.c -+++ b/libfdcore/sctp.c -@@ -48,7 +48,7 @@ - /* #define OLD_SCTP_SOCKET_API */ - - /* Automatically fallback to old API if some of the new symbols are not defined */ --#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO))) -+#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_NOTIFICATIONS_STOPPED_EVENT)) || (!defined(SCTP_SNDINFO))) - # define OLD_SCTP_SOCKET_API - #endif - --- -2.7.4 - diff --git a/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch new file mode 100644 index 0000000000..4cedc21ce8 --- /dev/null +++ b/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch @@ -0,0 +1,92 @@ +From 935fcac46e2790e0e297ca855b8033895c1b8941 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Wed, 24 Aug 2022 13:45:32 +0800 +Subject: [PATCH] tests: use EXTENSIONS_DIR + +Use EXTENSIONS_DIR to replace BUILD_DIR as the BUILD_DIR is meanlingless +on target and also fix buildpaths issue. + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + tests/CMakeLists.txt | 1 + + tests/testloadext.c | 12 ++++++------ + tests/testmesg_stress.c | 12 ++++++------ + 3 files changed, 13 insertions(+), 12 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 8b698ce..2c83cbb 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -37,6 +37,7 @@ SET(TEST_LIST + + ADD_DEFINITIONS(-DTEST_DEBUG) + ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}") ++ADD_DEFINITIONS(-DEXTENSIONS_DIR="${EXTENSIONS_DIR}") + + INCLUDE_DIRECTORIES( "../libfdproto" ) + INCLUDE_DIRECTORIES( "../libfdcore" ) +diff --git a/tests/testloadext.c b/tests/testloadext.c +index 452737f..3fffef5 100644 +--- a/tests/testloadext.c ++++ b/tests/testloadext.c +@@ -35,9 +35,9 @@ + + #include "tests.h" + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + #include <sys/types.h> + #include <dirent.h> +@@ -59,9 +59,9 @@ int main(int argc, char *argv[]) + CHECK( 0, fd_rtdisp_init() ); + + /* Find all extensions which have been compiled along the test */ +- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ TRACE_DEBUG(INFO, "Loading from: '%s'", EXTENSIONS_DIR); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +diff --git a/tests/testmesg_stress.c b/tests/testmesg_stress.c +index 310a9d2..97dfe07 100644 +--- a/tests/testmesg_stress.c ++++ b/tests/testmesg_stress.c +@@ -38,9 +38,9 @@ + #include <libgen.h> + #include <dlfcn.h> + +-#ifndef BUILD_DIR +-#error "Missing BUILD_DIR information" +-#endif /* BUILD_DIR */ ++#ifndef EXTENSIONS_DIR ++#error "Missing EXTENSIONS_DIR information" ++#endif /* EXTENSIONS_DIR */ + + + /* The number of times each operation is repeated to measure the average operation time */ +@@ -73,9 +73,9 @@ static void load_all_extensions(char * prefix) + struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); + + /* Find all extensions which have been compiled along the test */ +- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); +- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); +- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); ++ LOG_D("Loading %s*.fdx from: '%s'", EXTENSIONS_DIR, prefix ?: ""); ++ CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 ); ++ pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/"); + + while ((dp = readdir (dir)) != NULL) { + char * dot = strrchr(dp->d_name, '.'); +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-networking/recipes-protocols/freediameter/files/freediameter.service index 514481b431..70ed3803c6 100644 --- a/meta-networking/recipes-protocols/freediameter/files/freediameter.service +++ b/meta-networking/recipes-protocols/freediameter/files/freediameter.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -PIDFile=/var/run/freediameter.pid +PIDFile=/run/freediameter.pid ExecStart=@BINDIR@/freeDiameterd [Install] diff --git a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch deleted file mode 100644 index ea857af7d6..0000000000 --- a/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch +++ /dev/null @@ -1,72 +0,0 @@ -freediameter ptest cases testmesg_stress.c and testloadext.c need load -extensions both build time and runtime. Then they search extensions with -build directory that causes runtime failures. - -Pass an environment variable to define runtime extension path. - -Upstream-Status: Inappropriate [OE ptest specific] - -Signed-off-by: Kai Kang <kai.kang@windriver.com> -Signed-off-by: Jackie Huang <jackie.huang@windriver.com> - -diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c ---- freeDiameter-1.2.0.orig/tests/testloadext.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testloadext.c 2014-02-19 20:08:03.871403924 +0800 -@@ -49,7 +49,7 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - - /* First, initialize the daemon modules */ -@@ -57,11 +57,16 @@ - CHECK( 0, fd_queues_init() ); - CHECK( 0, fd_msg_init() ); - CHECK( 0, fd_rtdisp_init() ); -- -+ -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions"); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); -diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c ---- freeDiameter-1.2.0.orig/tests/testmesg_stress.c 2014-02-19 17:33:24.785405032 +0800 -+++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800 -@@ -67,15 +67,20 @@ - { - DIR *dir; - struct dirent *dp; -- char fullname[512]; -+ char fullname[1024]; - int pathlen; - struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions); - struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends); - -+ char *ext_dir = getenv("EXTENSIONS_DIR"); -+ if (ext_dir) -+ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir); -+ else -+ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ - /* Find all extensions which have been compiled along the test */ -- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: ""); -- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 ); -- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/"); -+ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname); -+ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 ); - - while ((dp = readdir (dir)) != NULL) { - char * dot = strrchr(dp->d_name, '.'); diff --git a/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-networking/recipes-protocols/freediameter/files/run-ptest index d0ca8d9621..7d0648935c 100644 --- a/meta-networking/recipes-protocols/freediameter/files/run-ptest +++ b/meta-networking/recipes-protocols/freediameter/files/run-ptest @@ -6,6 +6,9 @@ if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then echo fi -export EXTENSIONS_DIR=$EXTENSIONS_DIR cmake -E cmake_echo_color --cyan "Running tests..." -ctest --force-new-ctest-process +if ctest --force-new-ctest-process ; then + echo "PASS: freediameter" +else + echo "FAIL: freediameter" +fi diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.5.0.bb index b8818fa6c0..b3282d273b 100644 --- a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb +++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.5.0.bb @@ -7,29 +7,28 @@ Accounting needs." HOMEPAGE = "http://www.freediameter.net" -DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools virtual/kernel bison-native" +DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn2 lksctp-tools virtual/kernel bison-native" PACKAGE_ARCH = "${MACHINE_ARCH}" fd_pkgname = "freeDiameter" -SRC_URI = "\ - http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \ +PV .= "+git" +SRCREV = "f9f1e464e6c675d222b3be4cab9c13408d544c83" +SRC_URI = "git://github.com/freeDiameter/freeDiameter;protocol=https;branch=master \ file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \ + file://run-ptest \ file://freediameter.service \ file://freediameter.init \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://install_test.patch file://run-ptest file://pass-ptest-env.patch', '', d)} \ file://freeDiameter.conf \ - file://0001-libfdcore-sctp.c-update-the-old-sctp-api-check.patch \ + file://install_test.patch \ + file://0001-tests-use-EXTENSIONS_DIR.patch \ " -SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697" -SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097" +S = "${WORKDIR}/git" -S = "${WORKDIR}/${fd_pkgname}-${PV}" - -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=868c059b6147748b1d621e500feeac4f" PTEST_PATH = "${libdir}/${fd_pkgname}/ptest" @@ -47,6 +46,7 @@ EXTRA_OECMAKE = " \ -DBUILD_TEST_RT_ANY:BOOL=ON \ -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \ -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${fd_pkgname} \ + -DEXTENSIONS_DIR:PATH=${libdir}/${fd_pkgname} \ -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \ -DCMAKE_SKIP_RPATH:BOOL=ON \ " @@ -69,7 +69,7 @@ FD_DH_PEM ?= "${BPN}-dh.pem" FD_HOSTNAME ?= "${MACHINE}" FD_REALM ?= "openembedded.org" -do_install_append() { +do_install:append() { # install the sample configuration files install -d -m 0755 ${D}${sysconfdir}/${fd_pkgname} for i in ${S}/doc/*.conf.sample; do @@ -108,32 +108,34 @@ EOF openssl req -x509 -config ${STAGING_DIR_NATIVE}/etc/ssl/openssl.cnf -newkey rsa:4096 -sha256 -nodes -out ${D}${sysconfdir}/freeDiameter/${FD_PEM} -keyout ${D}${sysconfdir}/freeDiameter/${FD_KEY} -days 3650 -subj '/CN=${FD_HOSTNAME}.${FD_REALM}' openssl dhparam -out ${D}${sysconfdir}/freeDiameter/${FD_DH_PEM} 1024 + find ${B} \( -name "*.c" -o -name "*.h" \) -exec sed -i -e 's#${WORKDIR}##g' {} \; } do_install_ptest() { - sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${fd_pkgname}/#" ${D}${PTEST_PATH}/run-ptest mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/ rmdir ${D}${PTEST_PATH}-tests install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/ + sed -i -e 's#${WORKDIR}##g' ${D}${PTEST_PATH}/CTestTestfile.cmake + sed -i "/^set_tests_properties/d" ${D}${PTEST_PATH}/CTestTestfile.cmake } -FILES_${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*" +FILES:${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*" # include the extensions in main package -FILES_${PN} += "${libdir}/${fd_pkgname}/*" +FILES:${PN} += "${libdir}/${fd_pkgname}/*" -RDEPENDS_${PN} = "glib-2.0 gnutls libidn" -RDEPENDS_${PN} += "openssl openssl-conf openssl-engines" -RRECOMMENDS_${PN} += "kernel-module-tipc kernel-module-sctp" -RRECOMMENDS_${PN} += "kernel-module-udp-tunnel kernel-module-ipip" -RDEPENDS_${PN}-ptest = "cmake" +RDEPENDS:${PN} = "glib-2.0 gnutls libidn" +RDEPENDS:${PN} += "openssl openssl-conf openssl-engines" +RRECOMMENDS:${PN} += "kernel-module-tipc kernel-module-sctp" +RRECOMMENDS:${PN} += "kernel-module-udp-tunnel kernel-module-ipip" +RDEPENDS:${PN}-ptest = "cmake" INITSCRIPT_PACKAGES = "${PN}" -INITSCRIPT_NAME_${PN} = "${BPN}" -INITSCRIPT_PARAMS$_${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ." +INITSCRIPT_NAME:${PN} = "${BPN}" +INITSCRIPT_PARAMS:${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ." -SYSTEMD_SERVICE_${PN} = "freediameter.service" +SYSTEMD_SERVICE:${PN} = "freediameter.service" SYSTEMD_AUTO_ENABLE = "disable" -CONFFILES_${PN} = "${sysconfdir}/freediameter.conf" +CONFFILES:${PN} = "${sysconfdir}/freediameter.conf" |