mingw-filesystem/mingw.prov
Orion Poplawski df0ee64736 Add pkgconfig provides for installed pkgconfig files
For example:
  * Provides: mingw32-pkgconfig(qt5svg)
  * Provides: mingw64-pkgconfig(qt5svg)
2023-09-13 20:00:31 -06:00

35 lines
920 B
Bash
Executable File

#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ] [ ucrt64 ]"
exit 1
fi
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.dll$')
for f in $dlls; do
basename=`basename $f | tr '[:upper:]' '[:lower:]'`
for target in $targets; do
host_triplet=`rpm --eval "%{${target}_target}"`
[[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)"
done
done
pcs=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.pc$')
for f in $pcs; do
basename=`basename $f .pc | tr '[:upper:]' '[:lower:]'`
for target in $targets; do
host_triplet=`rpm --eval "%{${target}_target}"`
[[ $f =~ .*$host_triplet.* ]] && echo "${target}-pkgconfig($basename)"
done
done
exit 0