diff mbox series

[meta-networking,4/4] snort3: Fix contains reference to TMPDIR [buildpaths] warnings

Message ID 20240221162057.4154660-4-raj.khem@gmail.com
State Accepted, archived
Headers show
Series [meta-networking,1/4] libdaq: add recipe | expand

Commit Message

Khem Raj Feb. 21, 2024, 4:20 p.m. UTC
Fixes
WARNING: snort3-3+git-r0 do_package_qa: QA Issue: File /usr/lib/pkgconfig/snort.pc in package snort3-dev contains reference to TMPDIR [buildpaths]
WARNING: snort3-3+git-r0 do_package_qa: QA Issue: File /usr/src/debug/snort3/3+git/src/js_norm/pdf_tokenizer.cc in package snort3-src contains reference to TMPDIR
File /usr/src/debug/snort3/3+git/src/js_norm/js_tokenizer.cc in package snort3-src contains reference to TMPDIR [buildpaths]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-cmake-Pass-noline-flag-to-flex.patch | 31 +++++++++++++++++++
 .../recipes-connectivity/snort/snort3_git.bb  |  9 ++++--
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 meta-networking/recipes-connectivity/snort/snort3/0001-cmake-Pass-noline-flag-to-flex.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/snort/snort3/0001-cmake-Pass-noline-flag-to-flex.patch b/meta-networking/recipes-connectivity/snort/snort3/0001-cmake-Pass-noline-flag-to-flex.patch
new file mode 100644
index 0000000000..ec7b90cfb4
--- /dev/null
+++ b/meta-networking/recipes-connectivity/snort/snort3/0001-cmake-Pass-noline-flag-to-flex.patch
@@ -0,0 +1,31 @@ 
+From 417ed0045b3d04f539a8eb18b07a208c75f6c7e1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 20 Feb 2024 16:08:20 -0800
+Subject: [PATCH] cmake: Pass --noline flag to flex
+
+This ensures that line directive is not emitted into lexer output which
+could be absolute build paths, since these files end up in dbg packages
+this can be flagged as a build/packaging warning.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cmake/configure_options.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/configure_options.cmake b/cmake/configure_options.cmake
+index f3673f399..fbd0bd2c3 100644
+--- a/cmake/configure_options.cmake
++++ b/cmake/configure_options.cmake
+@@ -28,7 +28,7 @@ if ( ENABLE_LARGE_PCAP )
+ endif ( ENABLE_LARGE_PCAP )
+ 
+ # Flex Lexer
+-set ( FLEX_FLAGS "-Ca" )
++set ( FLEX_FLAGS "-Ca --noline" )
+ 
+ # documentation
+ 
+-- 
+2.43.2
+
diff --git a/meta-networking/recipes-connectivity/snort/snort3_git.bb b/meta-networking/recipes-connectivity/snort/snort3_git.bb
index 0f4a86f61e..4bc2395fae 100644
--- a/meta-networking/recipes-connectivity/snort/snort3_git.bb
+++ b/meta-networking/recipes-connectivity/snort/snort3_git.bb
@@ -7,10 +7,11 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"
 
 PV = "3+git${SRCPV}"
 
-DEPENDS = "flex hwloc libdaq libdnet libpcap libpcre libtirpc libunwind luajit zlib"
+DEPENDS = "flex-native hwloc libdaq libdnet libpcap libpcre libtirpc libunwind luajit zlib"
 
 SRC_URI = "git://github.com/snort3/snort3.git;protocol=https;branch=master \
-           file://0001-cmake-Check-for-HP-libunwind.patch"
+           file://0001-cmake-Check-for-HP-libunwind.patch \
+           file://0001-cmake-Pass-noline-flag-to-flex.patch"
 SRCREV = "e1760a8dbb829bb3fcf1a340ab6cc4bb80a47ecd"
 
 S = "${WORKDIR}/git"
@@ -19,6 +20,10 @@  PACKAGES =+ "${PN}-scripts"
 
 inherit cmake pkgconfig
 
+do_install:append() {
+    sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/pkgconfig/snort.pc
+}
+
 FILES:${PN} += "${libdir}/snort/daq/*.so"
 
 FILES:${PN}-scripts = "${bindir}/appid_detector_builder.sh"