mirror of
https://github.com/Maks1mS/rg552-fancontrol-phosh-plugin.git
synced 2025-11-28 09:21:54 +03:00
build: Add detection script for a better package maintenance experience
This commit is contained in:
18
scripts/detect-libphosh-api-version.sh
Normal file
18
scripts/detect-libphosh-api-version.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
pc_file=$(find "/usr/lib64/pkgconfig" -maxdepth 1 -type f -name "libphosh-*.pc" | head -n 1)
|
||||
|
||||
if [ -z "$pc_file" ]; then
|
||||
echo "File libphosh-*.pc not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version=$(basename "$pc_file" | sed -E 's/^libphosh-([0-9.]+)\.pc$/\1/')
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "Can't detect version of $pc_file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $version
|
||||
exit 0
|
||||
Reference in New Issue
Block a user