tcpreplay: fix buildpaths QA warning in tcpreplay-dev package

configure is invoked with --with-libpcap=${STAGING_DIR_HOST}${prefix},
which causes libpcap's absolute recipe-sysroot path to be baked into
two generated files:

  - src/defines.h: the #include <...pcap.h> path substituted from
    @LPCAPINC@
  - src/libtcpreplay.pc: the -L<path> in Libs.private substituted from
    @LIBS@/@LIBTCPREPLAY_PCLIBS@

Both are shipped in the tcpreplay-dev package, tripping:

  WARNING: tcpreplay-4.6.0-r0 do_package_qa: QA Issue: File
  /usr/lib/pkgconfig/libtcpreplay.pc in package tcpreplay-dev contains
  reference to TMPDIR [buildpaths]
  WARNING: tcpreplay-4.6.0-r0 do_package_qa: QA Issue: File
  /usr/include/tcpreplay/defines.h in package tcpreplay-dev contains
  reference to TMPDIR [buildpaths]

The existing do_install:append() sed only stripped ${RECIPE_SYSROOT}
from ${S}/src/defines.h (needed separately, since that file is shipped
verbatim into the tcpreplay-src debug package), but ${D}/.../defines.h
and libtcpreplay.pc are copied into ${D} by the automake install rules
before :append() runs, so they were never touched. Extend the sed to
also cover both installed files under ${D}.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj
2026-08-10 22:53:42 -07:00
parent 7a9d8e0b1c
commit 2ec5e69d18
@@ -23,5 +23,13 @@ EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}${prefix}"
inherit siteinfo autotools-brokensep
do_install:append() {
# configure --with-libpcap=${STAGING_DIR_HOST}${prefix} bakes the absolute
# recipe-sysroot path into defines.h's pcap.h include and into
# libtcpreplay.pc's Libs.private -L flag, tripping the buildpaths QA
# check. Strip it from both the source tree copy (shipped verbatim into
# the tcpreplay-src debug package) and the installed copies under ${D}.
sed -i -e 's:${RECIPE_SYSROOT}::g' ${S}/src/defines.h
sed -i -e 's:${RECIPE_SYSROOT}::g' \
${D}${includedir}/tcpreplay/defines.h \
${D}${libdir}/pkgconfig/libtcpreplay.pc
}