mingw-filesystem/mingw32-find-requires.sh
Kalev Lember 2de8bb604b Generate versionless mingw32-filesystem Requires
The automatically generated Requires were too strict, making every
binary rpm depend on the very latest mingw32-filesystem. For almost all
packages any mingw32-filesystem from Fedora repos is sufficient.

Using versionless mingw32-filesystem Requires avoids the situation where
e.g. downgrading mingw32-filesystem would be impossible due to other
packages needlessly depending on it.
2011-05-20 15:50:52 +03:00

28 lines
660 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.
if [ "$1" ]
then
package_name="$1"
fi
[ -z "$OBJDUMP" ] && OBJDUMP=i686-pc-mingw32-objdump
# Get the list of files.
filelist=`sed "s/['\"]/\\\&/g"`
# Everything requires mingw32-filesystem and mingw32-runtime.
echo 'mingw32-filesystem'
echo 'mingw32-runtime'
dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$')
for f in $dlls; do
$OBJDUMP -p $f | grep 'DLL Name' | grep -Eo '[-._\+[:alnum:]]+\.dll' |
tr [:upper:] [:lower:] |
sed 's/\(.*\)/mingw32(\1)/'
done | sort -u