aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/95-pkgconfig.t.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbopkglint.d/95-pkgconfig.t.sh')
-rw-r--r--sbopkglint.d/95-pkgconfig.t.sh24
1 files changed, 24 insertions, 0 deletions
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"
}