From 97fa708ecc14ca8a2136b586b7eca113b7020fd3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 31 Aug 2026 01:49:54 -0400 Subject: sbopkglint: improve library path checking for .pc files. --- sbopkglint.d/95-pkgconfig.t.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'sbopkglint.d') diff --git a/sbopkglint.d/95-pkgconfig.t.sh b/sbopkglint.d/95-pkgconfig.t.sh index ac0f182..cd77889 100644 --- a/sbopkglint.d/95-pkgconfig.t.sh +++ b/sbopkglint.d/95-pkgconfig.t.sh @@ -27,10 +27,13 @@ check_libinc_dir() { local flag=$2 local file=$3 local dir + local dir_rp #echo "===> $flag" dir="$( printf "%s" $flag | tail -c+3 )" + dir_rp="$( realpath -m "$dir" )" + case "$dir" in /usr/local*) warn "$file references $type dir $dir; /usr/local is incorrect" @@ -38,6 +41,27 @@ check_libinc_dir() { ;; esac + # 20260831 bkw: allow some common lib and include paths even if + # they're not in the package. scafacos was complaining: + # --- ERR: usr/lib64/pkgconfig/scafacos.pc references library dir /usr/lib64/gcc/x86_64-slackware-linux/11.2.0, but it's missing from the package + # ...even though it's a valid path on Slackware. also it was + # bitching about /lib/../lib64/, which isn't in the package, but + # shoud be allowed (as it's just /lib64). + + # note that realpath gets rid of any trailing slash(es), so + # /usr/include/ would come out /usr/include + if [ "$type" = "include" ]; then + case "$dir_rp" in + /usr/include) return ;; # always OK (shouldn't be mentioned in a .pc tho) + esac + elif [ "$type" = "library" ]; then + case "$dir_rp" in + /lib|/lib64|/usr/lib|/usr/lib64) return ;; + /usr/lib/gcc/*-slackware-linux/*) return ;; + /usr/lib64/gcc/*-slackware-linux/*) return ;; + esac + fi + [ -d $PKG/$dir ] || warn "$file references $type dir $dir, but it's missing from the package" } -- cgit v1.2.3